RAM/ROM Usage builder Output :-)

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

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

RAM/ROM Usage builder Output :-)

Post by Tabulous »

Hi All
hope this is can be useful to others.

Wanted an easy way to show how much RAM/ROM was been used. You can do this looking at the *.map file and then work it out, but i wanted something easier.

Another forum user created a python script that does the same, but this needs you to download/install python to run.

So here is my version, this is what you will see after you have built your application, as you can see you know the RAM/ROM usage and how much the heap fill is. All very simple :-) Feel free to download and setup in your chibistudio. See readme for details.

make -j8 all
Linking build/ch.elf
Creating build/ch.hex
Creating build/ch.bin
Creating build/ch.dmp
Creating build/ch.list

text data bss dec hex filename
43776 1432 15304 60512 ec60 build/ch.elf

Heap Fill: 24.6% - 3.93/16KB
RAM usage: 75.4% - 12.07/16KB
ROM usage: 34.2% - 43.80/128KB

Done
Attachments
binsize.zip
(7.74 KiB) Downloaded 716 times
acr
Posts: 14
Joined: Tue Nov 18, 2014 3:52 am

Re: RAM/ROM Usage builder Output :-)

Post by acr »

in linux it easy to install python, and hard to run .exe
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: RAM/ROM Usage builder Output :-)

Post by Tabulous »

acr wrote:in linux it easy to install python, and hard to run .exe


In windows its easy to install python too, but i did not want to install a whole package like that just to run a script......

I already have a big bloaty package installed, .Net so might as well use it :-)
raulvalencia2
Posts: 1
Joined: Mon Sep 06, 2021 9:59 am

Re: RAM/ROM Usage builder Output :-)

Post by raulvalencia2 »

Hi,

another way to know the size of ram used... ?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: RAM/ROM Usage builder Output :-)

Post by Giovanni »

Hi,

Simplest way: look in the .map file, it is all in there.

Giovanni
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: RAM/ROM Usage builder Output :-)

Post by steved »

I just added:

Code: Select all

  USE_LDOPT = --print-memory-usage


to the makefile, near the top.

This prints more detailed usage information at the end of linking, which might suffice.
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: RAM/ROM Usage builder Output :-)

Post by mobyfab »

my python code it's based on if someone need to modify it: viewtopic.php?f=8&t=2407
Post Reply