Skip to content

Bidir dshot - #12214

Open
error414 wants to merge 49 commits into
iNavFlight:next-10.1from
error414:error414/feature/bidir-dshot
Open

error414 wants to merge 49 commits into
iNavFlight:next-10.1from
error414:error414/feature/bidir-dshot

Conversation

@error414

@error414 error414 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

!!!DONT TURN ON BIDIR DSHOT IF YOU USE BLHELI_32 fw VERSION 32.9 AND EARLIER!!!

This PR is based on PR #11605 @halfmanbear thank you very much.

  1. normal DSHOT still use circular DMA, and can be used for problematic BLHELI_32 ESC FW
  2. bidir dshot keeps pin hight durring eeprom saving, it's save for all ESC FWs EXCEPT BLHELI_32!!!!

ESC test

  • ESCape32
  • BLHELI_32 (32.10)
  • BLHELI_S
  • AM32
  • Bluejay

FC test

  • F722 (disabled)
  • F405
  • H743
  • AT32
  • RPI pico (will be tested in diferent PR)

Configurator: iNavFlight/inav-configurator#2851

halfmanbear and others added 30 commits May 26, 2026 23:05
Ports bidirectional DShot (GCR) telemetry from Betaflight, enabling
RPM-based gyro filtering without a dedicated ESC telemetry UART.

After each DShot output frame the motor pin is switched to timer input
capture mode via per-channel DMA to receive the ESC's GCR-encoded eRPM
response. The decoded eRPM feeds the existing RPM filter infrastructure.

New settings:
- dshot_bidir_enabled: enable bidirectional DShot telemetry
- dshot_edt_enabled: enable Extended DShot Telemetry (temperature,
  voltage, current in addition to eRPM)

Changes:
- drivers/dshot.c/.h: GCR decode, EDT frame parsing, eRPM-to-RPM
  conversion, motor frequency LPF (ported from Betaflight, GPLv3)
- drivers/pwm_output.c: per-channel DMA direction switching between
  DShot output and GCR input capture on STM32 (StdPeriph/HAL) and AT32
- sensors/esc_sensor.c/.h: DShot bidir data path into ESC sensor
  framework (escSensorSetDshotData, escSensorIsActive)
- flight/rpm_filter.c: DShot telemetry as frequency source alongside
  serial ESC sensor path
- target/common_post.h: USE_RPM_FILTER enabled for any USE_DSHOT target
- fc/fc_init.c: call initDshotTelemetry() at startup; fix RPM filter
  init condition to accept DShot bidir as a valid source
- blackbox/blackbox.c: fix NULL dereference when escSensorGetData()
  returns NULL; fix uninitialized blackboxSlowState_t comparison
- telemetry/srxl.c: replace Betaflight-specific USE_DSHOT_TELEMETRY
  guards with INAV's USE_DSHOT/USE_ESC_SENSOR; use escSensorGetData()

Tested on SPEEDYBEEF405V4 (STM32F405, StdPeriph) with Bluejay ESC
firmware. eRPM telemetry confirmed in blackbox; RPM gyro filter
updating notch frequencies with motor speed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dshotDmaStream() is only called from the USE_HAL_DRIVER code paths, but
was defined unconditionally with a dead fallback stub, so non-HAL F4
targets (e.g. FF_F35_LIGHTNING) built it with -Werror=unused-function.
Scope the definition to USE_HAL_DRIVER to match its call sites.
pwm_output.c called LL_TIM_EnableDMAReq_CCx/LL_TIM_DisableDMAReq_CCx,
which don't exist in ST's LL timer driver (only per-channel CC1..CC4
variants are provided). Add local static inline wrappers that set/clear
the DIER CCxDE bits directly by mask, matching the equivalent helpers
already used internally by timer_impl_hal.c.
…metry settings

dshot_bidir_enabled and dshot_edt_enabled were added to settings.yaml but
docs/Settings.md was never regenerated, failing CI's update_cli_docs.py
check. Ran the generator; purely additive diff, no other drift.
loadDmaBufferDshot() was only defined when USE_DSHOT_DMAR was unset, but
pwmCompleteMotorUpdate() also calls it as the per-channel DMA fallback on
DMAR targets whenever bidir telemetry is enabled (burst DMA can't drive
per-channel direction switching). Define it unconditionally; keep
loadDmaBufferDshotStride() gated behind USE_DSHOT_DMAR since it's only
used by the DMAR-specific burst path.
fix: keep DShot telemetry decode out of ITCM
pwmSetMotorDMACircular() predates bidirectional DSHOT and corrupts its
per-channel direction-switching state machine when a config save runs
(e.g. servo autotrim saving on disarm):

- On USE_DSHOT_DMAR targets the burst path is never armed with bidir, so
  dmaBurstBuffer stays NULL and loadDmaBufferDshotStride() writes the
  zero-throttle frame through the NULL pointer into 0x00000000 - which is
  ITCM RAM holding .tcm_code (FAST_CODE), corrupting the firmware.
- On per-channel targets impl_timerPWMSetDMACircular() re-enables the
  stream without regard to the current transfer direction, and on exit
  disables the TIM DMA request before the stream: a FIFO-enabled
  mem-to-periph stream then cannot drain, EN sticks at 1 and every later
  reconfiguration is silently ignored - the output is dead until reboot.
- Circular output also repeats frames back-to-back, colliding with the
  GCR reply the ESC drives onto the same line after every frame.

Match Betaflight instead: with bidir telemetry active, leave motor DMA
alone during the flash write and accept the frame gap. Saves only happen
disarmed, the ESC holds zero throttle, and the existing decode path
rebuilds the streams (full DeInit/Init) on the first update afterwards.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BB55zdRNZq3Q6hZYsDYwTc
…ot-fix

BidirDshot - fix for H7, invertion of timer, reset DMA for reading te…
# Conflicts:
#	src/main/drivers/pwm_output.c
#	src/main/fc/settings.yaml
#	src/main/sensors/esc_sensor.c
Structure:
- dshot.c/h -> bidir_dshot.c/h, compiled only with USE_DSHOT_BIDIR. The
  define comes from common_post.h: USE_DSHOT && STM32H7 && !USE_DSHOT_DMAR
  (direction switching is verified on H7; DMAR has no per-channel stream).
  dshot_bidir_enabled / dshot_edt_enabled are hidden elsewhere.
- Every bidir path in pwm_output.c sits under USE_DSHOT_BIDIR and, at run
  time, under useDshotTelemetry: with the setting off, plain DSHOT keeps the
  timer driver's DMA handler, FIFO setup and channel config from
  maintenance-10.x. The DMAR fallback to per-channel DMA is gone (excluded
  by the define instead).
- USE_RPM_FILTER follows USE_ESC_SENSOR || USE_DSHOT_BIDIR instead of
  USE_DSHOT, so targets without ESC sensor do not grow.
- No circular keep-alive for bidir: the line idles high for the flash
  write, as in Betaflight.

Fixes:
- EDT voltage/current were 10x off (0.25 V and 1 A steps into 0.01 V /
  0.01 A fields): x25 / x100 instead of x250 / x1000.
- ESC sensor RPM taken from the already computed mechanical RPM instead
  of computeRpm((int16_t)eRPM/100); an EDT-only first frame no longer
  publishes rpm = 0.
- GCR decoder: guard against len < 1 (shift by -1) on glitch edges and on
  an exactly filled frame, and against len > 21.
- Bidir ESC sensor data is aged at the serial poll rate, so a silent ESC
  drops out of the combined values like a serial one.
- useDshotTelemetry is set once, by pwmMotorPreconfigure(); the ESC
  sensor asks isDshotTelemetryActive() instead of re-deriving it.
- pwmDshotDmaIrqHandler keeps tch->dmaState in step with the timer
  driver's handler (timerPWMDMAInProgress()).
- srxl.c: RPM comes through escSensorGetData(), no dshot include needed;
  duplicate includes removed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown
Contributor

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Add bidirectional DShot telemetry and RPM filtering

✨ Enhancement 🐞 Bug fix 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Add opt-in bidirectional DShot telemetry to drive RPM filtering without a separate ESC telemetry
 UART.
• Capture ESC replies through STM32 timer DMA or AT32 GPIO DMA, while preserving plain DShot.
• Expose ESC link quality and RPM diagnostics, and document configuration and hardware requirements.
Diagram

