From 48cab5a25dde8f5283a5834d1868f58a89645aef Mon Sep 17 00:00:00 2001 From: Hamish Willee Date: Fri, 20 Nov 2026 10:13:06 +1100 Subject: [PATCH] docs(peripherals): clarify ESC passthrough firmware support and behaviour Match the ESC passthrough page and the serial passthrough ESC channel docs to the code on this branch: all dshot/pwm_out outputs stop during a session, --target counts from 0, requests are ignored while armed, and ESC channels are clamped to 19200 baud. Replace the separate board list and "Enabling on Other Boards" with a Firmware Support section that says how to check and add the driver, with a dated board list, and put the ESC pin UART requirements shared by esc_4way and serialpassthrough in one place. Drop repeated text and move the sidebar entry after the ESC protocol pages. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Hamish Willee --- docs/en/SUMMARY.md | 2 +- docs/en/_sidebar.md | 2 +- docs/en/peripherals/esc_configuration_4way.md | 84 +++++++++---------- docs/en/uart/serial_passthrough.md | 24 +++--- 4 files changed, 56 insertions(+), 56 deletions(-) diff --git a/docs/en/SUMMARY.md b/docs/en/SUMMARY.md index 45e51c4da14..9307d019ee3 100644 --- a/docs/en/SUMMARY.md +++ b/docs/en/SUMMARY.md @@ -324,10 +324,10 @@ - [ESC Protocols](esc/esc_protocols.md) - [PWM ESCs and Servos](peripherals/pwm_escs_and_servo.md) - [DShot ESCs](peripherals/dshot.md) - - [ESC Configuration over USB](peripherals/esc_configuration_4way.md) - [OneShot ESCs and Servos](peripherals/oneshot.md) - [DroneCAN ESCs](dronecan/escs.md) - [PX4 Sapog ESC Firmware](dronecan/sapog.md) + - [ESC Passthrough](peripherals/esc_configuration_4way.md) - [ARK 4IN1 ESC](esc/ark_4in1_esc.md) - [Hiwonder 4Ch Encoder Motor Module](peripherals/hiwonder_emm.md) - [Holybro Kotleta](dronecan/holybro_kotleta.md) diff --git a/docs/en/_sidebar.md b/docs/en/_sidebar.md index 86a8b8ad176..2d496f9002e 100644 --- a/docs/en/_sidebar.md +++ b/docs/en/_sidebar.md @@ -325,10 +325,10 @@ - [ESC Protocols](/esc/esc_protocols.md) - [PWM ESCs and Servos](/peripherals/pwm_escs_and_servo.md) - [DShot ESCs](/peripherals/dshot.md) - - [ESC Configuration over USB](/peripherals/esc_configuration_4way.md) - [OneShot ESCs and Servos](/peripherals/oneshot.md) - [DroneCAN ESCs](/dronecan/escs.md) - [PX4 Sapog ESC Firmware](/dronecan/sapog.md) + - [ESC Passthrough](/peripherals/esc_configuration_4way.md) - [ARK 4IN1 ESC](/esc/ark_4in1_esc.md) - [Hiwonder 4Ch Encoder Motor Module](/peripherals/hiwonder_emm.md) - [Holybro Kotleta](/dronecan/holybro_kotleta.md) diff --git a/docs/en/peripherals/esc_configuration_4way.md b/docs/en/peripherals/esc_configuration_4way.md index 2bb0af009b1..7aad9fcf3b1 100644 --- a/docs/en/peripherals/esc_configuration_4way.md +++ b/docs/en/peripherals/esc_configuration_4way.md @@ -1,16 +1,32 @@ -# ESC Passthrough +# ESC Passthrough (AM32, Bluejay, BLHeli_S) PX4 can act as the link between an ESC configurator and the ESCs, so that you can read and change ESC settings and flash ESC firmware without disconnecting the ESCs from the flight controller. This works with the browser-based configurators [am32.ca](https://am32.ca) (AM32 ESCs) and [esc-configurator.com](https://esc-configurator.com) (Bluejay and BLHeli_S ESCs). -The flight controller is connected to the computer with its USB cable, and the configurator talks to the ESCs through the ESC signal wires. -While a configuration session is active, the normal motor outputs (DShot and PWM) are off. +Only ESCs on the first eight FMU PWM outputs that are assigned to a motor in [Actuator Configuration](../config/actuators.md) can be configured (IO outputs are not supported). +The vehicle must be disarmed: requests are ignored while it is armed. + +The flight controller is connected to the computer with its USB cable (or [another serial port](#using-another-serial-port)), and the configurator talks to the ESCs through the ESC signal wires. +While a configuration session is active, the `dshot` and `pwm_out` drivers are stopped, so every output they drive is off, including servos. + +::: info +ESC passthrough is only in the firmware of some boards (see [Firmware Support](#firmware_support)). +::: ::: warning Remove the propellers before you connect a configurator. ::: -## Supported Boards +## Firmware Support {#firmware_support} + +ESC passthrough needs the `esc_4way` driver, which is only in the firmware of boards that set `CONFIG_DRIVERS_ESC_4WAY=y` in their `default.px4board`. + +You can check if it is present from the [MAVLink Shell](../debug/mavlink_shell.md) by entering the command `esc_4way status` (a response of `command not found` means it is not present). + +If it is not present you can add the key (`CONFIG_DRIVERS_ESC_4WAY=y`) in the board's `boards///default.px4board` or enable it in [`boardconfig`](../hardware/porting_guide_config.md#px4-menuconfig-setup) under **drivers > esc_4way**, then [build and upload the firmware](../dev_setup/building_px4.md). +USB auto-detection also needs `CONFIG_DRIVERS_CDCACM_AUTOSTART=y`; without it, start the server [on a serial port](#using-another-serial-port). + +At time of writing (November 2026) it is present in the default firmware for these boards: - [AGAM FMU-v6XRT](../flight_controller/agam_v6xrt.md) (`agam_fmu-v6xrt`) - [ARK FMU-v6S](../flight_controller/ark_v6s.md) (`ark_fmu-v6s`) @@ -19,43 +35,39 @@ Remove the propellers before you connect a configurator. - [ARK FPV](../flight_controller/ark_fpv.md) (`ark_fpv`) - [ARK Pi6X Flow](../flight_controller/ark_pi6x.md) (`ark_pi6x`) - [NXP MR-NAVQ95](../flight_controller/nxp_mr_navq95.md) (`nxp_mr-navq95`) +- [NXP MR-VMU-RT1176](../flight_controller/nxp_mr_vmu_rt1176.md) (`px4_fmu-v6xrt`) - `nxp_mr-tropic` - [Pixhawk 6X-RT](../flight_controller/pixhawk6x-rt.md) (`px4_fmu-v6xrt`) -Other STM32F7/H7 and NXP i.MX RT boards can be added with a build configuration change, see [Enabling on Other Boards](#enabling-on-other-boards). +### ESC Pin UART {#esc_pin_uart} -Only ESCs connected to the flight controller's own motor outputs can be configured; outputs on an I/O board (PX4IO) are not supported. -The server only uses outputs that are assigned to a motor in [Actuator Configuration](../config/actuators.md), among the first eight outputs. - -The configurator numbers the ESCs by motor: ESC 1 is the output assigned to Motor 1, ESC 2 is Motor 2, and so on. +The `esc_4way` driver and Serial Passthrough's ESC channel mode both drive the ESC signal pins as a half-duplex UART, which exists for STM32F7/H7, NXP i.MX RT1064/RT1176 and i.MX95 boards. +On STM32 boards the UART bit timing comes from a spare hardware timer, `CONFIG_UART_BITBANG_TIMER` (default `13`). +That timer must be enabled in the board's NuttX configuration (`CONFIG_STM32H7_TIM13=y` or `CONFIG_STM32F7_TIM13=y` in `nuttx-config/nsh/defconfig`), and nothing else on the board may use it: not the high-resolution timer (HRT), the tone alarm, an LED, or a PWM/DShot output timer. ## Configure the ESCs -1. Set the parameter [SYS_USB_AUTO](../advanced_config/parameter_reference.md#SYS_USB_AUTO) to `1` (_Auto-detect_) and reboot the flight controller. -1. Plug in the USB cable and power the ESCs (connect the battery). -1. Before any other program opens the USB port, open [am32.ca](https://am32.ca) or [esc-configurator.com](https://esc-configurator.com) in a browser that supports WebSerial (Chrome or Edge). -1. Click **Connect** and select the flight controller's USB port. - The flight controller recognises the configurator and starts the ESC configuration server; the motor outputs are switched off at that moment. -1. Read, change and write the ESC settings, or flash new ESC firmware. -1. Click **Disconnect** when you are done. +1. Set the [parameter](../advanced_config/parameters.md) [SYS_USB_AUTO](../advanced_config/parameter_reference.md#SYS_USB_AUTO) to `1` (`Auto-detect`) and reboot the flight controller. +2. Plug in the USB cable and power the ESCs (connect the battery). +3. Before any other program opens the USB port, open [am32.ca](https://am32.ca) or [esc-configurator.com](https://esc-configurator.com) in a browser that supports WebSerial (_Chrome_ or _Edge_). +4. Click **Connect** and select the flight controller's USB port. + The flight controller recognises the configurator and starts the ESC configuration server; the outputs are switched off at that moment. +5. Read, change and write the ESC settings, or flash new ESC firmware. + The configurator numbers the ESCs by motor: ESC 1 is the output assigned to Motor 1, ESC 2 is Motor 2, and so on. +6. Click **Disconnect** when you are done. The flight controller reboots, so the USB connection drops. - After that reboot the motor outputs work normally again. - -The USB port is given to the first program that talks to it after it is plugged in. -If _QGroundControl_ connected first, unplug and replug the USB cable or reboot the flight controller. + After that reboot the outputs work normally again. If you unplug the USB cable or close the configurator without disconnecting, the flight controller also reboots. -Any program that first sends a valid MSP request to the USB port starts the ESC configuration server, and the motor outputs then stay off until the flight controller reboots. - ## Command Line Tools ### Host Tool -`Tools/esc_4way.py` reads and writes one ESC from a computer through the ESC configuration server (or any flight controller that supports MSP and the 4way interface): +`Tools/esc_4way.py` reads and writes one ESC from a computer through the ESC configuration server, or through any flight controller that supports MSP (MultiWii Serial Protocol) and the BLHeli 4way interface: ```sh -Tools/esc_4way.py info # probe ESC 0 +Tools/esc_4way.py info # probe the ESC on Motor 1 Tools/esc_4way.py settings # AM32 settings, raw and decoded Tools/esc_4way.py direction toggle # or: direction set 0|1 Tools/esc_4way.py dump esc0_flash.bin @@ -68,10 +80,11 @@ Tools/esc_4way.py check /dev/ttyACM0 # protocol self-check When the port sends MAVLink heartbeats, the tool first sets `SYS_USB_AUTO` to `1` over MAVLink and reboots the flight controller, which frees the port for the ESC configuration server. The parameter stays set. `--setup` does that without listening for heartbeats first. -Use `-d` to select the serial device (default `/dev/ttyACM0`), `--target` for the ESC (default 0) and `--no-exit` to keep the session open. +Use `-d` to select the serial device (default `/dev/ttyACM0`) and `--target` for the ESC (default `0` for the ESC on Motor 1). +Set `--no-exit` to keep the session open. The flight controller reboots after a run without `--no-exit`. -A run started during that reboot waits for the port when `-d` is its `/dev/serial/by-id/` name. -The tool needs `pymavlink` for the switch over MAVLink. +If `-d` is the port's `/dev/serial/by-id/` name, a run started during that reboot waits for the port. +The tool needs `pymavlink` to set `SYS_USB_AUTO` over MAVLink. ### Using Another Serial Port @@ -83,7 +96,7 @@ esc_4way start -d /dev/ttyS3 ``` Use the device node of the port, for example `/dev/ttyS3` for a UART or `/dev/ttyACM0` for USB. -The port must not be used by another module (for example MAVLink), so free it first. +The port must not be used by another module, such as MAVLink (see [Serial Port Configuration](serial_configuration.md#default-serial-port-configuration)). Then connect the host tool or configurator to the other end of that serial link, for example with `Tools/esc_4way.py -d info`. The server is started manually in this case, so USB auto-detection is not involved. Stop it with `esc_4way stop`, or reboot the flight controller. @@ -93,21 +106,6 @@ Stop it with `esc_4way stop`, or reboot the flight controller. am32.ca only shows USB devices from a list of known flight controller vendor IDs, so use a version of the configurator whose list includes the vendor ID of your board's USB port. esc-configurator.com has an override for this and shows the port regardless of its vendor ID. -## Enabling on Other Boards - -The ESC configuration server drives the ESC signal pins as a half-duplex UART. -That backend exists for STM32F7/H7 boards and for the NXP i.MX RT1064/RT1176 and i.MX95 boards. -To enable the server, add this key to the board's `default.px4board`: - -```text -CONFIG_DRIVERS_ESC_4WAY=y -``` - -USB auto-detection needs the board's USB port to be managed by `cdcacm_autostart` (`CONFIG_DRIVERS_CDCACM_AUTOSTART=y`); without it, start the server manually with `esc_4way start -d `. - -On STM32 boards the UART bit timing comes from a spare hardware timer, `CONFIG_UART_BITBANG_TIMER` (default `13`). -That timer must be enabled in the board's NuttX configuration (`CONFIG_STM32H7_TIM13=y` or `CONFIG_STM32F7_TIM13=y` in `nuttx-config/nsh/defconfig`), and nothing else on the board may use it: not the HRT, the tone alarm, an LED, or a PWM/DShot output timer. - ## See Also - [Serial Passthrough (MAVLink SERIAL_CONTROL)](../uart/serial_passthrough.md): raw access to the ESC signal pins over MAVLink, for example from a companion computer. diff --git a/docs/en/uart/serial_passthrough.md b/docs/en/uart/serial_passthrough.md index d01d81823a7..280d336c7a1 100644 --- a/docs/en/uart/serial_passthrough.md +++ b/docs/en/uart/serial_passthrough.md @@ -5,13 +5,13 @@ Serial Passthrough allows a MAVLink client to read from and write to selected flight controller serial interfaces using the [SERIAL_CONTROL](https://mavlink.io/en/messages/common.html#SERIAL_CONTROL) message. Typical use cases include: providing a direct serial channel for ESC configuration tools, and debugging serial peripherals over a telemetry link. -To configure AM32, Bluejay or BLHeli ESCs from a browser over the flight controller's USB port, see [ESC Configuration over USB](../peripherals/esc_configuration_4way.md) instead. +To configure AM32, Bluejay or BLHeli_S ESCs from a browser over the flight controller's USB port, see [ESC Passthrough](../peripherals/esc_configuration_4way.md) instead. Two cases are supported: - Control of normal ports, such as telemetry or GPS ports. This works automatically as long as the [`serialpassthrough` driver](../modules/modules_driver.md#serialpassthrough) is present in firmware. -- Control of ESC signal pins via a half-duplex UART on the signal wire (STM32F7/H7 and NXP i.MX RT1064/RT1176 and i.MX95 boards). +- Control of ESC signal pins via a half-duplex UART on the signal wire ([ESC Channel Mode](#bitbang)), on STM32F7/H7, NXP i.MX RT1064/RT1176 and i.MX95 boards. This requires additional configuration. When serial control is enabled/supported, passthrough is automatic. @@ -52,15 +52,14 @@ Note that the `PASSTHRU_EN` parameter need not be set. ## ESC Channel Mode (Bitbang UART) {#bitbang} -Device IDs 20–27 route through a software bit-bang UART on the ESC signal pin rather than a hardware UART. +Device IDs 20–27 route through a half-duplex UART on the ESC signal pin rather than one of the board's serial ports. This is useful for communicating with ESCs that expose a UART telemetry or configuration port on their signal wire (such as BLHeli_32 passthrough, AM32, or ESC configuration tools). The ESC signal pin is driven as a 19200 baud half-duplex UART. -This is supported on STM32F7/H7 boards and on the NXP i.MX RT1064/RT1176 and i.MX95 boards: `px4_fmu-v6xrt`, `ark_fmu-v6xrt`, `nxp_mr-tropic` and `nxp_mr-navq95`. Only one ESC channel can be active at a time. The channel's output must be assigned to a motor in [Actuator Configuration](../config/actuators.md). -Bitbang UART support requires that both `CONFIG_DRIVERS_SERIALPASSTHROUGH=y` and `CONFIG_SERIALPASSTHROUGH_BITBANG=y` are set before building (STM32 boards also use `CONFIG_UART_BITBANG_TIMER`, default `TIM13`; that timer must be enabled in the board's NuttX `defconfig`, for example `CONFIG_STM32H7_TIM13=y`, and must not be used by anything else on the board). +ESC channel mode is only in the firmware of some boards (see [Firmware Configuration](#firmware-configuration-build-time)). The `PASSTHRU_EN` parameter must be set to `1` and the device rebooted in order to enable this mode. ## Bridge Application @@ -99,7 +98,7 @@ Run it with `-h` for the full list of options. For `esc*` ports the UART baud rate is fixed at 19200 (the bitbang limit) and `--port-baud` is ignored. -Use `--echo` to echo each byte sent by the host back to the PTY, as a single-wire USB-serial adapter does, for tools that expect it. +For tools that expect the echo of a single-wire USB-serial adapter, use `--echo` to send each byte from the host back to the PTY. Developers can create their own bridge application in another language if needed, following the protocol described below. Data written to the PTY would be sent as `SERIAL_CONTROL` messages with `SERIAL_CONTROL_FLAG_RESPOND | SERIAL_CONTROL_FLAG_EXCLUSIVE` set, and incoming `SERIAL_CONTROL` reply messages (with `FLAG_REPLY` set) would be written back to the PTY. @@ -152,11 +151,15 @@ If you want to use ESC channel targets you must also set the following keys: ```text CONFIG_SERIALPASSTHROUGH_BITBANG=y # ESC channel support -CONFIG_UART_BITBANG_TIMER=13 # STM32 only: timer instance +CONFIG_UART_BITBANG_TIMER=13 # STM32 only: timer instance (default 13) ``` +The board must also meet the [ESC pin UART requirements](../peripherals/esc_configuration_4way.md#esc_pin_uart). Then rebuild the firmware. +To check a board's default firmware, look for `CONFIG_SERIALPASSTHROUGH_BITBANG=y` in its `boards///default.px4board`. +At time of writing (November 2026) the default firmware of these boards includes it: `agam_fmu-v6xrt`, `ark_fmu-v6xrt`, `auterion_fmu-v6s`, `auterion_fmu-v6x`, `nxp_mr-navq95`, `nxp_mr-tropic` and `px4_fmu-v6xrt`. + ### PX4 Configuration (ESC targets) For ESC channel targets (only) you must also set [PASSTHRU_EN](../advanced_config/parameter_reference.md#PASSTHRU_EN) to `1` and reboot the vehicle. @@ -173,10 +176,9 @@ The parameter auto-resets to `0` on the following reboot, so DShot/PWM output is - **Single sender:** only one MAVLink sender is supported at a time. A single sender can communicate with multiple ports simultaneously, but replies are always routed back to the MAVLink channel that sent the most recent `SERIAL_CONTROL` message. This means that concurrent senders could interfere with each other's replies. -- **ESC bitbang baud rate:** maximum reliable baud rate is 19200. - Higher rates may work but are not guaranteed. +- **ESC bitbang baud rate:** clamped to 19200. - **ESC channel exclusivity:** only one ESC bitbang channel can be active at a time. -- **Platform:** ESC channel mode is available on STM32F7/H7 and the NXP i.MX RT/i.MX95 boards listed above. - Requesting ESC bitbang on an unsupported platform logs an error. +- **Platform:** ESC channel mode is available on STM32F7/H7, NXP i.MX RT1064/RT1176 and i.MX95 boards whose firmware includes it. + Requesting ESC bitbang on an unsupported platform logs a warning: "not supported on this board". - **Buffer size:** each instance has a 1 kB receive and 1 kB transmit buffer. Frames larger than 1 kB will be truncated with a warning logged.