From 0174379dc10a15898264e34a2daf07fcdf602770 Mon Sep 17 00:00:00 2001 From: Samuel Sadok Date: Sun, 4 Mar 2018 16:38:42 -0800 Subject: [PATCH] note about specifying serial number for `make dfu` and make it work again --- Firmware/Makefile | 3 ++- Firmware/README.md | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Firmware/Makefile b/Firmware/Makefile index 05be1be6..40bbba59 100644 --- a/Firmware/Makefile +++ b/Firmware/Makefile @@ -4,6 +4,7 @@ BUILD_DIR = build FIRMWARE = $(BUILD_DIR)/ODriveFirmware.elf +FIRMWARE_HEX = $(BUILD_DIR)/ODriveFirmware.hex all: @tup --quiet @@ -15,7 +16,7 @@ gdb: all arm-none-eabi-gdb $(FIRMWARE) -x openocd.gdbinit dfu: all - ../tools/dfu.py $(if $(value SERIAL_NUMBER),--serial-number $(SERIAL_NUMBER),) $(BUILD_DIR)/$(TARGET).hex + ../tools/dfu.py $(if $(value SERIAL_NUMBER),--serial-number $(SERIAL_NUMBER),) $(FIRMWARE_HEX) bmp: all arm-none-eabi-gdb --ex 'target extended-remote /dev/stlink' \ diff --git a/Firmware/README.md b/Firmware/README.md index 872e9b7e..7b63ffe8 100644 --- a/Firmware/README.md +++ b/Firmware/README.md @@ -120,9 +120,18 @@ After installing all of the above, open a Git Bash shell. Continue at section [B ### Flashing the firmware (standalone device) * Run `make dfu` in the `Firmware` directory. +If you have multiple ODrives connected, you should specify which one to upgrade. +* Run `(lsusb -d 1209:0d32 -v; lsusb -d 0483:df11 -v) 2>/dev/null | grep iSerial` to list the serial number of all flashable devices. Example output: +``` + iSerial 3 385F324D3037 + iSerial 3 306A396A3235 +``` +* The last column is the serial number you're looking for. You can unplug selected devices to track down the one you want to update. +* Run `make dfu SERIAL_NUMBER=385F324D3037`, where `385F324D3037` is the targeted serial number. + __Warning:__ Currently it is advised that you only do this to flash official unmodified firmware. Also make sure you don't switch off -the device during upgrade. If something goes wrong you need an external +the device during upgrade. Otherwise, if something goes wrong, you need an external programmer to recover the device. This will be fixed in the future. ### Flashing the firmware (external Programmer)