Skip to content

Commit 4b2ac94

Browse files
committed
Made DFU erase all internal flash on programming to lessen bad config issues
uart doc improvements
1 parent 640c411 commit 4b2ac94

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

GUI/src/assets/odriveEnums.json

+3
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
"AXIS_ERROR_ESTOP_REQUESTED": 16384,
7777
"AXIS_ERROR_HOMING_WITHOUT_ENDSTOP": 131072,
7878
"AXIS_ERROR_OVER_TEMP": 262144,
79+
"AXIS_ERROR_UNKNOWN_POSITION": 524288,
7980
"MOTOR_ERROR_NONE": 0,
8081
"MOTOR_ERROR_PHASE_RESISTANCE_OUT_OF_RANGE": 1,
8182
"MOTOR_ERROR_PHASE_INDUCTANCE_OUT_OF_RANGE": 2,
@@ -111,6 +112,8 @@
111112
"CONTROLLER_ERROR_INVALID_MIRROR_AXIS": 8,
112113
"CONTROLLER_ERROR_INVALID_LOAD_ENCODER": 16,
113114
"CONTROLLER_ERROR_INVALID_ESTIMATE": 32,
115+
"CONTROLLER_ERROR_INVALID_CIRCULAR_RANGE": 64,
116+
"CONTROLLER_ERROR_SPINOUT_DETECTED": 128,
114117
"ENCODER_ERROR_NONE": 0,
115118
"ENCODER_ERROR_UNSTABLE_GAIN": 1,
116119
"ENCODER_ERROR_CPR_POLEPAIRS_MISMATCH": 2,

docs/uart.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ To use UART connect it like this:
1010

1111
The logic level of the ODrive is 3.3V. The GPIOs are 5V tolerant.
1212

13-
You can use `odrv0.config.uart_a_baudrate` to change the baudrate and `odrv0.config.enable_uart_a` to disable/reenable UART_A. Currently the UART port runs both the [Native Protocol](native-protocol) and the [ASCII Protocol](ascii-protocol) at the same time.
13+
You can use `odrv0.config.uart_a_baudrate` to change the baudrate and `odrv0.config.enable_uart_a` to disable/reenable UART_A. The UART_A port can run the [Native Protocol](native-protocol) or the [ASCII Protocol](ascii-protocol), but not both at the same time. You can configure this by setting `odrv0.config.uart0_protocol` to either `STREAM_PROTOCOL_TYPE_ASCII_AND_STDOUT` for the ASCII protocol or `STREAM_PROTOCOL_TYPE_FIBRE` for the native protocol.
1414

1515
### How to use UART on GPIO3/4
1616

tools/odrive/dfu.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,11 @@ def update_device(device, firmware, logger, cancellation_token):
381381

382382
# Erase
383383
try:
384-
for i, (sector, data) in enumerate(touched_sectors):
385-
print("Erasing... (sector {}/{}) \r".format(i, len(touched_sectors)), end='', flush=True)
386-
dfudev.erase_sector(sector)
384+
internal_flash_sectors = [sector for sector in dfudev.sectors if sector['name'] == 'Internal Flash']
385+
for i, sector in enumerate(dfudev.sectors):
386+
if sector['name'] == 'Internal Flash':
387+
print("Erasing... (sector {}/{}) \r".format(i, len(internal_flash_sectors)), end='', flush=True)
388+
dfudev.erase_sector(sector)
387389
print('Erasing... done \r', end='', flush=True)
388390
finally:
389391
print('', flush=True)

0 commit comments

Comments
 (0)