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

ZI Data extends area assigned in linker script

Hello,

i read a little bit about zi-data in the other threads here.

I'm glad that it's possible to ask such "easy" questions which could also be answered "just" by reading a few hundred pages of documentation. ;-)

Now reviewing the project i stepped over following question:

This is the linker script:

LR_IROM1 0x08000000 0x00200000 { ; load region size_region ER_IROM1 0x08000000 0x00200000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) } RW_IRAM1a 0x20000000 0x00025000 { ; RW data .ANY (+RW +ZI) } RW_IRAM1b 0x20025000 0x00025000 { *.o(STACK, +Last) }

; [20160314_HeapInSdRam_NewCode] RW_SDRAM 0xD0000000 0x00780000 { ; 8 MB *.o (HEAP, +First) }
; [/20160314_HeapInSdRam_NewCode]

}

This is the map file: Total RO Size (Code + RO Data) 1524588 (1488.86kB) Total RW Size (RW Data + ZI Data) 8038188 (7849.79kB) Total ROM Size (Code + RO Data + RW Data) 1532760 (1496.84kB)

Gosh, that formating! Conclussion: I see that the size allocated for RW+ZI-Data (RW_IRAM1a) is way too small to hold all the zi data stated in the map file. The project is running fine. How can this be true?

I have further questions in my mind:

a) Does RW_IRAM1a area automatically fallback to use the HEAP ?
b) If a=yes, is it ensured, that the memory used by zi is reserved and not allocateable via malloc / c++ new operator.
c) if b=false, it may happen at some milestone in the project lifetime that bad memory errors occur?!
d) IF ZI-Data would just overlap overwriting the Stack araea (RW_IRAM1b) the program is unlikely to run stable?!

Can anybody answer this? Thanks in advance!