Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Arduino RAM usage estimate... (Read 12610 times)
Charlie Foxtrott
Newbies
*
Offline


Posts: 3
Joined: Jan 27th, 2012
Arduino RAM usage estimate...
Feb 9th, 2012 at 9:39pm
Print Post  
A very useful feature would be to display the RAM usage after compilation, as per this forum post:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1224729260/all

-CF
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino RAM usage estimate...
Reply #1 - Feb 9th, 2012 at 9:58pm
Print Post  
yes that looks good. 

I might be wrong but the example uses settings from the boards.txt file to determine of it should check the ram usage. it also defaults to assuming a limit of 1024 bytes if a max size property is not defined for a board

This seems difficult for users to maintain seeing most people don't know about the boards.txt file. furthermore the max ram size property isn't defined in the standard arduino boards.txt file.

So, should we also have a registry property that switches on reporting of ram usage overriding the boards.txt?
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino RAM usage estimate...
Reply #2 - Feb 9th, 2012 at 10:04pm
Print Post  
By the way do you know if it would make sense for vm to optionally replace all static stings with a progmem call at compile time?
  
Back to top
IP Logged
 
sixeyes2
Junior Member
**
Offline


Posts: 93
Location: Guildford, United Kingdom
Joined: Dec 19th, 2011
Re: Arduino RAM usage estimate...
Reply #3 - Feb 10th, 2012 at 7:24pm
Print Post  
Could you use the define RAMEND? Or does it need to be in Boards.txt?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino RAM usage estimate...
Reply #4 - Feb 10th, 2012 at 8:31pm
Print Post  
The max limit can be anywhere but it is different for each board. We could just ignore the limit and report usage, users would have to know their own board limits?
  
Back to top
IP Logged
 
Charlie Foxtrott
Newbies
*
Offline


Posts: 3
Joined: Jan 27th, 2012
Re: Arduino RAM usage estimate...
Reply #5 - Feb 10th, 2012 at 11:23pm
Print Post  
Thank you for considering my suggestion.

I, for one, am just looking for the usage value with out having to go dig it up manually. The error message is a bonus for when I'm not paying attention.

Given the small number of AVR's in the official Arduino realm, simply cross-reference the .build.mcu data-point from boards.txt with a separate look-up file. (FWIW I believe the registry really should be avoided for this type of data) 

The VM cross-reference can be updated when a new AVR is added to the official spec, or tweaked by the advanced user when making different AVR's play nice.

(Thinking out-loud) Of course this could get interesting with Megas running ext-ram... avr-objdump should still report the static usage... I suppose a cloned board profile referencing a different mcu entry, cross referenced to the total paged ram would solve that. 

-CF
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino RAM usage estimate...
Reply #6 - Feb 11th, 2012 at 12:23am
Print Post  
yep sounds good thanks. i agree registry might only be used for a single default value for all boards such as 1024 but as you have suggested we can do better than that but   

if you get a chance to add the suggestion to codeplex that would really help. we tend to add them after they have been discussion a bit.

you will see that i already added your good serial tool ideas to the codeplex issues list. i know these things are not issues but it's a less cluttered space.
  
Back to top
IP Logged
 
sixeyes2
Junior Member
**
Offline


Posts: 93
Location: Guildford, United Kingdom
Joined: Dec 19th, 2011
Re: Arduino RAM usage estimate...
Reply #7 - Feb 11th, 2012 at 10:10am
Print Post  
Tim@Visual Micro wrote on Feb 10th, 2012 at 8:31pm:
The max limit can be anywhere but it is different for each board. We could just ignore the limit and report usage, users would have to know their own board limits?


I was suggesting using the RAMEND #define generated by the compiler based on the MCU definition which presumably comes from a setting in boards.txt

I was wondering if each time the user swapped boards in the menu you could run a program to determine the maximum RAM using the value generated by RAMEND?

Iain
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino RAM usage estimate...
Reply #8 - Feb 11th, 2012 at 2:43pm
Print Post  
Oh! I never thought of that. Great idea, I will explore
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino RAM usage estimate...
Reply #9 - Oct 28th, 2012 at 3:07am
Print Post  
The debugger provides a graphical display of free memory. have you tried it? Does it solve this request?

Thanks
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint