Skip to content

targets: add commented CAN bus pins to 7 H7 targets#11631

Open
daijoubu wants to merge 1 commit into
iNavFlight:maintenance-10.xfrom
daijoubu:feature/audit-targets-canbus-pins
Open

targets: add commented CAN bus pins to 7 H7 targets#11631
daijoubu wants to merge 1 commit into
iNavFlight:maintenance-10.xfrom
daijoubu:feature/audit-targets-canbus-pins

Conversation

@daijoubu
Copy link
Copy Markdown
Contributor

@daijoubu daijoubu commented Jun 7, 2026

Summary

Adds commented-out CAN1 pin definitions to 7 H7 flight controller targets where CAN bus pins could be identified from the corresponding ArduPilot hwdef files.

Targets updated:

Target CAN1 RX CAN1 TX CAN1 STANDBY AP Source
AETH743Basic PD0 PD1 PD3 AET-H743-Basic
BROTHERHOBBYH743 PD0 PD1 PD3 BROTHERHOBBYH743
CORVON743V1 PB8 PB9 CORVON743V1
DAKEFPVH743PRO PD0 PD1 PD2 DAKEFPVH743Pro
MICOAIR743 PB8 PB9 MicoAir743
TBS_LUCID_H7 PD0 PD1 PD3 TBS_LUCID_H7
TBS_LUCID_H7_WING PD0 PD1 PD3 TBS_LUCID_H7_WING

Important: Definitions are commented out

These pin definitions are sourced from ArduPilot hwdef files and have not been validated on real hardware. We do not have any of these boards available for testing. The blocks are commented out by default so normal builds are completely unaffected.

The FDCAN1 peripheral can only be used as an alternate function on a limited number of pins, so the pin assignments are easy to audit.
STM32H743 has 2 FDCAN peripherals (FDCAN3 is only on H725/H730 variants — the H743 CMSIS header confirms IS_FDCAN_ALL_INSTANCE covers only FDCAN1+FDCAN2).

Both use AF9. From RM and Datasheet:

  • FDCAN1_RX: PA11, PB8, PD0, PH14 (all AF9)
  • FDCAN1_TX: PA12, PB9, PD1, PH13 (all AF9)
  • FDCAN2_RX: PB5, PB12 (AF9)
  • FDCAN2_TX: PB6, PB13 (AF9)

Users who have the hardware and want to test DroneCAN can uncomment the block in their local target.h and do a custom build. Confirmed working INAV DroneCAN targets (KAKUTEH7WING, MATEKH743, MATEKF765) served as the pattern reference.

What was checked before adding

  • Pin assignments cross-referenced against AP hwdef files (not guessed)
  • AP hwdef include chains checked to ensure child hwdefs do not override the CAN pins with UART or other functions (the DAKEFPVH743 non-PRO was excluded for exactly this reason — its AP hwdef repurposes PD0/PD1 for UART4)
  • CAN pins verified free in each INAV target.h (no UART, SPI, I2C, or other conflicts)
  • Standby pin polarity consistent with existing INAV targets (driven LOW = CAN enabled)

What was excluded and why

  • 76 H7/F7 targets with no AP equivalent — no reference source
  • 18 targets matched to AP but with no CAN in their hwdef — AP didn't define them, likely not routed to a connector
  • DAKEFPVH743 — CAN pins conflict with UART4 in both AP and INAV
  • TBS_LUCID_H7_WING_MINI — no dedicated AP hwdef; PCB differences from WING (different current sensor scale, missing cam switcher) mean pins cannot be safely inferred
  • KAKUTEH7WING, MATEKH743, MATEKF765 — already have CAN defined and active

Build matrix

All targets pass, zero warnings.

MCU Target Result
F4 MATEKF405 ✅ PASS
F7 MATEKF765 ✅ PASS
H7 KAKUTEH7WING ✅ PASS
AT32 IFLIGHT_BLITZ_ATF435 ✅ PASS
SITL SITL ✅ PASS

Add commented-out CAN1 pin definitions to AETH743Basic,
BROTHERHOBBYH743, CORVON743V1, DAKEFPVH743PRO, MICOAIR743,
TBS_LUCID_H7, and TBS_LUCID_H7_WING. Pins sourced from the
corresponding ArduPilot hwdef files. Blocks are commented by
default so normal builds are unaffected; users with CAN-capable
hardware can uncomment to enable DroneCAN support via a custom build.

CORVON743V1 and MICOAIR743 use PB8/PB9 (no standby pin in AP hwdef).
DAKEFPVH743PRO uses PD2 as standby (differs from the usual PD3).
Remaining five use PD0/PD1/PD3.
@qodo-code-review
Copy link
Copy Markdown
Contributor

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 7, 2026

Test firmware build ready — commit 8d16170

Download firmware for PR #11631

238 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.

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