Skip to content

ChibiOS upgrade to version 21.11.5#30605

Open
andyp1per wants to merge 6 commits intoArduPilot:masterfrom
andyp1per:pr-chibios-upgrade
Open

ChibiOS upgrade to version 21.11.5#30605
andyp1per wants to merge 6 commits intoArduPilot:masterfrom
andyp1per:pr-chibios-upgrade

Conversation

@andyp1per
Copy link
Copy Markdown
Contributor

@andyp1per andyp1per commented Jul 10, 2025

Upgrade ChibiOS to the latest stable version with support for hal v9.1 and H5

Currently boots on a Pixhawk6X and TBS Lucid H7

@tpwrules
Copy link
Copy Markdown
Contributor

Does this require updates to the OpenOCD and Segger thread debugging?

@andyp1per andyp1per force-pushed the pr-chibios-upgrade branch from ea523cb to 0d672b1 Compare July 11, 2025 06:58
@andyp1per
Copy link
Copy Markdown
Contributor Author

Does this require updates to the OpenOCD and Segger thread debugging?

Don't know as yet.

@magicrub
Copy link
Copy Markdown
Contributor

I'm all in favor of updating ChibiOS, and I see you've updated the submodule.. but shouldn't there be a pull-request in ardupilot/ChibiOS for this too? Where's the changelog for v8?

@andyp1per
Copy link
Copy Markdown
Contributor Author

I'm all in favor of updating ChibiOS, and I see you've updated the submodule.. but shouldn't there be a pull-request in ardupilot/ChibiOS for this too? Where's the changelog for v8?

There's a branch, no PR as yet but I can put it up.

@andyp1per andyp1per force-pushed the pr-chibios-upgrade branch from 0d672b1 to 109132a Compare July 17, 2025 09:30
@tridge
Copy link
Copy Markdown
Contributor

tridge commented Feb 15, 2026

@andyp1per what branch is this based on? is it a rebase?

@tridge
Copy link
Copy Markdown
Contributor

tridge commented Feb 15, 2026

@andyp1per it seems to be missing these recent changes?

4f34e21702137a43829501654c283940f8ffe179 (HEAD, origin/master, origin/HEAD) SDMMCv1: finish bouncebuffer use after error cleanup
ac078e599f9c91349fd0d61af646b9adc36c569a SDMMCv1: fix system hang issues
2e60c063e4c990efc6e3f009a7414990f9c92981 Tentative fix.
2f6900ebb6f691cb578582ffd10a917363835294 SDMMCv2: finish bouncebuffer use after error cleanup
d4ecae01f61df3b475d305f8b04bf7ccf13b71d7 SDMMCv2: reset peripheral on stop to clear state machine
2ffefb6d28c2ea37e8e00b98edc089ea3d515317 SDIOv1: finish bouncebuffer use after error cleanup
9e9790a364337de6b8e4d2ef45720bcc3549f510 SDIOv1: wait for DMA completion only when it will complete
e858306b143c0ac86ebf9c2fbce3a894b580635c SDIOv1: unlock before waiting for DMA completion
101f46f7d8cf63e9198ebe0912b47ad544e32c9c Tentative fix.
a0839ca587e5543405214885a5f0ef09f2c61947 SDIOv1: use unsigned literals to match upstream

@tridge
Copy link
Copy Markdown
Contributor

tridge commented Feb 15, 2026

@andyp1per Peter and I tested on a KakuteF7 quad and it seems that ESC telemetry messages come through less frequently on mavlink with this PR. They are not as frequent as I would normally expect (expect 4Hz) on master too, but with this PR I was seeing an update every 10s or so, so seems to have gotten worse.

@tridge
Copy link
Copy Markdown
Contributor

tridge commented Feb 15, 2026

Peter and I tested on mini-pix on a plane, no issues

@tpwrules
Copy link
Copy Markdown
Contributor

Definitely want to hold this til 4.8, and debugging needs testing and possible fixing.

@andyp1per andyp1per force-pushed the pr-chibios-upgrade branch from 109132a to 43bc5ec Compare April 4, 2026 18:51
@andyp1per andyp1per force-pushed the pr-chibios-upgrade branch from 43bc5ec to c4b7b66 Compare April 4, 2026 19:05
@andyp1per andyp1per changed the title ChibiOS upgrade to kernel v8 ChibiOS upgrade to kernel v9 Apr 4, 2026
@andyp1per
Copy link
Copy Markdown
Contributor Author

Does this require updates to the OpenOCD and Segger thread debugging?

No changes required, the two versions are binary compatible

@andyp1per andyp1per force-pushed the pr-chibios-upgrade branch from 68582c4 to da43bf9 Compare April 7, 2026 14:09
@andyp1per andyp1per changed the title ChibiOS upgrade to kernel v9 ChibiOS upgrade to version 21.11.5 Apr 7, 2026
The ChibiOS I2Cv4 LLD (used on STM32G0/G4/C0/U0/U3/H5/L4+) uses a
single DMA channel per I2C peripheral, shared between TX and RX,
configured via STM32_I2C_I2Cx_DMA_CHANNEL. The previous code
emitted the separate STM32_I2C_I2Cx_RX/TX_DMA_STREAM defines used
by I2Cv2/I2Cv3, which no longer satisfy the I2Cv4 driver.

Detect I2Cv4 MCUs from CHIBIOS_PLATFORM_MK, allocate a single DMA
channel per I2C peripheral in dma_resolver.py (no _RX/_TX split),
and generate HAL_I2Cn_CONFIG entries that feed the single channel
into the shared DMA slot with SHARED_DMA_NONE as the partner.

Also replace the unconditional STM32_I2C_USE_I2Cn TRUE lines in
stm32g4_mcuconf.h with #ifndef-guarded defaults to FALSE, so
boards only enable the I2C peripherals their hwdef actually uses.
Without this, the I2Cv4 driver demanded DMA channels for every
I2C peripheral on every G4 board regardless of pin usage.
Rename STM32_I2C_I2Cn_IRQ_PRIORITY to STM32_IRQ_I2Cn_PRIORITY to
match the naming used by the kernel v9 I2Cv4 driver, mirroring
the same rename already applied to stm32g4_mcuconf.h.
@andyp1per andyp1per force-pushed the pr-chibios-upgrade branch from 049f51e to dabfcfe Compare April 10, 2026 18:46
@andyp1per
Copy link
Copy Markdown
Contributor Author

ok this is a rebase of all our changes on top of the ChibiOS stable 21.11.5 branch. Should all be in there now. I think we will probably have to branch the current ChibiOS repo as 21.11.3 and then force push this to master

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.

5 participants