Actually works

This commit is contained in:
Arti Zirk
2024-11-03 17:56:36 +02:00
parent 00eec0a8d0
commit 520d1c7702
3 changed files with 40 additions and 2 deletions

34
Makefile Normal file
View File

@@ -0,0 +1,34 @@
#!/bin/bash
# When this baud does not work, try 115200
FLASH_BAUD := 500000
# 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 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
erase:
esptool.py -p $(SERIAL_PORT) -b $(FLASH_BAUD) erase_flash
image:
esptool.py -p $(SERIAL_PORT) -b $(FLASH_BAUD) read_flash 0x1000 0x250000 sumofirmware.bin
flash:
esptool.py -p $(SERIAL_PORT) -b $(FLASH_BAUD) write_flash --flash_mode dio 0x1000 $(FLASH_IMAGE)
serial:
picocom --baud 115200 -q $(SERIAL_PORT)