25 lines
664 B
Makefile
25 lines
664 B
Makefile
serial := "/dev/ttyUSB0"
|
|
|
|
micropython_version := "ESP8266_GENERIC-20250415-v1.25.0.bin"
|
|
|
|
[private]
|
|
default: deploy
|
|
|
|
# Donwload the firmware for Wemos D1.
|
|
download-firmware:
|
|
# See https://micropython.org/download/ESP32_GENERIC/
|
|
# for details.
|
|
mkdir -p firmware
|
|
curl https://micropython.org/resources/firmware/{{ micropython_version }} --output firmware/{{ micropython_version }}
|
|
|
|
# Erase board memory
|
|
erase:
|
|
esptool --port {{serial}} erase-flash
|
|
|
|
# Flash the firmare
|
|
firmware:
|
|
esptool --port {{serial}} --baud 460800 write-flash --flash-size=detect 0 firmware/{{ micropython_version }}
|
|
|
|
# Deploy all the code.
|
|
deploy:
|
|
mpremote cp *.py :
|