mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-22 14:19:57 +08:00
d0775f2e40407dc9779ba0a6b122b97c6f092b4d
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ae7977f868 |
feat(dshot): log the ESC EEPROM dumps (#28800)
* 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> |
||
|
|
f00e46f618 |
feat(dshot): Extended Telemetry and EEPROM support
Overhauls the DShot driver with per-timer BDShot selection, multi-timer
sequential capture, Extended DShot Telemetry (EDT), and AM32 ESC EEPROM
read/write via MAVLink. Expands ESC support from 8 to 12 channels.
BDShot:
- Per-timer BDShot protocol selection via actuator config UI
- Multi-timer sequential burst/capture on any DMA-capable timer
- Adaptive per-channel GCR bitstream decoding
- Per-channel online/offline detection with hysteresis
Extended DShot Telemetry (EDT):
- Temperature, voltage, current from BDShot frames (no serial wire)
- New DSHOT_BIDIR_EDT parameter
- EDT data merged with serial telemetry when both available
AM32 EEPROM:
- Read/write AM32 ESC settings via MAVLink ESC_EEPROM message
- ESCSettingsInterface abstraction for future ESC firmware types
- New DSHOT_ESC_TYPE parameter
Other changes:
- Per-motor pole count params DSHOT_MOT_POL1–12 (replaces MOT_POLE_COUNT)
- EscStatus/EscReport expanded to 12 ESCs with uint16 bitmasks
- Numerous bounds-check, overflow, and concurrency fixes
- Updated DShot documentation
|