Skip to content

Comments

px4iofirmware: add dual-MCU IO support for H7#26536

Draft
HTRamsey wants to merge 1 commit intoPX4:mainfrom
HTRamsey:dual-mcu-compat
Draft

px4iofirmware: add dual-MCU IO support for H7#26536
HTRamsey wants to merge 1 commit intoPX4:mainfrom
HTRamsey:dual-mcu-compat

Conversation

@HTRamsey
Copy link
Contributor

Summary

  • Refactor px4iofirmware serial driver into per-architecture platform libraries (arch_io_serial), moving bare-metal USART/DMA code out of src/modules/px4iofirmware/ into platforms/nuttx/src/px4/stm/
  • Add STM32H7 IO serial driver with ISR/ICR/RDR/TDR register model, struct-based DMA API, and D-cache coherence
  • Add STM32H7 IWDG watchdog support (ported from F7, register-compatible)
  • Guard ENABLE_SBUS_OUT and VDD_SERVO_FAULT macros in px4io.h behind GPIO availability checks
  • Add bootloader serial-forwarding protocol (PROTO_SERIAL_FORWARD) for uploading firmware to a secondary MCU through the primary
  • Add --update-mode option to px4_uploader.py supporting primary/secondary/both/auto upload modes
  • Add SYS_SEC_UPDATE parameter for triggering secondary firmware update via bootloader reboot
  • Add generic secondary MCU firmware packaging and upload infrastructure in CMake
  • Add ROMFS init script support for secondary firmware upgrade flow

Test plan

  • make px4_io-v2_default — verifies F1 io_serial refactoring doesn't break existing IO boards (39.8KB flash)
  • make cubepilot_cubeorangeplus_default — verifies H7 FMU builds unaffected by new io_serial/watchdog subdirs (EXCLUDE_FROM_ALL)
  • python3 -m pytest test/test_px4_uploader.py — 9/9 tests pass (upload plan resolution, secondary upload flow, timeout handling)
  • Hardware test on a dual-MCU board (e.g. CubeRed) with both primary and secondary firmware upload

Add platform-level support for running PX4IO firmware on STM32H7,
enabling dual-MCU boards where the IO coprocessor is an H7 rather
than the traditional STM32F100 (io-v2).

Platform changes:
- Add H7 IWDG watchdog (stm32h7/watchdog/) — register-compatible
  with F7, needed by px4iofirmware's arch_watchdog_iwdg dependency
- Split px4iofirmware serial.cpp into per-arch platform libraries:
  stm32h7/io_serial (ISR/ICR/RDR/TDR registers, struct-based DMA,
  D-cache coherence) and stm32_common/io_serial (SR/DR registers,
  positional DMA) — mirrors the FMU-side px4io_serial pattern
- Guard px4io.h ENABLE_SBUS_OUT and VDD_SERVO_FAULT macros on
  GPIO existence so boards without those pins compile cleanly

Bootloader/uploader:
- Add secondary MCU serial forwarding in bootloader
- Extend px4_uploader.py for secondary firmware upload
- Add SYS_SECONDARY_FW_UPDATE parameter
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.

1 participant