Skip to content

Instantly share code, notes, and snippets.

@blalor
Created February 6, 2011 13:11
Show Gist options
  • Save blalor/813359 to your computer and use it in GitHub Desktop.
Save blalor/813359 to your computer and use it in GitHub Desktop.
shows how much ram and program space is used by a compiled program
#!/bin/bash
# http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=792113#792113
# ".data+.bss+.noinit is the initial RAM allocation."
# AVR Memory Usage
# ----------------
# Device: atmega328p
#
# Program: 12580 bytes (38.4% Full)
# (.text + .data + .bootloader)
#
# Data: 960 bytes (46.9% Full)
# (.data + .bss + .noinit)
mcu="atmega328p" # attiny85, etc.
avr-size --format=avr --mcu=${mcu} "${0}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment