Memory usage script

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
Post Reply
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Memory usage script

Post 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.
samtatasurya
Posts: 22
Joined: Sun Nov 29, 2015 8:13 pm

Re: Memory usage script

Post 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! :)
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: Memory usage script

Post by mobyfab »

Try to use windows paths.
Post Reply