Imporove servo PWM calibration

This commit is contained in:
silbo
2021-06-24 21:06:48 +02:00
parent fc11ffdad4
commit 00857da470
6 changed files with 83 additions and 69 deletions

View File

@@ -1,20 +1,15 @@
#!/bin/bash
SERIAL_PORT=/dev/ttyUSB0
# When this baud does not work, try 115200
FLASH_BAUD := 230400
ifeq (,$(wildcard $(SERIAL_PORT)))
SERIAL_PORT=/dev/tty.usbserial-1410
endif
# Image to flash
FLASH_IMAGE := sumofirmware.bin
ifeq (,$(wildcard $(SERIAL_PORT)))
SERIAL_PORT=/dev/tty.usbserial-1420
endif
# Try to automatically find the serialport
SERIAL_PORT := $(shell find /dev -iname "tty*usb*")
ifeq (,$(wildcard $(SERIAL_PORT)))
SERIAL_PORT=/dev/tty.SLAB_USBtoUART
endif
all: flash delay config update reset
all: erase flash delay config update reset
delay:
sleep 3
@@ -30,9 +25,15 @@ update:
config:
ampy -d 0.5 -p $(SERIAL_PORT) put config.json
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 460800 erase_flash
esptool.py -p $(SERIAL_PORT) -b 460800 write_flash --flash_mode dio 0x1000 esp32*.bin
esptool.py -p $(SERIAL_PORT) -b $(FLASH_BAUD) write_flash --flash_mode dio 0x1000 $(FLASH_IMAGE)
serial:
picocom --baud 115200 $(SERIAL_PORT)
picocom --baud 115200 -q $(SERIAL_PORT)