Skip to content

[PX4] AM32 EEPROM settings support#14013

Open
dakejahl wants to merge 2 commits intomasterfrom
pr-am32_eeprom4
Open

[PX4] AM32 EEPROM settings support#14013
dakejahl wants to merge 2 commits intomasterfrom
pr-am32_eeprom4

Conversation

@dakejahl
Copy link
Collaborator

Summary

  • Add AM32 ESC EEPROM read/write settings UI via MAVLink ESC_EEPROM message
  • Fetch and cache AM32 JSON schema from am32.ca with fallback to bundled schema
  • Implement per-ESC selection, bulk read/write, majority-match detection, and version-aware setting visibility
  • Refactor ESC status indicators from bitmask-based to per-ESC online status, with grid layout for >4 ESCs

This is effectively the AM32 Configurator built into QGC. This enables a wireless method to check and edit ESC settings.

The accompanying PX4 PR is here PX4/PX4-Autopilot#26263

Details

New files:

  • AM32Component — PX4 auto-pilot plugin component for the AM32 settings page
  • AM32SettingsComponent.qml — Full settings UI with read/write controls, unsaved change indicators, and setting sliders
  • AM32EepromFactGroupListModel — MAVLink message handling for ESC EEPROM read/write, including write masks and majority matching across selected ESCs
  • AM32EepromSchema — Remote schema fetching with CachedFileDownload, JSON parsing, version overrides, and conversion factor support

Modified:

  • EscIndicator.qml / EscIndicatorPage.qml — Per-ESC online status instead of shared bitmask; grid layout for motor count >4
  • EscStatusFactGroupListModel.cc — Fix index-to-bitmask mapping for 4-per-message groups
  • Vehicle.cc/h — Integrate AM32 EEPROM model

Test plan

  • Build succeeds with no warnings
  • Connect to vehicle with AM32 ESCs and verify schema downloads (check logs for "Fetching AM32 schema from")
  • Read/write EEPROM settings through the AM32 settings page
  • Verify ESC indicator shows correct online/offline status for >4 ESCs

Screenshots

All settings match
image

One ESC beep volume is different
image

ESC indicator grid layout
image

Copilot AI review requested due to automatic review settings February 21, 2026 03:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive AM32 ESC EEPROM settings support to QGroundControl for PX4 autopilots, enabling wireless configuration of AM32 ESCs via MAVLink. The implementation includes schema-based settings management with version-aware field visibility, per-ESC selection with majority-match detection, and a complete UI for reading/writing ESC parameters.

Changes:

  • Implemented AM32 EEPROM read/write via MAVLink ESC_EEPROM messages with schema-based field definitions
  • Added PX4 AutoPilot plugin component with QML UI for ESC settings configuration
  • Refactored ESC status indicators to use per-ESC online status instead of shared bitmask, with grid layout support for >4 ESCs

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Vehicle.h/cc Integrated AM32EepromFactGroupListModel into Vehicle class
eeprom.json Added bundled AM32 EEPROM schema with field definitions and version-specific metadata
EscStatusFactGroupListModel.cc Fixed per-ESC online status extraction from bitmask instead of using shared value
AM32EepromSchema.h/cc Implemented schema loader with remote fetch capability and version-aware field filtering
AM32EepromFactGroupListModel.h/cc Created MAVLink message handling for ESC EEPROM with write masks and setting comparison
AM32EepromFact.json Defined fact metadata for AM32 EEPROM version and firmware info fields
EscIndicator.qml/EscIndicatorPage.qml Updated to per-ESC online status and grid layout for multiple ESCs
PX4AutoPilotPlugin.h/cc Added conditional AM32Component instantiation based on DSHOT_ESC_TYPE parameter
AM32Component.h/cc/qml Created new vehicle component for AM32 ESC configuration
AM32SettingsComponent.qml Implemented full settings UI with ESC selection and grouped setting controls
AM32SettingSlider.qml Created reusable slider control with pending change indicators
AM32ComponentSummary.qml Added summary view showing ESC detection status

@github-actions
Copy link
Contributor

github-actions bot commented Feb 21, 2026

Build Results

Platform Status

Platform Status Details
Linux Failed View
Windows Passed View
MacOS Passed View
Android Passed View

Some builds failed.

Pre-commit

Check Status Details
pre-commit Failed (non-blocking) View

Pre-commit hooks: 4 passed, 35 failed, 7 skipped.

Artifact Sizes

Artifact Size
QGroundControl 320.80 MB
QGroundControl 330.95 MB
QGroundControl-installer-AMD64 151.42 MB
QGroundControl-installer-AMD64-ARM64 77.66 MB
QGroundControl-installer-ARM64 78.63 MB
QGroundControl-mac 184.80 MB
QGroundControl-windows 184.84 MB
No baseline available for comparison---
Updated: 2026-03-24 02:40:34 UTC • Triggered by: Android

