Skip to content

Instantly share code, notes, and snippets.

@kevincolten
Last active May 14, 2019 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevincolten/6705a02916b871293b7b1e1e702de15d to your computer and use it in GitHub Desktop.
Save kevincolten/6705a02916b871293b7b1e1e702de15d to your computer and use it in GitHub Desktop.
Compile arduino sketch to assembly on a Mac
  1. Export .ino file and rename to .cpp

  2. Add #include <Arduino.h> to top of the file

  3. run

    avr-g++    -I /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/ -I /Applications/Arduino.app/Contents/Java//hardware/arduino/avr/variants/standard    -x c++  -MMD -c -mmcu=atmega328p -Wall -DF_CPU=16000000L  -Wall  -Os SR04_Example.cpp
  4. avr-objdump -S SR04_Example.o >> SR04_Example.lst

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment