[SOLVED] Report memory

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
indigos
Posts: 14
Joined: Sat Jun 02, 2012 10:46 am

[SOLVED] Report memory

Post by indigos »

Hi,

Can I see the RAM static and dynamic allocated with command in shell?
Can I see the static RAM allocated with gcc/eclipse? I tried to read map file but I don't understand which informations I need read.

Thank you
Last edited by indigos on Sun Jun 10, 2012 11:55 am, edited 1 time in total.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Report memory

Post by Giovanni »

Hi,

The shell command "mem" gives you info about the used/free memory and the fragmentation status at runtime.

Statically allocated memory can be seen by reading the file ch.map created under ./build after compiling any demo. There you can see position and size of all modules.

Giovanni
DrunkenDonkey
Posts: 124
Joined: Sun Aug 28, 2011 5:16 pm

Re: Report memory

Post by DrunkenDonkey »

Based on code provided in this forum (sorry, can't remeber by who, but thanks) I hacked some script to display the memory usage after build and also create report which are biggest memory and code hogs for optimization. Just add somwhere at the bottom of your makefile:

include memory.mk

I did it just before the included rules.mk

The result in the console after build:

Code: Select all

Ram usage
Creating build/iMedical.dmp
   text      data       bss       dec       hex   filename
  66868      1488     11692     80048     138b0   build/project.elf

Done
SRAM:  stacks = 0, program = 12940, total = 12940, left = 3444, mcu_ram = 16384, utilization = 78%


edit: found where I took it from, thanks mabl :D
Attachments
memory.zip
(1.11 KiB) Downloaded 509 times
Post Reply