* fix(dshot): retry telemetry init until the motor mask is known rc.serial issues `dshot telemetry` right after `dshot start`, and the first Run() usually handles it before the mixer has reported the outputs. initSettingsHandlers() then latches with an empty motor mask, so no ESC settings handler is ever created and the EEPROM is never read. Co-authored-by: danielbuleandra <daniel.buleandra@auterion.com> Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com> * feat(logger): log the ESC EEPROM dumps The raw dump is logged through the existing queued esc_eeprom_read topic. The layout depends on the ESC firmware and its EEPROM revision, so decoding happens offline in Tools/esc_eeprom_decode.py against the schema the ESC vendor publishes. A subscriber that joins after the first publish only sees the newest queued entry. The logger subscribes on a sweep that can lag a new topic by half a second while all ESCs answer within milliseconds of each other, so the topic is advertised when the settings handlers are created, well before the first request goes out at ESC_INIT_TELEM_DELAY. Co-authored-by: danielbuleandra <daniel.buleandra@auterion.com> Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com> * feat(dshot): publish and refresh cached ESC settings Logs can start after boot or during flight, so cached settings must be published independently of arming. The queue must retain a complete set of ESC dumps for the logger and MAVLink stream. Keep programming uninterrupted and cached data valid across saves and reconnects. Failed reads remain pending with spaced retries so one unresponsive ESC cannot starve the rest. Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com> Assisted-by: Codex * fix(tools): decode repeated ESC dumps across firmware layouts Logs contain repeated dumps and may mix EEPROM layouts. Collapse unchanged samples, apply the schema's version bounds and disabled values, and keep overlays immutable so one ESC cannot change another's decoding. Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com> Assisted-by: Codex * fix(dshot): bound ESC settings read retries A pending settings read blocks the telemetry round-robin until it completes or times out, and the retry spacing was kept per ESC. With several ESCs that never answer, reads ran back to back, telemetry went stale and the arming check reported every ESC offline. Space retries across all ESCs, give up on one after three failed reads until it reconnects or is asked for again, and time a read out at 100 ms: AM32 answers within milliseconds of the sixth frame, and anything under the 400 ms arming-check window keeps telemetry fresh. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com> * fix(dshot): keep programming active until the save is sent The flag was cleared when the save command was queued, so it no longer guarded the save itself. Only the finished() gate in the vehicle command loop kept a CONFIGURE_ACTUATOR from replacing it. Clear the flag when the last save frame goes out so the guard covers the whole sequence. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com> * fix(dshot): send each ESC EEPROM read once per MAVLink link The once-a-second republish that keeps the dumps in every log also went out on every link with ESC_EEPROM configured, low-bandwidth ones included, one message per ESC per second. timestamp_sample records when a dump was read, so the stream forwards each read once per link and still reaches a link that connects later. A motor waiting on an EDT retry or out of EDT attempts took the command slot without sending anything, so settings reads never ran while any ESC left EDT unconfirmed. Vehicle commands now wait for an outstanding settings read, which ends within 100 ms, instead of CONFIGURE_ACTUATOR being rejected. Assisted-by: Claude:claude-opus-5-5 * fix(msg): queue one ESC EEPROM dump per esc_status ESC The republish queues every cached dump at once, so the queue needs one entry per ESC and no more. DSHOT_MAX_MOTORS is capped at CONNECTED_ESC_MAX, and the static_assert in AM32Settings.cpp keeps the two in step. Assisted-by: Claude:claude-opus-5-5 * fix(dshot): mark the settings save explicitly Programming ended when any finished command carried the value 12, which the address and value frames do whenever they write offset 12 (active brake power) or a value of 12. The write then stopped part way, with the ESC still in programming mode and the next write resuming mid-sequence. Assisted-by: Claude:claude-opus-5-5 * fix(dshot): keep settings requests and writes to configured motors An all-ESC save requested settings for every motor slot, and the single-ESC request and write paths took any index below the motor limit. Reads only go to motors with a settings handler, so the other bits stayed pending in dshot status forever. A write to an index with no output was never sent, so the command never finished and blocked every later command and the serial telemetry until reboot. Assisted-by: Claude:claude-opus-5-5 * docs(dshot): describe the logged ESC settings and their decoding The page said the settings are only read at boot and only reach a ground station. Assisted-by: Claude:claude-opus-5-5 * feat(dshot): set the ciclicity to 10s for eeprom logging --------- Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com> Co-authored-by: danielbuleandra <daniel.buleandra@auterion.com>
8.9 KiB
DShot ESCs
DShot is an alternative ESC protocol that has several advantages over PWM or OneShot:
- Reduced latency.
- Increased robustness via a checksum.
- No need for ESC calibration as the protocol uses digital encoding.
- Telemetry feedback is available/supported on some ESCs.
- Can reverse motor spin directions via commands when needed (rather than physically moving wires/re-soldering).
- Other useful commands are supported.
This topic shows how to connect and configure DShot ESCs.
Supported ESC
ESCs & Motors > Supported ESCs has a list of supported ESC (check "Protocols" column for DShot ESC).
Wiring/Connections
DShot ESC are wired the same way as PWM ESCs. The only difference is that they can only be connected to the FMU, and usually only to some subset of pins.
::: info You may want to check the actuator configuration screen to see what pins are available for DShot on your controller before wiring up! :::
Pixhawk controllers with both an FMU and an IO board usually label them as AUX (FMU) and MAIN (IO), respectively.
These match the PWM AUX and PWM MAIN output tabs on the actuator configuration screen.
For these controllers connect the DShot ESC to the AUX port.
Controllers that don't have an IO board usually label the (single) output port as MAIN, and this is where you will connect your DShot ESC.
If the controller without IO has its own firmware, the actuator assignment will be to the matching PWM MAIN outputs.
However if the same firmware is used for hardware with/without the IO board, such as for the Pixhawk 4 and Pixhawk 4 Mini, then actuator assignment tab used is the same in both cases: PWM AUX (i.e. not matching the port label MAIN in the "mini" case).
Configuration
:::warning Remove propellers before changing ESC configuration parameters! :::
Enable DShot for your required outputs in the Actuator Configuration.
DShot comes with different speed options: DShot150, DShot300, and DShot600 where the number indicates the speed in kilo-bits/second. You should set the parameter to the highest speed supported by your ESC (according to its datasheet).
Then connect the battery and arm the vehicle. The ESCs should initialize and the motors turn in the correct directions.
- If the motors do not spin in the correct direction (for the selected airframe) you can reverse them in the UI using the Set Spin Direction option (this option appears after you select DShot and assign motors).
ESC Commands
Commands can be sent to the ESC via the MAVLink shell.
See the dshot module for a full reference of the supported commands.
ESC Telemetry
Some ESCs are capable of sending telemetry back to the flight controller through a UART RX port. These DShot ESCs will have an additional telemetry wire.
The provided telemetry includes:
- Temperature
- Voltage
- Current
- Accumulated current consumption
- RPM values
To enable this feature (on ESCs that support it):
- Join all the telemetry wires from all the ESCs together, and then connect them to one of the RX pins on an unused flight controller serial port.
- Enable telemetry on that serial port using DSHOT_TEL_CFG.
:::tip
You may have to configure the per-motor pole count parameters (DSHOT_MOT_POL1–DSHOT_MOT_POL12) to get correct RPM values.
The default value for these is 14 poles, which is typical for 5-inch prop motors.
:::
:::tip Extended DShot Telemetry (EDT) can provide temperature, voltage, and current through the BDShot signal — no serial telemetry wire needed. :::
Bidirectional DShot (Telemetry)
Bidirectional DShot (BDShot) enables the ESC to send eRPM telemetry back to the flight controller on the same signal wire used for throttle commands — no additional telemetry wire is needed for RPM data. High-rate eRPM data significantly improves the performance of Dynamic Notch Filters and enables more precise vehicle tuning.
With Extended DShot Telemetry (EDT) enabled, BDShot can also provide temperature, voltage, and current data.
Hardware Support
BDShot requires a flight controller with DMA-capable timers. Any FMU output on a supported timer can be used for BDShot — multiple timers are supported through sequential burst/capture.
Supported processors:
- STM32H7: All FMU outputs on DMA-capable timers
- i.MXRT (V6X-RT & Tropic): All FMU outputs
::: info
The ESC must be connected to FMU outputs only.
These are labeled MAIN on controllers with a single PWM bus, and AUX on controllers with both MAIN and AUX ports (i.e. those with an IO board).
:::
PX4 Configuration
BDShot is enabled per-timer in the Actuator Configuration UI. Select BDShot150, BDShot300, or BDShot600 as the output protocol instead of the corresponding DShot speed. There is no separate enable parameter — choosing a BDShot protocol activates bidirectional telemetry on that timer's outputs.
The system calculates actual motor RPM from eRPM data using per-motor pole count parameters: DSHOT_MOT_POL1 through DSHOT_MOT_POL12 (one per motor output).
The default is 14 poles, which is typical for 5-inch prop motors.
If you are using AM32 ESCs, the motor pole count must also be set in the AM32 firmware configuration (e.g. via the AM32 configurator tool) to match.
Extended DShot Telemetry (EDT)
EDT extends BDShot by interleaving temperature, voltage, and current data into the eRPM telemetry frames. This allows ESC health monitoring through the same signal wire, without requiring a separate serial telemetry connection.
To enable EDT:
- Configure BDShot on the desired outputs (see above).
- Set
DSHOT_BIDIR_EDTto1and reboot.
The ESC firmware must support EDT (e.g. AM32).
When both serial telemetry and BDShot/EDT are enabled, the driver merges data from both sources.
AM32 ESC Settings (EEPROM)
PX4 logs the AM32 ESC firmware settings (EEPROM), and a ground station can read and write them without connecting to each ESC.
Requirements
- ESCs running AM32 firmware with serial telemetry connected (DSHOT_TEL_CFG)
DSHOT_ESC_TYPEset to1(AM32)- For ground station access only:
- Ground station with ESC EEPROM support (QGroundControl feature in development)
- MAVLink development dialect enabled on the flight controller
How It Works
PX4 reads the full EEPROM from each ESC while disarmed: at boot, when the ESC reconnects, after its settings are saved, and when a ground station requests it. The ground station can then display individual settings and allow the user to modify them. Changes are written back to the ESC one byte at a time using the DShot programming protocol.
Logged Settings
The last settings read from each ESC are logged in the esc_eeprom_read topic when they are read, and again every 10 seconds.
Decode them with Tools/esc_eeprom_decode.py and the AM32 EEPROM layout schema, schema/eeprom.json in the ARK32 firmware:
pip install pyulog
curl -O https://raw.githubusercontent.com/ARK-Electronics/ARK32/main/schema/eeprom.json
Tools/esc_eeprom_decode.py <log.ulg> --schema eeprom.json --esc 1
Omit --esc to decode every ESC.
ESC Serial Passthrough
On STM32F7/H7 boards, PX4 can pass UART traffic through an ESC signal pin using a software bit-bang UART. This lets ESC configuration and firmware tools on a ground station or companion computer talk to the ESC over MAVLink, without disconnecting it from the flight controller.
To use it, run the bridge application (Tools/mavlink_serial_bridge.py) on the computer connected to the vehicle, and point the tool at the virtual serial port it creates.
Only one ESC channel can be used at a time, at up to 19200 baud.
::: warning
ESC passthrough disables DShot and PWM outputs, so the motors can't be driven while it's in use.
The bridge's --setup option sets PASSTHRU_EN to 1 and reboots the flight controller, which then boots with DShot and PWM outputs off.
PX4 resets PASSTHRU_EN to 0 during that boot, so normal outputs return on the next reboot.
:::
See Serial Passthrough (MAVLink SERIAL_CONTROL) for build configuration, supported channels, and limitations.