Skip to main content
cc1
Associate
July 8, 2015
Question

monitor RAM usage

  • July 8, 2015
  • 3 replies
  • 1315 views
Posted on July 08, 2015 at 02:48

Hi,

I'm using STM32L053 Nucleo, I have wrote some code for it to run, and I wish to do a RAM estimation to see RAM usage of current firmware. How to see the RAM usage?

Regards

#dynamic-memory-usage
    This topic has been closed for replies.

    3 replies

    Tesla DeLorean
    Guru
    July 8, 2015
    Posted on July 08, 2015 at 03:23

    Most embedded code uses static allocation, as it's apt not to fail due to fragmentation and leakage. For that you'd look at your .MAP file.

    For dynamic you'd need to familiarize yourself with your implementation's allocator, and perhaps code a routine to walk through the allocation chains, or track the malloc/free activity.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    cc1
    cc1Author
    Associate
    July 8, 2015
    Posted on July 08, 2015 at 07:22

    in the .map file, at ''Memory Map of the image'' section, the Size in ''Execution Region RW_IRAM1'', would this be the RAM usage?

    assume the firmware didn't use any dynamic memory allocation. 

    Tesla DeLorean
    Guru
    July 8, 2015
    Posted on July 08, 2015 at 18:59

    Assuming Keil, but you should really be specific about what you use, because I don't know

    The ''Total RW Size (RW Data + ZI Data)'' might be more explicit if more than one RAM region.

    Execution Region RW_IRAM1 (Base: 0x20000000, Size: 0x00003550, Max: 0x00018000, ABSOLUTE, COMPRESSED[0x00000278])
    Base Addr Size Type Attr Idx E Section Name Object
    0x20000000 0x000004f4 Data RW 237 .data main.o
    0x200004f4 0x00000004 Data RW 238 .data main.o
    0x200004f8 0x00000004 Data RW 239 .data main.o
    0x200004fc 0x00000004 Data RW 247 .data main.o
    0x20000500 0x00000004 Data RW 249 .data main.o
    0x20000504 0x00000010 Data RW 3774 .data stm32f2xx_rcc.o
    0x20000514 0x00000004 Data RW 5999 .data mc_w.l(errno.o)
    0x20000518 0x00002038 Zero RW 231 .bss main.o
    0x20002550 0x00001000 Zero RW 5562 STACK startup_stm32f2xx.o
    ..
    Total RW Size (RW Data + ZI Data) 13648 ( 33kB)

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..