graph TD
  OUT["Motor output"] --> MODE{"MCU path"} --> TIMER["Timer DMA"] --> DECODE["GCR decoder"] --> RPM["RPM filter"]
  MODE --> BITBANG["GPIO DMA"] --> DECODE
  DECODE --> SENSOR["ESC sensor"] --> MSP["MSP telemetry"]
  SENSOR --> RPM
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Use GPIO DMA bitbanging on every supported MCU
  • ➕ One transport strategy across targets
  • ➕ Avoids per-channel timer direction switching
  • ➖ Requires spare pacing timers and DMA resources on STM32
  • ➖ Adds GPIO-port grouping and sampling overhead where timer capture is available

Recommendation: Keep target-specific transports behind the shared DShot protocol and telemetry interfaces: timer capture uses existing STM32 motor channels, while GPIO DMA addresses AT32's capture limitation and can fall back to plain DShot. Before enabling the feature, prominently document and verify the reported incompatibility with BLHeli_32 firmware 32.9 and earlier; review flash-write pin behavior and fallback paths on hardware.

Files changed (34) +3022 / -523

Enhancement (20) +2833 / -24
debug.hAdd RPM filter debug identifier +1/-0

Add RPM filter debug identifier

• Defines a debug mode for raw per-motor RPM-filter input.

src/main/build/debug.h

dma.hExpose AT32 DMA channels for allocation +7/-4

Expose AT32 DMA channels for allocation

• Declares indexed AT32 DMA descriptor access for bitbang allocation and parenthesizes DMA flag macro arguments.

src/main/drivers/dma.h

dma_at32f43x.cImplement indexed AT32 DMA lookup +5/-0

Implement indexed AT32 DMA lookup

• Returns a DMA descriptor by index or NULL beyond the descriptor table, allowing selection of a free DMAMUX channel.

src/main/drivers/dma_at32f43x.c

bidir_dshot.cDecode and retain DShot ESC telemetry +179/-0

Decode and retain DShot ESC telemetry

• Decodes eRPM and supported extended telemetry fields, converts eRPM using motor pole count, tracks frame validity, and expires stale frequency readings.

src/main/drivers/dshot/bidir_dshot.c

bidir_dshot.hDefine bidirectional telemetry interface +65/-0

Define bidirectional telemetry interface

• Declares reply status values, telemetry types, and APIs for decoding, RPM, motor frequency, and ESC sensor readings.

src/main/drivers/dshot/bidir_dshot.h

dshot.cExtract DShot protocol and add timer capture +1096/-0

Extract DShot protocol and add timer capture

• Moves DShot framing, commands, DMA output, and flash-write handling out of the PWM driver. Adds STM32 timer-channel reply capture, GCR decoding, pin direction switching, and AT32 bitbang dispatch with plain-DShot fallback.

src/main/drivers/dshot/dshot.c

dshot.hDefine the DShot motor-driver API +65/-0

Define the DShot motor-driver API

• Exposes motor setup and updates, telemetry requests, post-initialization fallback, flash-write handling, and ESC passthrough hooks.

src/main/drivers/dshot/dshot.h

dshot_bitbang.cAdd AT32 GPIO DMA bidirectional transport +898/-0

Add AT32 GPIO DMA bidirectional transport

• Groups motor pins by GPIO port, allocates free DMA and pacing-timer resources, and switches between frame output and reply sampling. Releases resources and permits plain-DShot fallback if setup fails.

src/main/drivers/dshot/dshot_bitbang.c

dshot_bitbang.hDeclare AT32 bitbang lifecycle hooks +70/-0

Declare AT32 bitbang lifecycle hooks

• Defines setup failure statuses and APIs for motor assignment, output, reply decoding, resource release, and ESC passthrough.

src/main/drivers/dshot/dshot_bitbang.h

dshot_bitbang_decode.cDecode sampled AT32 GCR replies +186/-0

Decode sampled AT32 GCR replies

• Reconstructs GCR values from oversampled GPIO input, checks the checksum, distinguishes missing replies, and adapts preamble skipping.

src/main/drivers/dshot/dshot_bitbang_decode.c

dshot_bitbang_decode.hDeclare sampled-reply decoder +39/-0

Declare sampled-reply decoder

• Defines telemetry oversampling and the GPIO-buffer decoder interface, including missing and invalid reply outcomes.

