Actually works now

This commit is contained in:
Arti Zirk
2024-11-03 17:54:59 +02:00
parent e9fb10d791
commit ecf8dcb015
4 changed files with 47 additions and 1 deletions

35
Makefile Normal file
View File

@@ -0,0 +1,35 @@
#!/bin/bash
# When this baud does not work, try 115200
FLASH_BAUD := 250000
# Image to flash
FLASH_IMAGE := sumofirmware.bin
# Try to automatically find the serialport
SERIAL_PORT := $(shell find /dev -iname "tty*usb*")
all: erase flash delay config update reset
delay:
sleep 3
reset:
esptool.py -p $(SERIAL_PORT) --after hard_reset read_mac
update:
ampy -d 0.5 -p $(SERIAL_PORT) put main.py
ampy -d 0.5 -p $(SERIAL_PORT) put boot.py
config:
ampy -d 0.5 -p $(SERIAL_PORT) put config.json
erase:
esptool.py -p $(SERIAL_PORT) -b $(FLASH_BAUD) erase_flash
flash:
esptool.py -p $(SERIAL_PORT) -b $(FLASH_BAUD) write_flash --flash_size=detect -fm dio 0 $(FLASH_IMAGE)
serial:
picocom --baud 115200 -q $(SERIAL_PORT)