2018-08-30 10:25:14 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-08-23 18:27:22 +00:00
|
|
|
SERIAL_PORT=/dev/ttyUSB0
|
|
|
|
|
|
|
|
ifeq (,$(wildcard $(SERIAL_PORT)))
|
|
|
|
SERIAL_PORT=/dev/tty.usbserial-1410
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (,$(wildcard $(SERIAL_PORT)))
|
|
|
|
SERIAL_PORT=/dev/tty.usbserial-1420
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (,$(wildcard $(SERIAL_PORT)))
|
|
|
|
SERIAL_PORT=/dev/tty.SLAB_USBtoUART
|
|
|
|
endif
|
2018-02-15 19:33:11 +00:00
|
|
|
|
2020-08-12 19:35:28 +00:00
|
|
|
all: 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 hal.py
|
|
|
|
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
|
2018-01-10 21:21:26 +00:00
|
|
|
|
|
|
|
flash:
|
2018-02-15 19:33:11 +00:00
|
|
|
esptool.py -p $(SERIAL_PORT) -b 460800 erase_flash
|
2020-08-12 19:35:28 +00:00
|
|
|
esptool.py -p $(SERIAL_PORT) -b 460800 write_flash --flash_mode dio 0x1000 esp32*.bin
|
|
|
|
|
|
|
|
serial:
|
|
|
|
picocom --baud 115200 $(SERIAL_PORT)
|