src/main/drivers/dshot/dshot_bitbang_decode.h

pwm_output.hExpose DShot post-init and EDT command +3/-5

Expose DShot post-init and EDT command

• Adds the extended-telemetry command and motor post-initialization hook, and removes the former public command execution state.

src/main/drivers/pwm_output.h

resource.hReserve a DShot bitbang owner ID +1/-0

Reserve a DShot bitbang owner ID

• Adds a resource owner identifier for bitbang DMA allocations.

src/main/drivers/resource.h

cli.cExpose RPM_FILTER in CLI debug modes +2/-1

Expose RPM_FILTER in CLI debug modes

• Adds the new debug mode name to the CLI lookup table.

src/main/fc/cli.c

fc_core.cRequest extended telemetry when arming +18/-0

Request extended telemetry when arming

• Queues the EDT-enable DShot command on normal or turtle-mode arming when bidirectional telemetry and EDT are enabled.

src/main/fc/fc_core.c

fc_init.cInitialize telemetry and select fallback +25/-1

Initialize telemetry and select fallback

• Initializes DShot telemetry, completes AT32 bitbang allocation after other timer users, and reinitializes serial ESC sensing if bitbang falls back. Allows bidirectional DShot to activate the RPM filter without a serial ESC sensor.

src/main/fc/fc_init.c

fc_msp.cReport RPM and ESC reply quality over MSP +26/-3

Report RPM and ESC reply quality over MSP

• Selects bidirectional DShot or serial ESC RPM per motor and appends the last completed frame-success percentage and expected-frame count.

src/main/fc/fc_msp.c

rpm_filter.cAccept DShot frequency in RPM notches +31/-6

Accept DShot frequency in RPM notches

• Selects fresh bidirectional DShot frequency or age-checked serial ESC RPM, smooths it at the filter task rate, and publishes raw eRPM debug values.

src/main/flight/rpm_filter.c

esc_sensor.cIntegrate DShot data and frame windows +95/-4

Integrate DShot data and frame windows

• Accepts motor-line RPM and EDT readings without opening a serial port, ages stale readings, and tracks per-motor reply quality in one-second windows for serial and DShot sources.

src/main/sensors/esc_sensor.c

esc_sensor.hDefine shared ESC frame statistics +21/-0

Define shared ESC frame statistics

• Adds frame-window counters and APIs for publishing DShot sensor data and accessing per-motor quality statistics.

src/main/sensors/esc_sensor.h

Bug fix (1) +6 / -3
blackbox.cHandle absent ESC data in Blackbox +6/-3

Handle absent ESC data in Blackbox

• Guards combined ESC data access, initializes a temporary slow-state record, and records motor pole count in log headers.

src/main/blackbox/blackbox.c

Refactor (2) +66 / -488
pwm_output.cDelegate digital motor handling to DShot +64/-469

Delegate digital motor handling to DShot

• Removes embedded DShot state and DMA logic from the PWM driver while retaining analog PWM handling. Delegates motor updates, setup, flash writes, and passthrough to the new driver.

src/main/drivers/pwm_output.c

srxl.cUse combined ESC data for SRXL RPM +2/-19

Use combined ESC data for SRXL RPM

• Replaces obsolete separate ESC and DShot telemetry branches with the combined ESC sensor reading and its null check.

src/main/telemetry/srxl.c

Documentation (5) +57 / -4
Blackbox.mdDocument RPM filter debug output +1/-0

Document RPM filter debug output

• Explains the per-motor raw eRPM debug fields and their conversion to RPM for Blackbox analysis.

docs/Blackbox.md

ESC and servo outputs.mdDocument bidirectional DShot setup +17/-0

Document bidirectional DShot setup

• Describes ESC support, motor pole configuration, STM32 DMA requirements, and AT32 spare-timer requirements and fallback.

docs/ESC and servo outputs.md

Settings.mdDescribe DShot telemetry settings +21/-0

Describe DShot telemetry settings

• Adds the bidirectional and extended telemetry settings and the RPM_FILTER debug mode.

docs/Settings.md

README.mdDocument expanded ESC RPM response +4/-2

Document expanded ESC RPM response

• Specifies per-motor RPM, frame success percentage, and frame count, including source selection and unavailable-statistics values.

