The Realview MDK toolchain provides a number of $$ linker generated variables with the base, limit and size of sections.
What I need is such a variable that holds the total amount of ram present in an entire region but I can not seem to find this.
To be more specific, the generated scatter file is as shown below and what I need is a $$ linker generated variable returning the second numeric value of this line:
RW_IRAM1 0x10000000 0x00008000
So 0x00008000
; ************************************************************* ; *** Scatter-Loading Description File generated by uVision *** ; ************************************************************* LR_IROM1 0x00000000 0x00080000 { ; load region size_region ER_IROM1 0x00000000 0x00080000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) } RW_IRAM1 0x10000000 0x00008000 { ; RW data .ANY (+RW +ZI) } }
Something like Image$$RW_IRAM1$$ZI$$Limit or Image$$ER_IROM1$$Length ?
Thanks for your reply,
these are the ones I tried. Variable Image$RW_IRAM1$ZI$Limit is set to the limit of the zero initialized section. So this variable only tells how much of the RAM is used. What I need is a variable identifying the physical amount of memory present. I tried all variables I could find in the linker manual but none of them seems to provide this value. Still I think there should be one, the linker knows it.
Maybe: (just guessing)
Image$$region_name$$Length -> Execution region length in bytes excluding ZI length.
+
Image$$region_name$$ZI$$Length -> Length of the ZI output section in bytes.
www.keil.com/.../armlink_chdcgbjd.htm