Page 1 of 1

Memory usage script

Posted: Fri Jan 23, 2015 11:54 pm
by mobyfab
Hey,

I made a small python script that checks the memory usage of my chibiOS projects.

You can find the code here: https://github.com/fpoussin/MotoLink/bl ... binsize.py

Output example:

Code: Select all

$ ./binsize.py

MotoLink
CCM used: 65% -  5.3/8.0k
RAM used: 71% - 28.6/40.0k
ROM used: 30% - 39.6/128.0k

BootLoader
CCM used: 37% -  3.0/8.0k
RAM used: 18% -  7.5/40.0k
ROM used: 64% - 12.9/20.0k


You need to modify the script to put you binary name as well as the total space available.

Re: Memory usage script

Posted: Thu Dec 03, 2015 8:14 am
by samtatasurya
Hi,

I was trying to implement this script to test the memory usage of the code I wrote for STM32F051R8 (STM32F0 Discovery board).
I already changed the application path to point to ch.elf of my program.

For example,

DIRECTORY:
+ test_app/build/ch.elf
+ binsize.py

IN THE CODE:

Code: Select all

test1.path = "test_app/build/ch.elf"


However, when I ran the program, the following error occurred:

Code: Select all

Traceback (most recent call last):
  File "C:\ChibiStudio\workspace30\binsize.py", line 22, in <module>
    p = Popen(["arm-none-eabi-size", "-A", app.path], stdout=PIPE)
  File "C:\Python27\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 958, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified


I wonder what is going wrong with it.

Thank you for your help! :)

Re: Memory usage script

Posted: Thu Dec 03, 2015 12:38 pm
by mobyfab
Try to use windows paths.