Skip to content

Sync next-10.1 into maintenance-11.x - #12267

Merged
github-actions[bot] merged 30 commits into
maintenance-11.xfrom
next-10.1
Nov 29, 2026
Merged

github-actions[bot] merged 30 commits into
maintenance-11.xfrom
next-10.1

Conversation

@github-actions

Copy link
Copy Markdown

Automatic sync of next-10.1 into maintenance-11.x could not be completed (merge conflict or push refused). Merge next-10.1 into maintenance-11.x locally, resolve conflicts, and push. Use a merge commit, not squash or rebase. Do not use GitHub's "Resolve conflicts" button.

MrScothh and others added 30 commits September 28, 2026 00:22
The encoders write one byte at a time, and every byte went to the device
on its own: one afatfs_fputc() or flashfsWriteByte() call per byte.
Collect them in a 128 byte block and hand it over with one
afatfs_fwrite() or flashfsWrite() call. The block goes out when it is
full, before anything else reaches the device (header prints, flushes,
the end of a log, the header budget) and at the end of every
blackboxUpdate(), so nothing waits longer than one loop and the bytes
keep their order; while the terrain code holds the SD card it waits
until the card is back. Serial ports still get one byte at a time,
since serialWriteBuf() would wait for room.

On a TBS Lucid H7 logging to SD the blackbox takes 2.3% of the CPU at
1 kHz and 4.4% at 2 kHz; this cuts that time by 10 to 13%.
The SPI of F7 has a 4-byte FIFO and that of F4 none, so there every
data-ready read goes through two DMA streams. The SPI stays enabled, as
for the main loop's transfers, and setting its DMA requests starts the
read. The streams are taken like on H7, among the options the
reference manual gives each request, at the end of initialisation.

Nobody has tested this on an F4 or F7 board yet, so gyro_data_ready
AUTO leaves it off there: ON turns it on.
Pins added where INAV and Betaflight's config for the same board agree
on the gyro's CS pin and SPI bus. In a folder with several targets the
pin goes only to those Betaflight confirms. Two targets had a pin that
disagreed with Betaflight and is fixed: KAKUTEF4WING (PB12, now PB2)
and AOCODARCF405AIO (PC5, now PC4, as on the rest of the Aocoda F405
family, where PC5 is a PINIO). INAV never read those pins, so the
wrong values never showed.
… switch, counts every skipped iteration and lends the card to terrain
AUTO now reads the ICM-42605 and ICM-42688-P on their data-ready interrupt on every
family. Where no interrupt arrives the gyro is read from its registers as before.
…ume iteration is not counted

On the bench, sd_info counted one iteration too many for every pause the card
ended: the iteration that resumes is logged. When the switch takes over a pause
for the card and comes back on while the card is still behind, the resume wrote
its I frame into what is left below the threshold, 80 to 255 bytes: enough in
8 runs, not after a large iteration. Now it waits, and those iterations count
as lost to the card.
…eads it

Written once at setup, so cleaned once there: nothing at run time. A no-op
today: DMA_RAM is Shareable in the H7 MPU setup and the Cortex-M7 does not
cache it, and on F7, which runs the same setup, INAV leaves the D-cache off.
It matches the invalidate on the reply and stays right should either change.

(cherry picked from commit 4287429)
The new fields are appended with a zero default, so stored settings load as they are: pgLoad copies
the stored bytes over the defaults. On H7 without USE_DUAL_GYRO gyro_data_ready takes the old
record's tail padding, which the reset template leaves at zero.
# Conflicts:
#	src/main/drivers/bus_spi_hal_ll.c
blackbox: hand the device a block of bytes, not one byte per call
@github-actions
github-actions Bot merged commit 553aa63 into maintenance-11.x Nov 29, 2026
9 checks passed
@github-actions

Copy link
Copy Markdown
Author

RAM / Flash usage vs. base commit 01a7aa3 — commit a04be99

Using the nearest available size baseline: this build contains base commit 117d379, which has no stored baseline yet, so the deltas also include what was merged to the base since 01a7aa3.

Target Flash Δ RAM Δ
MATEKF405 ⚠️ +6028 B (+0.83%) CCM: +12964 B (+39.82%)
RAM: -1700 B (-1.63%)
MATEKF722 ⚠️ -5192 B (-1.08%) ITCM_RAM: -872 B (-6.96%)
RAM: +9056 B (+10.43%)
TCM: +644 B (+2.54%)
MATEKF765 ⚠️ +6724 B (+0.89%) DTCM_RAM: +640 B (+2.24%)
SRAM1: +9224 B (+7.36%)
MATEKH743 ⚠️ +9380 B (+1.17%) D2_RAM: +256 B (+7.84%)
DTCM_RAM: +640 B (+4.94%)
ITCM_RAM: -920 B (-5.61%)
RAM: +14780 B (+10.38%)

See RAM/flash optimization guide for techniques to reduce usage.

@github-actions

Copy link
Copy Markdown
Author

Test firmware build ready — commit a04be99

Download firmware for PR #12267

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

2 participants