FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(dshot): log the ESC EEPROM dumps by dakejahl · Pull Request #28800 · PX4/PX4-Autopilot · GitHub

feat(dshot): log the ESC EEPROM dumps - #28800

Open
dakejahl wants to merge 4 commits into
mainfrom
dakejahl/esc-eeprom-log
Open

dakejahl wants to merge 4 commits into
mainfrom
dakejahl/esc-eeprom-log

Conversation

dakejahl commented Sep 22, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Summary

Supersedes #28639, recording ESC settings in flight logs with schema-driven decoding. The original DShot initialization fix and decoder are @danielbuleandra's work; both commits retain co-author credit.

Problem

Telemetry can initialize before the motor mask exists, preventing EEPROM reads. Boot-only dumps are absent from later logs, and concurrent DShot commands can interrupt EEPROM programming or leave cached settings stale.

Solution

Wait for the motor mask before initializing telemetry. Publish valid cached settings once per second while armed or disarmed, allowing logs started later to capture every ESC. Read hardware while disarmed on boot, confirmed reconnect, GCS request, or after a settings save. Invalidate before changes and on confirmed disconnect; retry failed reads without starving other ESCs. Keep programming uninterrupted and forward updates through enabled MAVLink streams.

Decode version bounds and disabled values from vendor schemas without mutating shared definitions across ESCs, and collapse repeated dumps. Firmware build, host checks, and decoder regressions passed; hardware testing remains outstanding.

dakejahl and others added 2 commits September 22, 2026 10:28
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>
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>
github-actions Bot added kind:feature Request or change that adds new functionality. scope:drivers Device drivers and hardware interfaces. scope:control Rate, attitude, position, allocation, or actuator control. scope:logging ULog, logger, replay, events, or diagnostics. scope:tools Scripts, developer tools, packaging, or setup helpers. labels Sep 22, 2026

github-actions Bot commented Sep 22, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

🔎 Flash and RAM Analysis

Target Flash change Static RAM change
px4_fmu-v5x 🟡 +488 B (+0.02%) +0 B (+0.00%)
px4_fmu-v6x 🟡 +488 B (+0.03%) +0 B (+0.00%)
px4_fmu-v5x — Bloaty section/symbol breakdown
     VM SIZE    
 -------------- 
  +0.0%    +488    .text
    [NEW]    +116    DShotTelemetry::getSettingsRequest()
     +54%     +70    DShot::update_motor_commands()
    [NEW]     +64    DShotTelemetry::publishSettings()
    [NEW]     +64    DShotTelemetry::resetCommandResponse()
    [NEW]     +48    DShotTelemetry::invalidateSettings()
     +16%     +44    DShot::handle_configure_actuator()
   -100.0%     +30    [10 Others]
    [NEW]     +24    CSWTCH.154
     +29%     +20    DShotTelemetry::printStatus()
    +0.5%     +20    px4::logger::LoggedTopics::add_default_topics()
     +57%     +16    AM32Settings::AM32Settings()
    +1.9%     +16    DShot::DShot()
    +5.9%     +12    DShot::Run()
    +2.4%     +12    DShot::process_serial_telemetry()
     +11%     +12    DShotTelemetry::initSettingsHandlers()
    [NEW]     +12    DShotTelemetry::requestSettings()
    [NEW]      +9    CSWTCH.155
    [DEL]      -9    CSWTCH.146
    -2.5%     -20    DShot::print_status()
    [DEL]     -24    CSWTCH.145
    -6.4%     -48    DShot::select_next_command()
  +0.0%    +488    TOTAL

px4_fmu-v6x — Bloaty section/symbol breakdown
     VM SIZE    
 -------------- 
  +0.0%    +488    .text
    [NEW]    +116    DShotTelemetry::getSettingsRequest()
     +54%     +70    DShot::update_motor_commands()
    [NEW]     +64    DShotTelemetry::publishSettings()
    [NEW]     +64    DShotTelemetry::resetCommandResponse()
    [NEW]     +48    DShotTelemetry::invalidateSettings()
     +16%     +44    DShot::handle_configure_actuator()
   -100.0%     +30    [10 Others]
    [NEW]     +24    CSWTCH.154
     +29%     +20    DShotTelemetry::printStatus()
    +0.5%     +20    px4::logger::LoggedTopics::add_default_topics()
     +57%     +16    AM32Settings::AM32Settings()
    +1.9%     +16    DShot::DShot()
    +5.9%     +12    DShot::Run()
    +2.4%     +12    DShot::process_serial_telemetry()
     +11%     +12    DShotTelemetry::initSettingsHandlers()
    [NEW]     +12    DShotTelemetry::requestSettings()
    [NEW]      +9    CSWTCH.155
    [DEL]      -9    CSWTCH.146
    -2.5%     -20    DShot::print_status()
    [DEL]     -24    CSWTCH.145
    -6.4%     -48    DShot::select_next_command()
  +0.0%    +488    TOTAL

Updated: 2026-09-23T02:46:09

github-actions Bot added scope:offboard Offboard mode, external setpoints, companion-computer control, or offboard failsafe behavior. scope:mavlink MAVLink module, streams, commands, or protocol handling. labels Sep 22, 2026
github-actions Bot added scope:uorb uORB messages, generated interfaces, or message translation. kind:test Adds or improves tests. scope:testing Unit, integration, fuzzing, or test data. labels Sep 22, 2026
dakejahl force-pushed the dakejahl/esc-eeprom-log branch from 9c86d30 to 7fbd947 Compare September 23, 2026 02:03
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
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
dakejahl force-pushed the dakejahl/esc-eeprom-log branch from 8224677 to 2da40bf Compare September 23, 2026 02:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:feature Request or change that adds new functionality. kind:test Adds or improves tests. scope:control Rate, attitude, position, allocation, or actuator control. scope:drivers Device drivers and hardware interfaces. scope:logging ULog, logger, replay, events, or diagnostics. scope:mavlink MAVLink module, streams, commands, or protocol handling. scope:offboard Offboard mode, external setpoints, companion-computer control, or offboard failsafe behavior. scope:testing Unit, integration, fuzzing, or test data. scope:tools Scripts, developer tools, packaging, or setup helpers. scope:uorb uORB messages, generated interfaces, or message translation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL