Skip to content

Instantly share code, notes, and snippets.

@dwf
Created March 21, 2022 23:14
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 dwf/b53da9eddac2b7f5a3aaeffca200b8ae to your computer and use it in GitHub Desktop.
Save dwf/b53da9eddac2b7f5a3aaeffca200b8ae to your computer and use it in GitHub Desktop.
Makefile for flashing a nanoCUL stick with the latest version of the evofw3 firmware.
# Copyright 2022 Google LLC.
# SPDX-License-Identifier: Apache-2.0
#
# Makefile for flashing a nanoCUL stick with evofw3 using arduino-cli.
#
# Get arduino-cli and make with `nix shell nixpkgs#gnumake nixpkgs#arduino-cli`.
# Then run make -f flash-nanocul.mk.
# One of atmega328p, atmega32u4. Only tested with atmega328p, the one I have.
BOARD=atmega328p
all: upload
clean:
[ -d evofw3 ] && rm -r evofw3
evofw3:
git clone https://github.com/ghoti57/evofw3.git
# Installs dependencies into ~/.arduino15.
install-libs:
arduino-cli core install \
--additional-urls https://raw.githubusercontent.com/ghoti57/evofw3_avr/master/package_evofw3_boards_index.json \
arduino:avr evofw3:avr
upload: evofw3 install-libs
pushd evofw3 && arduino-cli upload -b evofw3:avr:${BOARD} -p /dev/ttyUSB0 evofw3.ino && popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment