AnsweredAssumed Answered

Reducing unneeded memory use

Question asked by joe42 on May 1, 2017
Latest reply on Apr 16, 2018 by JTJ

I've noticed that when compiling projects in Sigmastudio, the output .h header files are always padded to the full memory size, regardless of what is actually used.  For example:

 

#define PARAM_SIZE_IC_TONE 4096
#define PARAM_ADDR_IC_TONE 0
ADI_REG_TYPE Param_Data_IC_TONE[PARAM_SIZE_IC_TONE] = {
0x00, 0x00, 0x00, 0xFF,
0x00, 0x00, 0x22, 0x22,
0x00, 0x80, 0x00, 0x00,
0x00, 0x86, 0x66, 0x66,
0x00, 0x00, 0x00, 0xFF,
0x00, 0x4E, 0xB5, 0xEE,
0x00, 0x80, 0x00, 0x00,
0x00, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x03, 0x47,
0x00, 0x00, 0x08, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00,

(and zeros from then on...)

This happens when declaring Program_Data_... as well, of course.  (Program size is always 5120, no matter what is really used.)  In my case, I'm using well under 1kB of data, but yet my microcontroller is forced to allocate about 10kB of space.

 

Is there a workaround to have the headers generated by Sigmastudio only declare and allocate the memory that is actually going to be used, rather than everything that's available?

 

It otherwise wastes tremendous amounts of precious microcontroller space unnecessarily, and manually editing the headers every time is quite tedious.

 

(Of course, this really should be the default behavior for SigmaStudio.  Can this feature be added?)

Outcomes