10
0
sumorobot-firmware/Makefile

40 lines
866 B
Makefile
Raw Permalink Normal View History

2018-08-30 10:25:14 +00:00
#!/bin/bash
2021-06-24 19:06:48 +00:00
# When this baud does not work, try 115200
FLASH_BAUD := 230400
2021-06-24 19:06:48 +00:00
# Image to flash
FLASH_IMAGE := sumofirmware.bin
2021-06-24 19:06:48 +00:00
# Try to automatically find the serialport
SERIAL_PORT := $(shell find /dev -iname "tty*usb*")
2021-06-24 19:06:48 +00:00
all: erase flash delay config update reset
2020-08-12 19:35:28 +00:00
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
2021-06-24 19:06:48 +00:00
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
2018-01-10 21:21:26 +00:00
flash:
2021-06-24 19:06:48 +00:00
esptool.py -p $(SERIAL_PORT) -b $(FLASH_BAUD) write_flash --flash_mode dio 0x1000 $(FLASH_IMAGE)
2020-08-12 19:35:28 +00:00
serial:
2021-06-24 19:06:48 +00:00
picocom --baud 115200 -q $(SERIAL_PORT)