sumorobot-firmware/Makefile
2019-11-08 18:00:06 +02:00

40 lines
913 B
Makefile

#!/bin/bash
SERIAL_PORT=/dev/ttyUSB0
#SERIAL_PORT=/dev/tty.SLAB_USBtoUART
#SERIAL_PORT=/dev/tty.wchusbserial1410
all: flash delay libs config update reset
upload: config update reset console
files: delete libs update config delay reset
delay:
sleep 3
reset:
esptool.py -p $(SERIAL_PORT) --after hard_reset read_mac
picocom -b 115200 $(SERIAL_PORT)
libs:
ampy -p $(SERIAL_PORT) put uwebsockets.py
ampy -p $(SERIAL_PORT) put debounce.py
update:
ampy -p $(SERIAL_PORT) put hal.py
ampy -p $(SERIAL_PORT) put main.py
ampy -p $(SERIAL_PORT) put boot.py
delete:
ampy -p $(SERIAL_PORT) rm main.py
config:
ampy -p $(SERIAL_PORT) put config.json
flash:
esptool.py -p $(SERIAL_PORT) --chip esp32 -b 115200 erase_flash
esptool.py -p $(SERIAL_PORT) --chip esp32 -b 115200 write_flash --flash_mode dio 0x1000 esp32-*.bin
console:
echo "Ctrl-A + Ctrl-Q to close Picocom"
picocom -b 115200 $(SERIAL_PORT)