Compile AVR programs for an attiny85 using CMake. No dependencies on arduino. Based on https://github.com/tttapa/Arduino-AVR-CMake.
brew install avr-gcc
- Install micronucleus
brew install pkg-config libusb libusb-compat libusb-dev
gh repo clone https://github.com/micronucleus/micronucleus
cd micronucleus/commandline
make install
- Configure the project using CMake by running the following command:
cmake -S. -Bbuild \ -D CMAKE_TOOLCHAIN_FILE=cmake/toolchain/avr.toolchain.cmake \ -D CMAKE_BUILD_TYPE=MinSizeRel
- Finally, build and upload the example “blink” program (using micronucleus):
To compile the program without uploading, you can use
cmake --build build -j -t upload-blink
cmake --build build -j -t blink
Some stuff comes preconfigured.