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
Normal Topic PROGMEM and Memory Usage (Read 4327 times)
goge
Newbies
*
Offline


Posts: 1
Joined: Sep 30th, 2014
PROGMEM and Memory Usage
Sep 30th, 2014 at 10:32pm
Print Post  
It seems memory usage doesn't take into account strings / values stored in program flash using PROGMEM or the F() macro.

Is there a way to get such strings' memory removed from the Memory Usage count?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: PROGMEM and Memory Usage
Reply #1 - Oct 1st, 2014 at 9:01am
Print Post  
Hi,

The compiler memory indicator works the same way that the Arduino IDE works.

If you have the Plus version of Visual Micro you can switch on the advanced memory report which might help. You can also provide your own switches for the report if required but the default might do what you need. More info here

http://www.visualmicro.com/page/User-Guide.aspx?doc=Project-Properties-Reference...
  
Back to top
WWW  
IP Logged
 
stevech
Member
***
Offline


Posts: 147
Location: So. Calif. US
Joined: Jun 16th, 2013
Re: PROGMEM and Memory Usage
Reply #2 - Oct 25th, 2014 at 7:45am
Print Post  
I looked at the asm code for the mega328 from a large C/C++ program. The GCC compiler does some clever things with the AVR registers. 
But too, I see the 8 bitter struggle with many lines of code just to check if a uint32_t is 0.
On an ARM Cortex, it's one instruction.

that's the way it is.
« Last Edit: Oct 25th, 2014 at 7:45am by stevech »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: PROGMEM and Memory Usage
Reply #3 - Oct 25th, 2014 at 10:46am
Print Post  
My knowledge is weak in this area.

What I do know is that an 8 bit processor needs to process each of the 4 bytes (4x8 bits) to make a 32 bit number whereas a 32 bit processor processes bytes in blocks of 4

Not sure it that is an answer  Smiley
« Last Edit: Oct 25th, 2014 at 10:46am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
stevech
Member
***
Offline


Posts: 147
Location: So. Calif. US
Joined: Jun 16th, 2013
Re: PROGMEM and Memory Usage
Reply #4 - Dec 13th, 2014 at 7:52pm
Print Post  
It's too bad that today's ARM micros can't more quickly supersede AVRs - because for newbies, having native ints be 32 bits, and eliminating the PITA/horrid dual address space that AVR and PIC have (Harvard architecture) simplifies so many things, esp. libraries.

I work with ARMs now more than AVR. It's like the difference between driving a 1959 VW and a Lexus, both of which I've owned.

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