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.
mobyfab
Posts: 483
Joined: Sat Nov 19, 2011 6:47 pm
Location: Le Mans, France
Has thanked: 21 times
Been thanked: 30 times

Memory usage script

Postby mobyfab » Fri Jan 23, 2015 11:54 pm

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

Postby samtatasurya » Thu Dec 03, 2015 8:14 am

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: 483
Joined: Sat Nov 19, 2011 6:47 pm
Location: Le Mans, France
Has thanked: 21 times
Been thanked: 30 times

Re: Memory usage script

Postby mobyfab » Thu Dec 03, 2015 12:38 pm

Try to use windows paths.


Return to “User Projects”

Who is online

Users browsing this forum: No registered users and 10 guests