Giter Site home page Giter Site logo

prettier-size-printer's Introduction

Prettier firmware size printer

Print size of used FLASH and RAM storage of avr and stm firmware by elf file. Allow to print used percents, and RAM usage of stack with help of ezstack.

Usage

--size=<path to toolchain size tool>
--elf=<path to elf file>
--ezstack=<path to stack analyzer ezstack> *optional
--mcu=<name of mcu, supported all avr mcu and stm32...>
--maxflash=<maximum size of flash. Needs for stm32 mcu. If specified prints used percents> *optional
--maxram=<maximum size of ram. Needs for stm32 mcu. If specified prints used percents> *optional

Example

python size_printer.py --size=path/to/avr-size.exe --elf=path/to/firmware.elf --ezstack=path/to/ezstack.exe --mcu="atmega168p"

Result

Device: atmega168p. Program data: 224 bytes (4.0%). RAM usage: 214 bytes (20.9%).

From CMake

set (PATH_TO_UTILITY size_printer.py)
set (PATH_TO_EZSTACK ezstack.exe)
add_custom_command(
	TARGET ${EXECUTABLE_NAME} POST_BUILD
	COMMAND
		${PYTHON_EXECUTABLE} ${PATH_TO_UTILITY}
		--size=${CMAKE_SIZE}
		--elf=${OUTPUT_DIR}/${elf_file}
		--ezstack=${PATH_TO_EZSTACK}
		--mcu=${MCU}
		)
)

Tests

Before run tests, set ENVIRONMENT VARIABLES (by .env file for example):

PATH_TO_AVR_SIZE_TOOL = <avr-size.exe>
PATH_TO_STM32_SIZE_TOOL = <arm-none-eabi-size.exe>
PATH_TO_EZSTACK = <ezstack.exe>

prettier-size-printer's People

Contributors

loggi-pro avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.