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

How to determine size of RAM present in controller

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)
  }
}

Parents
  • 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.

Reply
  • 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.

Children