docs/development/msp/README.md

msp_messages.jsonExtend the MSP ESC RPM specification +14/-2

Extend the MSP ESC RPM specification

• Adds frameSuccess and frameTotal to each ESC RPM entry and updates the message description and source notes.

docs/development/msp/msp_messages.json

Other (6) +60 / -4
CMakeLists.txtBuild the extracted DShot drivers +8/-0

Build the extracted DShot drivers

• Registers the shared DShot, bidirectional telemetry, AT32 bitbang, and bitbang decoder source files and headers.

src/main/CMakeLists.txt

resource.cName the bitbang DMA resource owner +1/-1

Name the bitbang DMA resource owner

• Adds a readable owner name for DMA channels allocated by AT32 DShot bitbanging.

src/main/drivers/resource.c

settings.yamlAdd opt-in bidirectional DShot settings +13/-1

Add opt-in bidirectional DShot settings

• Defines disabled-by-default bidirectional and extended telemetry settings and registers the RPM_FILTER debug option.

src/main/fc/settings.yaml

mixer.cVersion and reset motor telemetry settings +3/-1

Version and reset motor telemetry settings

• Bumps the motor configuration parameter-group version and defaults both new DShot telemetry switches to off.

src/main/flight/mixer.c

mixer.hStore motor DShot telemetry switches +2/-0

Store motor DShot telemetry switches

• Adds persistent motor configuration fields for bidirectional DShot and extended telemetry.

src/main/flight/mixer.h

common_post.hGate bidirectional DShot by target +33/-1

Gate bidirectional DShot by target

• Enables timer capture on eligible STM32 targets and bitbanging on AT32, excludes incompatible DMA or MCU combinations, and permits RPM filtering with either ESC telemetry source.

src/main/target/common_post.h

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Stale ESC readings remain marked fresh ✓ Resolved
Description
escSensorUpdate() ages bidirectional DShot readings by only one step every 50 ms, and
getDshotEscSensorData() accepts an eRPM type bit that remains set after the eRPM value expires. A
silent ESC can remain in combined sensor readings for about 12.75 seconds; subsequent
extended-telemetry frames can also reset its data age while republishing stale values and a
timed-out RPM.

2. Malformed ESC replies can pass decoding ✓ Resolved
Description
dshotDecodeTelemetryPacket() maps invalid GCR symbols to zero instead of rejecting them before its
checksum test. On the timer-capture path, a malformed symbol can therefore produce an ordinary
telemetry value whenever the resulting nibbles satisfy the checksum, reaching the RPM or sensor-data
consumers.

3. Silent ESC replies appear unmeasured ✓ Resolved
Description
dshotProcessPacket() returns before incrementing the frame counters for a reply with no captured
edges, although the new MSP field describes its total as including missing replies. If an ESC is
silent for an entire window, the serializer sends 255 / 0, the same values used when no frame
statistics are available, rather than showing failed replies.

View medium (1)
4. Older configurators misread the ESC RPM reply 🐞 Bug ≡ Correctness
Description
MSP2_INAV_ESC_RPM used to send 4 bytes per motor (one U32 RPM). It now sends 7 (U32 RPM + U8
success + U16 total) under the same message ID and with no version gate. Any configurator, ground
station or script that parses the reply as 4-byte records, or works out the motor count as
payload/4, will read the frame statistics as RPM values for the next motors and get the motor count
wrong.
Code

src/main/fc/fc_msp.c[R1985-1988]

+                const escFrameCounter_t *frames = escSensorFrameCounter(i);
+                const bool framesKnown = frames->lastWindowTotal > 0;
+                sbufWriteU8(dst, framesKnown ? frames->lastWindowSuccess : 255);
+                sbufWriteU16(dst, framesKnown ? frames->lastWindowTotal : 0);
Evidence
The MSP handler appends a U8 and a U16 after each motor's U32 RPM. The docs patch confirms the reply
is now "7 bytes per motor", where the old message was a repeating U32 only. The message code
(0x2040) is unchanged, so existing clients cannot tell the two formats apart.

