From bd048b6e3c6698800a628dbd33522eb4e53968cf Mon Sep 17 00:00:00 2001 From: Jacob Dahl Date: Fri, 28 Aug 2026 16:10:17 -0600 Subject: [PATCH] fix(dshot): set telemetry bit on DShot commands Bluejay and BLHeli_S ignore commands unless the tlm bit is set, so EDT enable never latched. ESC_INFO keeps it clear: AM32 answers the bit with a KISS frame on the same UART as the EEPROM dump and aborts that frame when the dump starts, so the response would begin with a truncated frame. Signed-off-by: Jacob Dahl --- src/drivers/dshot/DShot.cpp | 6 +++++- src/drivers/dshot/DShotTelemetry.cpp | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/drivers/dshot/DShot.cpp b/src/drivers/dshot/DShot.cpp index ef34e2dc46e..ba7f4c1bf12 100644 --- a/src/drivers/dshot/DShot.cpp +++ b/src/drivers/dshot/DShot.cpp @@ -398,7 +398,11 @@ void DShot::update_motor_commands(int num_outputs) command_sent = true; } - up_dshot_motor_command(i, command, false); + // Bluejay/BLHeli_S discard commands unless the tlm bit is set. It stays clear on commands answered + // over the telemetry UART: AM32 reads it as a KISS request and starts that frame on the same wire, + // then aborts it a few loop iterations later to send the EEPROM dump. + const bool request_telemetry = command != DSHOT_CMD_MOTOR_STOP && !_current_command.expect_response; + up_dshot_motor_command(i, command, request_telemetry); } if (command_sent) { diff --git a/src/drivers/dshot/DShotTelemetry.cpp b/src/drivers/dshot/DShotTelemetry.cpp index 17642d84e58..f8cd8f74f56 100644 --- a/src/drivers/dshot/DShotTelemetry.cpp +++ b/src/drivers/dshot/DShotTelemetry.cpp @@ -278,6 +278,8 @@ TelemetryStatus DShotTelemetry::decodeTelemetryResponse(uint8_t *buffer, int len void DShotTelemetry::setExpectCommandResponse(int motor_index, uint16_t command) { + // Earlier commands sent with the tlm bit set leave KISS frames in the RX FIFO. + _uart.flush(); _command_response_motor_index = motor_index; _command_response_command = command; _command_response_start = hrt_absolute_time();