@dakejahl
Copy link
Collaborator Author

dakejahl commented Mar 2, 2026

@DonLakeFlyer do you have any feedback on the design?

@DonLakeFlyer
Copy link
Collaborator

I'll try to to get to this. I'm swamped with my own wildlife drone testing right now.

@dakejahl
Copy link
Collaborator Author

dakejahl commented Mar 2, 2026

I'll try to to get to this. I'm swamped with my own wildlife drone testing right now.

Okay no rush, I just wasn't sure if you saw it. Let me know if I can help.

@DonLakeFlyer
Copy link
Collaborator

First quick comment: With regards to the new ESC_EEPROM message which sets params. Wouldn't it be better if this where a MAV_CMD? This way you can get an Ack result as well as automatic retry support.

@DonLakeFlyer
Copy link
Collaborator

For the places you are using sliders, what about using FactTextFieldSlider. Then you get both slider and type in support:
Screenshot 2026-03-03 at 9 11 15 AM

@dakejahl
Copy link
Collaborator Author

dakejahl commented Mar 3, 2026

First quick comment: With regards to the new ESC_EEPROM message which sets params. Wouldn't it be better if this where a MAV_CMD? This way you can get an Ack result as well as automatic retry support.

There's a couple of reasons I went with the message "package" structure

  • Atomic updates. The FC writes the entire settings struct to the ESC in one go. This is required by the ESC due to how the comm protocol works. When the FC writes settings it performs a command sequence to write the EEPROM, we need to know when to start/stop. It also allows use to show the current state of the ESC settings and the pending changes from the GCS.
  • Simplicity. MAV_CMDs would spam the link and the 1:1 setting-to-command is the wrong paradigm. The FC responds with its own ESC_EEPROM message which serves as an ACK.

There's a lot more context in the original RFC mavlink/rfcs#27

@DonLakeFlyer
Copy link
Collaborator

  • The FC responds with its own ESC_EEPROM message which serves as an ACK.

I'm all good as long as there is some way to determine whether it worked or not.

@DonLakeFlyer DonLakeFlyer reopened this Mar 4, 2026
@DonLakeFlyer
Copy link
Collaborator

@dakejahl Can you squash to a reasonable set of commits. Rebase and then I'll submit it for another CoPilot review.

@dakejahl
Copy link
Collaborator Author

I'm also going to run some Claude /review on this. Let's hold off on copilot since it can really thrash the PR discussion with noise.

@DonLakeFlyer
Copy link
Collaborator

I guess the thing I wonder about with this is why it's valuable to increase the surface area of QGC for something which is already supported by an external tool. Why not go the same route as ArduPilot which has a mode to make the regular configurator? Also means you need to chase changes made to the original tool.

I always worry about biggish new things since I tend to get left holding the bag on them for years to come...

@dakejahl
Copy link
Collaborator Author

Why not go the same route as ArduPilot which has a mode to make the regular configurator?

AM32 configurator requires a physical USB connection.

  • This is impossible on our ARK Jetson Carrier boards since the FC USB is not exposed.
  • Many builds bury the FC inside the airframe or otherwise block the USB port.

Also means you need to chase changes made to the original tool.

The eeprom data has a version field and the schema https://am32.ca/eeprom is also version aware. The result should be that this QGC tool will simply leave out new fields that it doesn't know about.

I always worry about biggish new things since I tend to get left holding the bag on them for years to come...

Totally understand that. I can always make a separate Qt tool for AM32 over MAVLink, but it's nice to have everything in one tool. The impact to other modules is low, so can be easily removed if it becomes a burden.

We get this complaint very often:

"So I need to buy a separate FC and flash Betaflight just to update these ESCs???"

And PX4 doesn't support "ESC passthrough" (the USB protocol) so indeed they need to use an FC that runs betaflight. So they have to disassemble their airframe just configure settings or flash fw or they need an FC that supports both PX4 and Betaflight.

And the counter argument is

"users should know they need to configure/flash their ESCs before they build their drone!"

But a lot of people don't know this and end up frustrated. All of this work is coming from real world user complaints around setting up and updating AM32 firmware.

@DonLakeFlyer
Copy link
Collaborator

Good reasons to add this then...

@dakejahl
Copy link
Collaborator Author

Good reasons to add this then...

Yup. I'll work with Claude today/tomorrow and try to get this as good as possible before you review so that you don't have to spend too much time on it 😃

ESC_EEPROM write messages were encoded with the vehicle's system/component
IDs as the source, causing mavlink-router to drop them since they appeared
to originate from the autopilot rather than the GCS.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants