Skip to content

PoC OpenDrone RPI FC - #12236

Open
error414 wants to merge 10 commits into
iNavFlight:next-10.1from
error414:error414/feature/opendrone-fc-lite
Open

error414 wants to merge 10 commits into
iNavFlight:next-10.1from
error414:error414/feature/opendrone-fc-lite

Conversation

@error414

@error414 error414 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Basic implementation of OpenDrone FC mini (20x20)

  • opendrone FC lite mini
  • opendrone FC lite

Tested:

  • Flash firmware (uses USB mass storage, DFU command works)
  • Calibrate
  • Orientation matches
  • Gyro working
  • Accel working
  • I2C Bus
  • Blackbox
  • UART1
  • UART2
  • UART3
  • Buzzer working
  • DShot support on m1-4
  • Voltage sensor
  • Current sensor
  • LEDs working
  • PINIO1

for this PR is recomended #12237

Tested in air on 2.5 quad, have to say that it works really well

Block Used by State machines (of 4) Program memory (of 32)
PIO0 DSHOT motor outputs 4, one per motor – only with a DSHOT motor protocol 18
PIO1 UART3, UART4 (UART4 on the 30x30 only) one per direction a port uses: 2 on the Mini, up to 4 on the 30x30 13 (TX 4 + RX 9, each loaded on first use)
PIO2 – free, kept for the analog OSD 0

OPENFC_LITE_MINI (RP2350A, slices 0–7)

Slice GPIO Use
3 22, 23 motors M4, M3 – only with a PWM motor protocol
4 8 LED strip (channel A)
4 24, 25 motors M2, M1 – only with a PWM motor protocol, the LED strip then does not start
0, 1, 2, 5, 6, 7 – free

OPENFC_LITE 30x30 (RP2350B, slices 0–11)

Slice GPIO Use
3 23 LED strip (channel B)
6 28, 29 motors M4, M3 – only with a PWM motor protocol
7 30, 31 motors M2, M1 – only with a PWM motor protocol
0, 1, 2, 4, 5, 8–11 – free

With DSHOT (the default) the motors take no slice, they run on PIO0. The beeper
uses no slice, it is a plain GPIO output.

DMA (same on both boards, 16 channels)

Channels Use
1 ADC – ring buffer from the ADC FIFO
1 LED strip – only with feature LED_STRIP enabled
14 free

@qodo-code-review

Copy link
Copy Markdown
Contributor

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Add OpenFC Lite targets and extend flight-controller peripherals

✨ Enhancement 🐞 Bug fix 📝 Documentation 🧪 Tests 🕐 40+ Minutes

Grey Divider

AI Description

• Add RP2350 OpenFC Lite and Mini targets with motor, serial, sensor, SD-card, and USB support.
• Add interrupt-driven gyro reads, continuous SD blackbox logging, Smart Battery telemetry, and SITL
 lockstep.
• Report absent batteries as unknown over MAVLink and remove obsolete MSP blackbox commands.
Merge Risk 🔴 High

Blast radius 🔴 High 💥 6 capabilities

  • 6 affected capabilities span independent functional scopes: RP2350 communications integration, RP2350 firmware deployment, RP2350 flight-control output subsystem, RP2350 flight-control sensing and persistence, RP2350 removable-storage integration, RP2350 system timing and startup.
  • The changed CMake, linker, and probe configuration jointly determine whether an RP2350 firmware image can be built, laid out, and flashed; they are one deployment outcome.
  • Motor protocol generation, PWM slice allocation, output enable/disable, and ESC passthrough all determine the same end-to-end actuator-control outcome.
  • The LED strip shares hardware but is a separate user-visible output and is not claimed as a motor capability.
  • ADC and SPI sensor paths provide the end-to-end measurements consumed by flight-control and telemetry logic; they share the bounded sensing subsystem and are not separate technical capabilities for each bus hop.
  • USB VCP, hardware UARTs, and PIO UARTs are distinct delivery operations but belong to the bounded RP2350 communications integration; their shared consequence is loss or corruption of a configured communication channel, not independent deployment scopes.
  • The USB MSC protocol, SD-card block callbacks, and host-visible disk behavior form one bounded removable-storage integration across application and embedded-library components.
  • The persisted setting, startup application, watchdog marker, self-test, and status reporting jointly implement one bounded clock-configuration behavior; downstream PIO/PWM timing effects are propagation within that behavior.
Behavioral complexity 🔴 High 🧩 Concurrent ordering, Coordinated invariants

  • Before, the existing RP2350 path used simpler per-frame PIO output and did not implement this PWM/DMA ownership model.
  • After, DShot state machines, scheduler update throttling, keep-alive wrap points, PWM slice sharing, DMA pacing, and ESC passthrough ownership interact.
  • New correctness conditions are that frames are not restarted mid-transmission, keep-alive transitions occur at frame boundaries, and shared slices are not reconfigured by another output.
Potential damage 🔴 High 🩹 Critical loss

  • If the changed output timing, PIO program, slice mapping, or ownership transition regresses, motors can stop receiving valid control frames or receive incorrect timing.
  • Reverting code stops new output faults, but a flight-time output failure cannot undo the resulting vehicle state.
  • Reboot or reconfigure can restore output generation after a software-only failure; loss of control during operation is not recoverable by firmware rollback.
Assessed commit 7d2904c
Diagram

graph TD
  Targets["OpenFC targets"] --> Platform["RP2350 platform"] --> Peripherals["Board peripherals"] --> Flight["Flight controller"]
  Peripherals --> Storage[("SD card")]
  Flight --> Blackbox["Blackbox logging"] --> Storage
  Flight --> Telemetry["Telemetry outputs"]
  Peripherals --> USB["USB mass storage"] --> Storage
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Stage independent features separately
  • ➕ Isolates board bring-up from storage, telemetry, and SITL risks
  • ➕ Makes hardware validation and rollback more targeted
  • ➖ Requires coordination where shared RP2350 drivers and build definitions overlap
2. Retain polling-only gyro reads
  • ➕ Avoids new SPI arbitration and DMA ownership complexity
  • ➖ Does not eliminate blocking sensor reads or preserve every sample at sensor rate

Recommendation: The shared RP2350 drivers and target-specific pin definitions are a sensible basis for both boards. Prefer staging the independent gyro, blackbox, Smart Battery, SITL, and MAVLink changes for review and validation; retain interrupt-driven gyro reads where measured benefits justify their concurrency risk.

Files changed (116) +5628 / -364

Enhancement (38) +2653 / -111
blackbox.cContinue logging across SD file splits +36/-1

Continue logging across SD file splits

• Transitions from a full log into a new one while armed instead of stopping blackbox logging.

src/main/blackbox/blackbox.c

blackbox_io.cReclaim SD log space on wraparound +171/-3

Reclaim SD log space on wraparound

• Scans log positions, evicts a blocking log, and relocates free space before creating another log.

src/main/blackbox/blackbox_io.c

blackbox_io.hExpose log-split status +3/-0

Expose log-split status

• Declares the storage-side signal used to begin another blackbox log.

src/main/blackbox/blackbox_io.h

accgyro.cQueue interrupt-read gyro samples +33/-0

Queue interrupt-read gyro samples

• Adds bounded sample push/pop operations so the gyro task can consume completed reads in order.

src/main/drivers/accgyro/accgyro.c

accgyro.hDefine gyro sample-queue state +54/-0

Define gyro sample-queue state

• Extends gyro-device declarations with data-ready settings, queue state, and related APIs.

src/main/drivers/accgyro/accgyro.h

accgyro_data_ready.cDrive gyro reads from IMU interrupts +225/-0

Drive gyro reads from IMU interrupts

• Starts asynchronous reads on data-ready, queues samples, and falls back to polling after missing samples or queue pauses.

src/main/drivers/accgyro/accgyro_data_ready.c

accgyro_data_ready.hDeclare data-ready IMU integration +53/-0

Declare data-ready IMU integration

• Defines driver parsing descriptors and interfaces for starting, suspending, and reading data-ready samples.

src/main/drivers/accgyro/accgyro_data_ready.h

accgyro_icm42605.cSupport asynchronous ICM-426xx samples +54/-0

Support asynchronous ICM-426xx samples

• Parses combined gyro, accelerometer, and temperature reads while preserving register-read fallback.

src/main/drivers/accgyro/accgyro_icm42605.c

adc_rp2350.cMap RP2350 ADCs from board pins +78/-29

Map RP2350 ADCs from board pins

• Supports both A and B package ADC layouts and reads target-configured channels from the DMA ring.

src/main/drivers/adc_rp2350.c

bus_busdev_spi.cArbitrate normal SPI transfers +5/-0

Arbitrate normal SPI transfers

• Acquires the bus around device selection and speed changes, yielding safely to data-ready reads.

src/main/drivers/bus_busdev_spi.c

bus_spi.hExpose asynchronous SPI read API +20/-0

Expose asynchronous SPI read API

• Declares data-ready registration, requests, and bus acquisition with no-op hooks for unaffected builds.

src/main/drivers/bus_spi.h

bus_spi_data_ready.cCoordinate interrupt and main-loop SPI +188/-0

Coordinate interrupt and main-loop SPI

• Tracks pending reads, arbitrates one interrupt-driven device per bus, and disables reads after repeated timeouts.

src/main/drivers/bus_spi_data_ready.c

bus_spi_data_ready_dma.cAllocate H7 DMA for data-ready SPI +192/-0

Allocate H7 DMA for data-ready SPI

• Selects unowned streams while reserving UART assignments and manages transfer completion.

src/main/drivers/bus_spi_data_ready_dma.c

bus_spi_data_ready_impl.hDefine data-ready hardware interface +61/-0

Define data-ready hardware interface

• Declares the hardware and DMA operations used by the shared SPI arbitration layer.

src/main/drivers/bus_spi_data_ready_impl.h

bus_spi_hal_ll.cImplement H7 interrupt-driven SPI reads +169/-0

Implement H7 interrupt-driven SPI reads

• Uses SPI FIFO interrupts for short reads and DMA for longer reads, returning completed register data to the shared layer.

src/main/drivers/bus_spi_hal_ll.c

light_ws2811strip_rp2350.cSupport inverted LED-strip output +6/-0

Support inverted LED-strip output

• Applies GPIO output inversion for boards with an inverting level shifter.

src/main/drivers/light_ws2811strip_rp2350.c

pwm_output_rp2350.cAdd RP2350 DShot keep-alive +149/-44

Add RP2350 DShot keep-alive

• Reworks the PIO program to repeat stop frames during flash saves and improves motor update spacing and 4-way pin handoff.

src/main/drivers/pwm_output_rp2350.c

serial_usb_vcp_rp2350.cSeparate CDC and MSC USB modes +74/-2

Separate CDC and MSC USB modes

• Guards TinyUSB calls against timer re-entry and adds mass-storage descriptors and a distinct device identity.

src/main/drivers/serial_usb_vcp_rp2350.c

system_rp2350.cCoordinate RP2350 USB initialization +27/-3

Coordinate RP2350 USB initialization

• Runs at 150 MHz, defers USB connection in MSC mode, and avoids TinyUSB timer re-entry.

src/main/drivers/system_rp2350.c

usb_msc_rp2350.cExpose the SD card as a USB disk +224/-0

Expose the SD card as a USB disk

• Adds dedicated MSC mode with card initialization, block read/write callbacks, retries, and missing-media handling.

src/main/drivers/usb_msc_rp2350.c

cli.cAdd Smart Battery inspection command +49/-0

Add Smart Battery inspection command

• Introduces 'smartbattery [raw]' for decoded cells, temperature, source status, and retained telemetry pages.

src/main/fc/cli.c

fc_init.cStart gyro reads after initialization +4/-1

Start gyro reads after initialization

• Defers data-ready setup until other DMA users initialize and uses the shared reset path after MSC failure.

src/main/fc/fc_init.c

asyncfatfs.cEnable safe FAT freefile relocation +121/-3

Enable safe FAT freefile relocation

• Serializes directory walks, handles empty-file truncation, and adds deletion, flush-state, and relocation helpers.

src/main/io/asyncfatfs/asyncfatfs.c

asyncfatfs.hExpose FAT reclamation operations +41/-0

Expose FAT reclamation operations

• Declares directory-entry deletion, pending-write checks, freefile dimensions, and relocation.

src/main/io/asyncfatfs/asyncfatfs.h

motor_srxl2.cReceive ESC Smart Battery pages +34/-6

Receive ESC Smart Battery pages

• Uses the receiver identity expected by Avian ESCs, caches addressed pages, and invalidates stale data after link loss.

src/main/io/motor_srxl2.c

motor_srxl2.hExpose Smart Battery motor APIs +5/-0

Expose Smart Battery motor APIs

• Declares access to decoded and raw per-ESC Smart Battery telemetry.

src/main/io/motor_srxl2.h

srxl2_smart_battery.cDecode Smart Battery measurements +155/-0

Decode Smart Battery measurements

• Tracks source pages and freshness, rejects placeholder packs, and exposes valid cell voltages and temperature.

src/main/io/srxl2_smart_battery.c

srxl2_smart_battery.hDefine Smart Battery state and results +70/-0

Define Smart Battery state and results

• Adds page, source, validity, and decoded telemetry structures for SRXL2 Smart Battery data.

src/main/io/srxl2_smart_battery.h

main.cNotify SITL lockstep after each pass +3/-0

Notify SITL lockstep after each pass

• Invokes the lockstep hook after scheduler and loopback processing.

src/main/main.c

crsf.hDeclare CRSF temperature frame type +1/-0

Declare CRSF temperature frame type

• Adds the frame identifier used when forwarding Smart Battery temperature.

src/main/rx/crsf.h

scheduler.cTrack scheduler progress for lockstep +16/-1

Track scheduler progress for lockstep

• Counts SITL task executions and avoids sleeping against a simulated clock that cannot advance independently.

src/main/scheduler/scheduler.c

scheduler.hExpose SITL execution count +3/-0

Expose SITL execution count

• Declares the scheduler progress query used to decide when a RealFlight step can continue.

src/main/scheduler/scheduler.h

gyro.cConsume every queued gyro sample +76/-15

Consume every queued gyro sample

• Starts data-ready reads after initialization and applies calibration and the first low-pass filter to queued samples.

src/main/sensors/gyro.c

gyro.hDeclare gyro data-ready configuration +12/-0

Declare gyro data-ready configuration

• Adds the setting and startup interface used by the sensor and initialization paths.

src/main/sensors/gyro.h

realFlight.cSynchronize RealFlight exchanges +18/-1

Synchronize RealFlight exchanges

• Reads simulator physics timestamps, waits for due flight tasks before the next exchange, and extends lockstep timeouts.

src/main/target/SITL/sim/realFlight.c

target.cImplement SITL physics-time clock +137/-2

Implement SITL physics-time clock

• Adds optional lockstep clock synchronization and bounded scheduler-pass coordination with RealFlight.

src/main/target/SITL/target.c

target.hDeclare SITL lockstep hooks +7/-0

Declare SITL lockstep hooks

• Exposes simulator clock and scheduler coordination functions.

src/main/target/SITL/target.h

crsf.cForward Smart Battery data over CRSF +79/-0

Forward Smart Battery data over CRSF

• Schedules complete cell-voltage groups and valid pack temperatures using stable source identifiers.

src/main/telemetry/crsf.c

Bug fix (10) +114 / -34
config_eeprom.cSuspend data-ready reads during saves +5/-0

Suspend data-ready reads during saves

• Stops IMU interrupt-driven SPI activity before blocking flash writes.

src/main/config/config_eeprom.c

adc_stm32f4xx.cRegister F4 ADC DMA ownership +7/-0

Register F4 ADC DMA ownership

• Marks the ADC stream occupied so later DMA selection cannot reuse it.

src/main/drivers/adc_stm32f4xx.c

adc_stm32f7xx.cRegister F7 ADC DMA ownership +6/-0

Register F7 ADC DMA ownership

• Marks the ADC stream occupied so later DMA selection cannot reuse it.

src/main/drivers/adc_stm32f7xx.c

adc_stm32h7xx.cRegister H7 ADC DMA ownership +6/-0

Register H7 ADC DMA ownership

• Marks the ADC stream occupied before data-ready SPI selects available streams.

src/main/drivers/adc_stm32h7xx.c

bus_spi_rp2350.cClock bufferless RP2350 SPI transfers +6/-1

Clock bufferless RP2350 SPI transfers

• Sends dummy bytes when neither buffer is supplied, allowing SD-card startup clocks.

src/main/drivers/bus_spi_rp2350.c

pinio.cKeep RP2350 PINIO on GPIO +9/-0

Keep RP2350 PINIO on GPIO

• Bypasses unsupported timer-channel PWM setup on RP2350.

src/main/drivers/pinio.c

sdcard_spi.cReserve SPI for SD startup clocks +3/-0

Reserve SPI for SD startup clocks

• Acquires the SPI bus while transmitting initialization clocks without a selected device.

src/main/drivers/sdcard/sdcard_spi.c

serial_uart_rp2350.cPump RP2350 UART transmit FIFO +60/-24

Pump RP2350 UART transmit FIFO

• Fills the FIFO immediately and uses interrupts only for remaining bytes; centralizes UART dispatch.

src/main/drivers/serial_uart_rp2350.c

serial_4way.cEnable RP2350 4-way GPIO compatibility +1/-1

Enable RP2350 4-way GPIO compatibility

• Defines the reset-level compatibility constant needed by ESC passthrough on RP2350.

src/main/io/serial_4way.c

mavlink_streams.cMark absent MAVLink batteries unknown +11/-8

Mark absent MAVLink batteries unknown

• Uses unknown voltage and remaining-capacity sentinels in SYS_STATUS, BATTERY_STATUS, and HIGH_LATENCY2.

src/main/mavlink/mavlink_streams.c

Refactor (6) +63 / -70
timer_rp2350.cShare RP2350 PWM group definitions +27/-15

Share RP2350 PWM group definitions

• Clarifies repeated slice mappings across GPIO ranges and adds timer lookup by IO tag.

src/main/drivers/timer_rp2350.c

fc_msp.cRemove legacy blackbox MSP reply +0/-7

Remove legacy blackbox MSP reply

• Deletes the fixed-zero MSP_BLACKBOX_CONFIG response in favor of the MSP2 interface.

src/main/fc/fc_msp.c

msp_protocol.hRemove obsolete MSP blackbox IDs +0/-3

Remove obsolete MSP blackbox IDs

• Drops legacy command identifiers no longer served by the flight-controller MSP handler.

src/main/msp/msp_protocol.h

rp2350.hCentralize RP2350 platform definitions +32/-0

Centralize RP2350 platform definitions

• Provides shared chip and PWM slice declarations for multiple RP2350 targets.

src/main/rp2350.h

target.cRemove Pico-specific shared functions +0/-27

Remove Pico-specific shared functions

• Moves reset helpers and UART dispatch out of the Pico board definition into platform drivers.

src/main/target/RP2350_PICO/target.c

target.hUse shared RP2350 PWM declarations +4/-18

Use shared RP2350 PWM declarations

• Removes board-local PWM group declarations and explicitly maps the Pico's fourth ADC input.

src/main/target/RP2350_PICO/target.h

Tests (1) +88 / -7
mavlink_unittest.ccTest MAVLink battery presence values +88/-7

Test MAVLink battery presence values

• Covers absent, disabled, and present batteries across SYS_STATUS, BATTERY_STATUS, and HIGH_LATENCY2.

src/test/unit/mavlink_unittest.cc

Documentation (10) +179 / -90
Blackbox.mdExplain SD log wraparound +12/-0

Explain SD log wraparound

• Documents log eviction, split flights, unused space, and power-loss behavior when an SD card fills.

docs/Blackbox.md

Mavlink.mdDocument absent-battery reporting +3/-2

Document absent-battery reporting

• Clarifies that battery messages use MAVLink unknown values rather than zero readings without a battery.

docs/Mavlink.md

SITL.mdDocument RealFlight lockstep +2/-0

Document RealFlight lockstep

• Adds guidance for running SITL against simulator physics time.

docs/SITL/SITL.md

Settings.mdDocument gyro data-ready setting +12/-0

Document gyro data-ready setting

• Describes AUTO, ON, and OFF behavior and the supported IMU and interrupt-pin requirements.

docs/Settings.md

Spektrum Smart ESC.mdDocument Smart Battery telemetry +44/-2

Document Smart Battery telemetry

• Expands protocol and user guidance for Smart Battery data received from Spektrum ESCs.

docs/Spektrum Smart ESC.md

OPENFC_LITE.mdDocument OpenFC Lite hardware +94/-0

Document OpenFC Lite hardware

• Describes the 30×30 board, pinout, defaults, flashing, USB disk mode, and unsupported capabilities.

docs/boards/OPENFC_LITE.md

README.mdRemove legacy MSP blackbox documentation +2/-28

Remove legacy MSP blackbox documentation

• Drops command 80/81 descriptions and directs readers to the remaining MSP2 blackbox interface.

docs/development/msp/README.md

msp_messages.jsonRemove legacy blackbox message definitions +3/-53

Remove legacy blackbox message definitions

• Deletes obsolete MSP blackbox configuration entries from the machine-readable message specification.

docs/development/msp/msp_messages.json

config_streamer_rp2350.cDescribe variable flash placement +2/-2

Describe variable flash placement

• Updates configuration-storage comments for the target-dependent flash endpoint.

src/main/config/config_streamer_rp2350.c

io_rp2350.cDescribe RP2350B GPIO mapping +5/-3

Describe RP2350B GPIO mapping

• Extends the GPIO abstraction documentation to the B package's third logical port.

src/main/drivers/io_rp2350.c

Other (51) +2531 / -52
rp2350.cmakeParameterize RP2350 builds +70/-3

Parameterize RP2350 builds

• Adds package-variant and flash-size arguments, target definitions, SD/FAT sources, and TinyUSB MSC compilation.

cmake/rp2350.cmake

msc.hAdd TinyUSB MSC protocol definitions +382/-0

Add TinyUSB MSC protocol definitions

• Imports the mass-storage class definitions needed for RP2350 USB disk support.

lib/main/pico-sdk/lib/tinyusb/src/class/msc/msc.h

msc_device.cAdd TinyUSB MSC device class +977/-0

Add TinyUSB MSC device class

• Imports TinyUSB's mass-storage device implementation for USB/SCSI command handling.

lib/main/pico-sdk/lib/tinyusb/src/class/msc/msc_device.c

msc_device.hAdd TinyUSB MSC callback API +166/-0

Add TinyUSB MSC callback API

• Imports the device-class interface used by the RP2350 SD-card backend.

lib/main/pico-sdk/lib/tinyusb/src/class/msc/msc_device.h

CMakeLists.txtRegister shared driver sources +6/-0

Register shared driver sources

• Adds data-ready SPI and gyro files plus Smart Battery decoding to shared build sources.

src/main/CMakeLists.txt

nvic.hAssign gyro data-ready interrupt priority +2/-0

Assign gyro data-ready interrupt priority

• Adds a priority definition for IMU data-ready and associated transfer interrupts.

src/main/drivers/nvic.h

settings.yamlConfigure gyro data-ready behavior +9/-0

Configure gyro data-ready behavior

• Defines AUTO, ON, and OFF choices for supported interrupt-driven gyro reads.

src/main/fc/settings.yaml

target.cRegister both IMU interrupt pins +2/-2

Register both IMU interrupt pins

• Passes primary and secondary ICM-42605 interrupt pins to SPI device registrations.

src/main/target/BROTHERHOBBYH743/target.c

target.hDefine both IMU interrupt pins +2/-0

Define both IMU interrupt pins

• Adds board pin definitions for interrupt-driven ICM-42605 reads.

src/main/target/BROTHERHOBBYH743/target.h

target.cRegister IMU interrupt pins +5/-5

Register IMU interrupt pins

• Associates the board's IMU registrations with their wired interrupt pins.

src/main/target/DAKEFPVH743/target.c

target.hDefine DAKEFPV IMU interrupt +1/-0

Define DAKEFPV IMU interrupt

• Adds the board interrupt pin used by data-ready reads.

src/main/target/DAKEFPVH743/target.h

target.cRegister dual IMU interrupt pins +10/-10

Register dual IMU interrupt pins

• Connects both IMU-slot SPI registrations to their respective interrupt pins.

src/main/target/DAKEFPVH743PRO/target.c

target.hDefine dual IMU interrupts +2/-0

Define dual IMU interrupts

• Adds interrupt pin definitions for both sensor slots.

src/main/target/DAKEFPVH743PRO/target.h

target.cRegister IMU interrupt pins +2/-2

Register IMU interrupt pins

• Supplies wired sensor interrupt pins to board SPI device registrations.

src/main/target/FLYWOOH743PRO/target.c

target.hDefine FLYWOO IMU interrupts +2/-0

Define FLYWOO IMU interrupts

• Adds board interrupt pin definitions for gyro data-ready operation.

src/main/target/FLYWOOH743PRO/target.h

target.cRegister IMU interrupt pins +4/-4

Register IMU interrupt pins

• Associates the board's IMU devices with their data-ready pins.

src/main/target/GEPRC_TAKER_H743/target.c

target.hDefine GEPRC IMU interrupts +2/-0

Define GEPRC IMU interrupts

• Adds sensor interrupt pin mappings for data-ready operation.

src/main/target/GEPRC_TAKER_H743/target.h

target.cRegister IMU interrupt pins +2/-2

Register IMU interrupt pins

• Connects sensor SPI registrations to their board interrupt pins.

src/main/target/HAKRCH743/target.c

target.hDefine HAKRC IMU interrupts +2/-0

Define HAKRC IMU interrupts

• Adds board pin definitions for sensor data-ready signals.

src/main/target/HAKRCH743/target.h

target.hDefine conditional ICM interrupt pin +3/-0

Define conditional ICM interrupt pin

• Supplies the ICM-42605 interrupt pin for the applicable board variant.

src/main/target/IFLIGHT_BLITZ_H7_PRO/target.h

target.hDefine ICM-42605 interrupt pin +1/-0

Define ICM-42605 interrupt pin

• Maps the sensor data-ready signal to PE1.

src/main/target/KAKUTEH7/target.h

target.cRegister IMU interrupt pin +1/-1

Register IMU interrupt pin

• Uses the sensor's wired interrupt in its SPI registration.

src/main/target/MAMBAH743/target.c

target.hDefine MAMBA IMU interrupt +2/-0

Define MAMBA IMU interrupt

• Adds board interrupt pin mapping for data-ready reads.

src/main/target/MAMBAH743/target.h

target.cRegister IMU interrupt pins +3/-3

Register IMU interrupt pins

• Passes wired sensor interrupts into the relevant SPI registrations.

src/main/target/MATEKH743/target.c

target.hDefine MATEK IMU interrupts +2/-0

Define MATEK IMU interrupts

• Adds board pin mappings for IMU data-ready signals.

src/main/target/MATEKH743/target.h

CMakeLists.txtBuild the 30×30 RP2350B target +1/-0

Build the 30×30 RP2350B target

• Selects the B package, 2 MB flash, and USB MSC support.

src/main/target/OPENFC_LITE/CMakeLists.txt

config.cSet OpenFC Lite flight defaults +50/-0

Set OpenFC Lite flight defaults

• Configures a 1 kHz loop, DShot300, the VTX rail mode, and default VTX and ESC serial functions.

src/main/target/OPENFC_LITE/config.c

version.hProvide Lite Pico SDK version header +15/-0

Provide Lite Pico SDK version header

• Adds target-local SDK version definitions required by this RP2350 build.

src/main/target/OPENFC_LITE/pico/version.h

pico_sdk_config.hConfigure Lite Pico SDK +56/-0

Configure Lite Pico SDK

• Adds target-local SDK build configuration for the RP2350B board.

src/main/target/OPENFC_LITE/pico_sdk_config.h

target.cMap Lite motor outputs +44/-0

Map Lite motor outputs

• Defines four motor pads in physical output order.

src/main/target/OPENFC_LITE/target.c

target.hDefine 30×30 Lite board hardware +205/-0

Define 30×30 Lite board hardware

• Maps RP2350B SPI, IMU, SD, I2C, serial, ADC, motor, LED, PINIO, and feature defaults.

src/main/target/OPENFC_LITE/target.h

tusb_config.hConfigure Lite USB classes +46/-0

Configure Lite USB classes

• Adds board-specific TinyUSB configuration for CDC and mass-storage modes.

src/main/target/OPENFC_LITE/tusb_config.h

CMakeLists.txtBuild the Mini RP2350A target +1/-0

Build the Mini RP2350A target

• Selects the A package, 2 MB flash, and USB MSC support.

src/main/target/OPENFC_LITE_MINI/CMakeLists.txt

config.cSet Mini flight defaults +49/-0

Set Mini flight defaults

• Configures a 1 kHz loop, DShot300, the VTX rail mode, and digital VTX serial output.

src/main/target/OPENFC_LITE_MINI/config.c

version.hProvide Mini Pico SDK version header +15/-0

Provide Mini Pico SDK version header

• Adds target-local SDK version definitions required by this RP2350 build.

src/main/target/OPENFC_LITE_MINI/pico/version.h

pico_sdk_config.hConfigure Mini Pico SDK +56/-0

Configure Mini Pico SDK

• Adds target-local SDK build configuration for the RP2350A board.

src/main/target/OPENFC_LITE_MINI/pico_sdk_config.h

target.cMap Mini motor outputs +46/-0

Map Mini motor outputs

• Defines the 20×20 board's four motor pads in physical output order.

src/main/target/OPENFC_LITE_MINI/target.c

target.hDefine 20×20 Mini board hardware +200/-0

Define 20×20 Mini board hardware

• Maps RP2350A peripherals and defaults, including shared ESC/GPS serial wiring and inverted LED output.

src/main/target/OPENFC_LITE_MINI/target.h

tusb_config.hConfigure Mini USB classes +46/-0

Configure Mini USB classes

• Adds board-specific TinyUSB configuration for CDC and mass-storage modes.

src/main/target/OPENFC_LITE_MINI/tusb_config.h

target.hDefine SEQURE IMU interrupt +1/-0

Define SEQURE IMU interrupt

• Adds a sensor interrupt pin for eligible data-ready reads.

src/main/target/SEQUREH7/target.h

target.cRegister SIMPLIFLY IMU interrupt +1/-1

Register SIMPLIFLY IMU interrupt

• Supplies the sensor interrupt to its SPI device registration.

src/main/target/SIMPLIFLYH7/target.c

target.hDefine SIMPLIFLY IMU interrupt +1/-0

Define SIMPLIFLY IMU interrupt

• Adds the board sensor interrupt pin mapping.

src/main/target/SIMPLIFLYH7/target.h

target.cRegister SPEDIX IMU interrupts +2/-2

Register SPEDIX IMU interrupts

• Passes wired interrupt pins to sensor SPI registrations.

src/main/target/SPEDIXH743/target.c

target.hDefine SPEDIX IMU interrupts +2/-0

Define SPEDIX IMU interrupts

• Adds sensor interrupt pin mappings.

src/main/target/SPEDIXH743/target.h

target.cRegister LUCID IMU interrupts +6/-6

Register LUCID IMU interrupts

• Connects IMU SPI registrations to board interrupt pins.

src/main/target/TBS_LUCID_H7/target.c

target.hDefine LUCID IMU interrupts +2/-0

Define LUCID IMU interrupts

• Adds board mappings for sensor data-ready pins.

src/main/target/TBS_LUCID_H7/target.h

target.cRegister LUCID Wing IMU interrupts +6/-6

Register LUCID Wing IMU interrupts

• Connects IMU SPI registrations to board interrupt pins.

src/main/target/TBS_LUCID_H7_WING/target.c

target.hDefine LUCID Wing IMU interrupts +2/-0

Define LUCID Wing IMU interrupts

• Adds board mappings for sensor data-ready pins.

src/main/target/TBS_LUCID_H7_WING/target.h

common.hEnable data-ready SPI on STM32H7 +5/-0

Enable data-ready SPI on STM32H7

• Turns on the shared interrupt-driven SPI feature for H7 targets.

src/main/target/common.h

common_hardware.cPass common ICM interrupt pin +4/-1

Pass common ICM interrupt pin

• Uses a target-defined ICM-42605 EXTI pin when available, otherwise retaining the no-pin default.

src/main/target/common_hardware.c

rp2350_flash.ldPlace settings at target flash end +9/-4

Place settings at target flash end

• Derives firmware and configuration flash regions from per-target linker symbols instead of a fixed 4 MB layout.

src/main/target/link/rp2350_flash.ld

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (1) 📜 Skill insights (0)

Grey Divider


Action required

1. OpenFC flashing fails in configurator 🔗 Cross-repo conflict ≡ Correctness
Description
The new OPENFC_LITE and OPENFC_LITE_MINI targets use RP2350 bootloader flashing, but
inav-configurator loads release firmware as HEX and passes it to its STM32 flashing paths. When a
user tries to flash either board from the configurator, the firmware enters the RP2350 USB
bootloader instead of a device those paths can flash.
Code

src/main/target/OPENFC_LITE/CMakeLists.txt[1]

+target_rp2350(OPENFC_LITE VARIANT B FLASH_SIZE_KB 2048 COMPILE_DEFINITIONS MCU_FLASH_SIZE=2048 USE_USB_MSC)
Evidence
The added target uses RP2350; its firmware enters the RP2350 USB bootloader, for which the build
produces a UF2 artifact. The configurator filters release versions to HEX and flashes through STM32
serial or DFU instead.

inav -> inav-configurator
src/main/target/OPENFC_LITE/CMakeLists.txt[1-1]
src/main/target/OPENFC_LITE_MINI/CMakeLists.txt[1-1]
src/main/drivers/system_rp2350.c[207-212]
cmake/rp2350.cmake[464-475]
External repo: iNavFlight/inav-configurator, tabs/firmware_flasher.js [240-247]
External repo: iNavFlight/inav-configurator, tabs/firmware_flasher.js [689-699]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new OpenFC RP2350 targets cannot be flashed through the pinned configurator's HEX-to-STM32 workflow.
## Fix Focus Areas
- src/main/target/OPENFC_LITE/CMakeLists.txt[1-1]
- src/main/target/OPENFC_LITE_MINI/CMakeLists.txt[1-1]
- cmake/rp2350.cmake[464-475]
- tabs/firmware_flasher.js[240-247]
- tabs/firmware_flasher.js[689-699]
## Recommended Fix
Coordinate with inav-configurator to discover and flash RP2350 UF2 release assets through its USB mass-storage bootloader rather than the STM32 flashing paths. Ensure the UF2 artifacts are available in releases before presenting these targets as flashable there.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Malformed USB disk writes lose data 🐞 Bug ≡ Correctness
Description
tud_msc_write10_cb() writes only bufsize / 512 blocks but reports that all bufsize bytes were
consumed, while the new mass-storage class derives its block size from the host-supplied transfer
length. When a host requests a non-block-aligned transfer or a byte count inconsistent with the
command's block count, trailing write data is discarded; the corresponding read callback can also
return bytes it did not fill.
Code

src/main/drivers/usb_msc_rp2350.c[R204-209]

+    for (uint32_t i = 0; i < bufsize / MSC_BLOCK_SIZE; i++) {
+        if (!mscWriteBlock(lba + i, buffer + i * MSC_BLOCK_SIZE)) {
+            return -1;
+        }
+    }
+    return bufsize;
Evidence
The class validates the command without checking the advertised 512-byte block size against the
host's transfer length, then passes byte counts and computed offsets to the callbacks. Both RP2350
callbacks process only complete 512-byte blocks and return the original byte count, so a 513-byte
request leaves a byte unwritten or unread while reporting success.

lib/main/pico-sdk/lib/tinyusb/src/class/msc/msc_device.c[145-200]
lib/main/pico-sdk/lib/tinyusb/src/class/msc/msc_device.c[853-868]
lib/main/pico-sdk/lib/tinyusb/src/class/msc/msc_device.c[915-930]
src/main/drivers/usb_msc_rp2350.c[183-209]
src/main/drivers/usb_msc_rp2350.c[123-135]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The USB mass-storage class accepts host transfer lengths that do not match the requested number of 512-byte blocks. The RP2350 callbacks ignore partial blocks and offsets but report the entire transfer as completed, losing write data or returning unread bytes.
## Fix Focus Areas
- lib/main/pico-sdk/lib/tinyusb/src/class/msc/msc_device.c[160-200]
- src/main/drivers/usb_msc_rp2350.c[183-209]
## Recommended Fix
Reject READ10 and WRITE10 commands whose transfer length does not equal the requested block count times the advertised 512-byte block size. Ensure the callbacks reject any unsupported partial-block size or offset rather than reporting those bytes as processed.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Full SD cards now delete old flight logs 🐞 Bug ☼ Reliability
Description
blackboxSDCardBeginLog now goes through BLACKBOX_SDCARD_SCAN_FOR_OLDEST_LOG and deletes the
lowest-positioned LOG*.TXT whenever afatfs_isFull() is set or the contiguous free space is
smaller than one supercluster. No setting gates this, and it is compiled in for every USE_SDCARD
target, so on any board with a full card the next arming (or a split mid-flight) silently deletes a
past log, which could be the one from a crash the user still needs, where before logging simply
stopped.
Code

src/main/blackbox/blackbox_io.c[R551-554]

+        if ((afatfs_isFull() || afatfs_getContiguousFreeSpace() < afatfs_freeFileSuperClusterSize())
+                && !blackboxSDCard.wraparoundGaveUp) {
+            blackboxSDCard.state = BLACKBOX_SDCARD_WAITING;
+            afatfs_fopen(".", "r", blackboxOldestLogDirOpened);
Evidence
The reclaim branch runs whenever wraparoundGaveUp is false. That flag is only reset to false in
BLACKBOX_SDCARD_INITIAL, and the settings patch adds no blackbox option. blackbox.c now switches
RUNNING/PAUSED to SHUTTING_DOWN and then back to PREPARE_LOG_FILE whenever
blackboxDeviceNeedsNewLog() is true. The new docs confirm the card is treated as a ring buffer,
the oldest log is deleted, and the file switch can happen while armed.

src/main/blackbox/blackbox_io.c[548-558]
src/main/blackbox/blackbox_io.c[466-478]
docs/Blackbox.md[113-123]
src/main/fc/settings.yaml[352-360]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
SD blackbox wraparound deletes the oldest logs on every SD target with no way to turn it off. Users who relied on logging stopping when the card is full lose old logs without being told.
## Fix Focus Areas
- src/main/blackbox/blackbox_io.c[548-558]
- src/main/blackbox/blackbox.c[2509-2516]
- src/main/fc/settings.yaml[352-360]
## Recommended Fix
Add a blackbox config field, e.g. `blackbox_sdcard_wraparound` (bool, default OFF or chosen explicitly by the maintainers), to `blackboxConfig_t`, and bump the PG version if needed. Only take the reclaim branch and `blackboxDeviceNeedsNewLog()` when it is enabled. Otherwise keep the old behaviour: create the log, or stop when the device is full. Document the setting in docs/Settings.md and docs/Blackbox.md.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

4. Log number rolls over and appends to an old file 🐞 Bug ≡ Correctness
Description
blackboxCreateLogFile formats largestLogFileNumber + 1 into only five digits and opens it with
mode "as" (append + create). Now that wraparound keeps an SD card logging forever, the number keeps
growing without bound; once it passes 99999 the name wraps to LOG00000.TXT, and if that file still
exists the new flight is appended to it. That breaks the new docs' promise that numbers are never
reused.
Code

src/main/blackbox/blackbox_io.c[R555-557]

+        } else {
+            blackboxCreateLogFile();
+        }
Evidence
The filename loop writes digits only into indices 7..3, so 100000 becomes 00000. The "as" open mode
appends to an existing file. Without wraparound, the card filled up long before this mattered; the
PR makes unlimited log creation possible and documents that numbers are not reused.

src/main/blackbox/blackbox_io.c[438-461]
docs/Blackbox.md[123-123]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Log numbers above 99999 wrap to LOG00000.TXT. Because the file is opened with "as", the new flight is appended to an existing file.
## Fix Focus Areas
- src/main/blackbox/blackbox_io.c[438-461]
## Recommended Fix
When `largestLogFileNumber >= 99999`, either stop creating logs, or restart numbering from the lowest number that no file uses (found during enumeration). Use an open mode that fails on an existing file rather than appending to it.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can turn these tips off under Display > Comment parts

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

RAM / Flash usage vs. base commit 01a7aa3 — commit 7d2904c

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

Target Flash Δ RAM Δ
MATEKF405 ⚠️ -376 B (-0.05%) CCM: +508 B (+1.56%)
RAM: +1676 B (+1.61%)
MATEKF722 ⚠️ -7980 B (-1.66%) ITCM_RAM: -928 B (-7.40%)
RAM: +40 B (+0.05%)
TCM: +512 B (+2.02%)
MATEKF765 +612 B (+0.08%) DTCM_RAM: +512 B (+1.79%)
SRAM1: +88 B (+0.07%)
MATEKH743 ⚠️ +6520 B (+0.82%) D2_RAM: +256 B (+7.84%)
DTCM_RAM: +512 B (+3.95%)
ITCM_RAM: -920 B (-5.61%)
RAM: +1980 B (+1.39%)

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

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Test firmware build ready — commit 7d2904c

Download firmware for PR #12236

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

@error414
error414 changed the base branch from maintenance-10.x to next-10.1 November 15, 2026 20:00
@sensei-hacker sensei-hacker added this to the 10.1 milestone Nov 28, 2026
@sensei-hacker sensei-hacker added New target This PR adds a new target hardware needed Blocked by lack of hardware to reproduce issue labels Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hardware needed Blocked by lack of hardware to reproduce issue New target This PR adds a new target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants