We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
How can I get the address of the first unused location in RAM to use in my application? My scatter file is below. I have tried using "Image$$RW_IRAM1$$Limit", but this returns the end of initialized data. The zero data is allocated from RAM after this, and I have not been able to find a way to get the end of that address. Is there a way to do this?
Processor: STM32L552
Tools: uVision 5
Scatter file:
; *************************************************************; *** Scatter-Loading Description File generated by uVision ***; *************************************************************
; Vector tableLR_VECTOR_TABLE 0x08000000 0x00000200{ ER_VECTOR_TABLE 0x20000000 0x00000200 { *.o (RESET, +First) ; Vector table location in RAM. }}
; load region size_regionLR_IROM1 (0x08000000 + 0x00000200) (0x00080000 - 0x00000200){ ; load address = execution address ER_IROM1 (0x08000000 + 0x00000200) (0x00080000 - 0x00000200) { *(InRoot$$Sections) .ANY (+RO) .ANY (+XO) }
; RW data RW_IRAM1 (0x20000000 + 0x00000200) (0x00040000 - 0x00000200) { .ANY (+RW +ZI) }}
Doing a little more digging and experimenting, I found the answer:
Image$$RW_IRAM1$$Limit: Gives you the size of the initialized RAM.
Image$$RW_IRAM1$$ZI$$Limit: Gives you the size of all used RAM.