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 Problem with PROGMEM not loading variables into Flash (Read 999 times)
Rich R
Junior Member
**
Offline


Posts: 31
Joined: Mar 2nd, 2016
Problem with PROGMEM not loading variables into Flash
Jul 22nd, 2017 at 5:25pm
Print Post  
I'm using VM on Studio 2015.  I'm trying to load a helpfile into Flash since it's fairly large and there isn't alot of SRAM around.  I define an array of strings:

const String  PROGMEM    longstringtable[]  = {
     "RS232 and Telnet Commands Include:|",
.
.
.
     "--------------------------------|"
}

The text is around 3k.  When I compile and execute the code, I have around 25K free, yet commenting this line out it climbs up to 28K free.  Right now, there are no references to the variable in the code which would pull it in.  Looking through the Arduino forums they mention an old bug in the GCC tools around PROGMEM not actually having the compiler place the data in the right segment.  Their suggestion:

const dataType variableName[] PROGMEM = {};   // use this form
const PROGMEM  dataType  variableName[] = {}; // or this form
const dataType PROGMEM variableName[] = {};   // not this one

But none have worked for me - regardless of structure of the declaration I get the 3K SRAM taken up.

Anyone have any ideas?  I can read this from FRAM over I2C but it's clunky and I have the flash to spare.

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