src/main/fc/fc_msp.c[1961-1991]
docs/development/msp/msp_messages.json[9839-9869]
src/main/msp/msp_protocol_v2_inav.h[96-96]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
MSP2_INAV_ESC_RPM changed from 4 to 7 bytes per motor under the same ID. Existing clients that parse 4-byte records will misread it.
## Fix Focus Areas
- src/main/fc/fc_msp.c[1961-1991]
- docs/development/msp/msp_messages.json[9839-9869]
## Recommended Fix
Keep MSP2_INAV_ESC_RPM as one U32 per motor. Send the frameSuccess/frameTotal statistics in a new MSP2 message (or a new versioned variant), and update the docs and the configurator to match.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

5. Bitbang decoder reads past its sample buffer ⊘ Outdated
Description
dshotBitbangDecode() checks endP > p only once per edge-scan iteration, then unconditionally
dereferences *p++ four times. When a late reply makes remaining = count - startMargin extend the
scan to the end of the fixed DMA buffer, the final iteration can read up to three halfwords past it
and use out-of-buffer data in the final run length.

6. Blackbox periodic frames log stale ESC RPM 🐞 Bug ≡ Correctness
Description
loadSlowState() now skips the escRPM/escTemperature assignment when escSensorGetData()
returns NULL. The periodic path calls it on slowHistory directly, so those fields keep their last
values. While ESC data is invalid, periodic slow frames record the old RPM/temperature. The next
change-detection pass then compares a zeroed state against the stale history and writes another,
redundant slow frame with 0.
Code

src/main/blackbox/blackbox.c[R1585-1588]

+    if (escSensor) {
+        slow->escRPM = escSensor->rpm;
+        slow->escTemperature = escSensor->temperature;
+    }
Evidence
writeSlowFrameIfNeeded calls loadSlowState(&slowHistory) on the periodic path without clearing
it first. The comparison path uses a zero-initialised newSlowState, so the two disagree whenever
the ESC sensor returns NULL.

src/main/blackbox/blackbox.c[1583-1590]
src/main/blackbox/blackbox.c[1607-1630]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
When escSensorGetData() returns NULL, loadSlowState leaves escRPM/escTemperature unchanged, so periodic slow frames log stale values.
## Fix Focus Areas
- src/main/blackbox/blackbox.c[1583-1590]
## Recommended Fix
Add an else branch that sets slow->escRPM = 0 and slow->escTemperature = 0 when escSensor is NULL.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab)

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

RAM / Flash usage vs. base commit 01a7aa3 — commit ef25528

Using the nearest available size baseline: this build contains base commit 516210c, which has no stored baseline yet, so the deltas also include what was merged to the base since 01a7aa3.

Target Flash Δ RAM Δ
MATEKF405 ⚠️ +3364 B (+0.46%) CCM: +508 B (+1.56%)
RAM: +2680 B (+2.57%)
MATEKF722 ⚠️ -7328 B (-1.52%) ITCM_RAM: -1144 B (-9.13%)
RAM: +496 B (+0.57%)
TCM: +512 B (+2.02%)
MATEKF765 +2052 B (+0.27%) DTCM_RAM: +512 B (+1.79%)
SRAM1: -64 B (-0.05%)
MATEKH743 ⚠️ +11280 B (+1.41%) D2_RAM: +64 B (+1.96%)
DTCM_RAM: +512 B (+3.95%)
ITCM_RAM: -248 B (-1.51%)
RAM: +2528 B (+1.78%)

See RAM/flash optimization guide for techniques to reduce usage.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Test firmware build ready — commit ef25528

Download firmware for PR #12214

251 targets built. Find your board's .hex file by name on that page (e.g. MATEKF405SE.hex). Files are individually downloadable — no GitHub login required.

Development build for testing only. Use Full Chip Erase when flashing.

@error414

error414 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author
  1. Malformed ESC replies can pass decoding = NOT A BUG

@BastelWastel95

Copy link
Copy Markdown

I tested caf348fd on the bench with EDFs on an AETH743Basic and a FLYINGRCF4WINGMINI. Both were running DSHOT600 with BiDi and EDT enabled and motor_poles = 6. I used two Red Hobby AM32 LED 60 A ESCs on the AETH743Basic and moved one of them over to the FlyingRC. Both ESCs were running AM32 2.20 (AORC_K_A_F421).

