This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

global variable space, IRAM

Every so often I chase memory overflows (IRAM or variable space) and I never remember where the settings are that need to be changed.

I added a global structure array that caused my code not to even run. When I reduced the size of the new array, the code ran again, so I knew I was on the edge of an overrun. But, it doesn't look like it, or I don't know what I am looking for. My IRAM1 starts at 0x40000800 with a size of 0xC000. I have a stack space of 1K and heap size of 2K in my startup. In the memory map, the RW Data + ZI Data is 30528. If I raise the size of the array, that makes the RW+ZI 30750, the system won't run. What does the 0xC000 include? That is 49K. Is that not associated with RO+ZI? What other settings do I need to check? Thanks.

Sutton

  • What part are you using, 0xC000 in length for an 0x40000800 basis seems a bit odd, are you sure the length isn't 0xB800?

    Are you using a Cortex-Mx part? Is it perhaps Hard Faulting when it's "not working"? What kind of debugging have you done? Anything interesting in the .MAP file about where things get placed with respect to the capabilities of the part?

    You'd typically configure the memory size for the specific chip/die chosen in the Target dialog, or by using a scatter file.

    Does the data in the array need to be initialized? Is it possible you have some heap/stack/static collision going on via an errant pointer, or out-of-bounds access?