On the AETH743Basic, both motors were stopped with the throttle stick all the way down. As soon as I disarmed, both briefly started spinning very slowly. This happened several times. I don't have a Blackbox log for it. I tried the same arm/disarm sequence on the FlyingRC and didn't see it happen there.

I also saw motor 1's telemetry drop to 0–28% after I connected the second ESC to the AETH743Basic. I unplugged both the battery and USB-C, then powered the FC back up. Telemetry came back on both outputs, and I haven't seen the drop again.

In the Configurator motor test, all tested outputs showed 100% telemetry reception at the points below.

Motor test AETH743Basic M1 AETH743Basic M2 FlyingRC F4 Wing Mini
5% 2,800 RPM 2,700 RPM 3,200 RPM
10% 6,700 RPM 6,367 RPM 6,500 RPM

One small Configurator thing (#2851). As soon as the RPM reaches five digits, the label wraps and overlaps the motor output percentage. The screenshot shows it at 11933 RPM and 21%.
Pasted 16-11-2026 at 01 41 17

@sensei-hacker

Copy link
Copy Markdown
Member

This sounds concerning?:

!!!DONT TURN ON BIDIR DSHOT IF YOU USE BLHELI_32 fw VERSION 32.9 AND EARLIER!!!

@error414

Copy link
Copy Markdown
Contributor Author

Hi @BastelWastel95 , thank you for testing.

At first I would like to focus to "after disarm spin issue".

Between tests please don't change any other value in config.

  1. is it same if you turn off EDT?
  2. is it same if you turn off bidir + EDT?
  3. when motor start spinnig after disarm, what is in configurator in output tab? Is there 0% for botth motors?
  4. when motor start spinnig after disarm, will motors stop after while, or do you have to remove battery to stop spinning?

And could you provide your settings please.

@BastelWastel95

Copy link
Copy Markdown

I changed nothing aside from the telemetry settings between the tests and tried several times to reproduce the motor spin on disarm using the same sequence, but I couldn't get it to happen again. Since I couldn't capture it in a new test, I took the FC apart to get the SD card out and check the logs from the original session.

I attached the two logs I could date to that session, with GPS and home position data removed. Both show the ARM switch going off and end with a disarm entry. The throttle input stayed at 988 and both logged motor outputs stayed at 1000 around the switch transition. Each log runs for about a quarter of a second after that.

INAV_10.0.0_BiDi_PR2851_AETH743B.txt

LOG00042-no-gps.txt
LOG00043-no-gps.txt

@error414

Copy link
Copy Markdown
Contributor Author

Hmm, it's not good you are not able to reproduce it. Don't you remember, did you connect to AM32 configurator before testes when have seen the weird behaviour?

@sensei-hacker

Copy link
Copy Markdown
Member

This comment was drafted with the help of an AI tool, which may be wrong on any point below.

Thanks for carrying bidirectional DShot forward!

One request about the settings layout: this PR inserts useDshotTelemetry and useDshotEdt in the middle of motorConfig_t (after motorPwmProtocol) and bumps PG_MOTOR_CONFIG from 11 to 12. A PG version bump resets that group to defaults on upgrade, so we'd like to avoid one in 10.1, which is a minor release.

Could you move the two new fields to the end of motorConfig_t and drop the version bump? pgLoad() copies MIN(stored, current) bytes over the reset defaults when the versions match. A field appended at the end with a default of 0 (off) therefore loads cleanly from an older configuration without a bump. The comment block above the USE_MOTOR_SRXL2 fields in mixer.h explains the details, including the padding byte to watch for.

Heads-up: #12120 and #12121 (throttle boost / thrust linearization) also append to the end of motorConfig_t, so whichever merges second will need a small rebase there.

Thank you!

@sensei-hacker sensei-hacker added this to the 10.1 milestone Nov 22, 2026
@error414

Copy link
Copy Markdown
Contributor Author

This comment was drafted with the help of an AI tool, which may be wrong on any point below.

Thanks for carrying bidirectional DShot forward!

One request about the settings layout: this PR inserts useDshotTelemetry and useDshotEdt in the middle of motorConfig_t (after motorPwmProtocol) and bumps PG_MOTOR_CONFIG from 11 to 12. A PG version bump resets that group to defaults on upgrade, so we'd like to avoid one in 10.1, which is a ...
.....

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants