Skip to content

SOLOGOODF722 target#11394

Draft
valeriyc wants to merge 1 commit intoiNavFlight:maintenance-9.xfrom
valeriyc:sologoodf722
Draft

SOLOGOODF722 target#11394
valeriyc wants to merge 1 commit intoiNavFlight:maintenance-9.xfrom
valeriyc:sologoodf722

Conversation

@valeriyc
Copy link

@valeriyc valeriyc commented Mar 3, 2026

Summary

Added Sologood F722 target.

Changes

src/main/target/SOLOGOODF722/CMakeLists.txt
src/main/target/SOLOGOODF722/target.h
src/main/target/SOLOGOODF722/target.c

Notes

Tested UART1 (Walksnail Avatar OSD), UART2 (RX), UART6 and SPI (gps+magnitometer), S1-S6 (by spinning 4 motors, 2 servos), Gyroscope, Accelerometer, Barometer.

Used betaflight timers configuration:

# timer  
timer C08 AF3  
# pin C08: TIM8 CH3 (AF3)  
timer C09 AF3  
# pin C09: TIM8 CH4 (AF3)  
timer A08 AF1  
# pin A08: TIM1 CH1 (AF1)  
timer A09 AF1  
# pin A09: TIM1 CH2 (AF1)  
timer B00 AF2  
# pin B00: TIM3 CH3 (AF2)  
timer B01 AF2  
# pin B01: TIM3 CH4 (AF2)  
timer A10 AF1  
# pin A10: TIM1 CH3 (AF1)  
timer B04 AF2  
# pin B04: TIM3 CH1 (AF2)  
timer B03 AF1  
# pin B03: TIM2 CH2 (AF1)

Betaflight resources:

# resource  
resource BEEPER 1 C13  
resource MOTOR 1 C08  
resource MOTOR 2 C09  
resource MOTOR 3 A08  
resource MOTOR 4 A09  
resource MOTOR 5 B00  
resource MOTOR 6 B01  
resource MOTOR 7 A10  
resource MOTOR 8 B04  
resource LED_STRIP 1 B03  
resource SERIAL_TX 1 B06  
resource SERIAL_TX 2 A02  
resource SERIAL_TX 3 B10  
resource SERIAL_TX 4 A00  
resource SERIAL_TX 5 C12  
resource SERIAL_TX 6 C06  
resource SERIAL_RX 1 B07  
resource SERIAL_RX 2 A03  
resource SERIAL_RX 3 B11  
resource SERIAL_RX 4 A01  
resource SERIAL_RX 5 D02  
resource SERIAL_RX 6 C07  
resource I2C_SCL 1 B08  
resource I2C_SDA 1 B09  
resource LED 1 C15  
resource SPI_SCK 1 A05  
resource SPI_SCK 2 B13  
resource SPI_SCK 3 C10  
resource SPI_SDI 1 A06  
resource SPI_SDI 2 B14  
resource SPI_SDI 3 C11  
resource SPI_SDO 1 A07  
resource SPI_SDO 2 B15  
resource SPI_SDO 3 B05  
resource ADC_BATT 1 C01  
resource ADC_CURR 1 C03  
resource PINIO 1 C02  
resource PINIO 2 C00  
resource FLASH_CS 1 A15  
resource OSD_CS 1 B12  
resource GYRO_EXTI 1 C04  
resource GYRO_CS 1 A04

@github-actions
Copy link

github-actions bot commented Mar 3, 2026

Branch Targeting Suggestion

You've targeted the master branch with this PR. Please consider if a version branch might be more appropriate:

  • maintenance-9.x - If your change is backward-compatible and won't create compatibility issues between INAV firmware and Configurator 9.x versions. This will allow your PR to be included in the next 9.x release.

  • maintenance-10.x - If your change introduces compatibility requirements between firmware and configurator that would break 9.x compatibility. This is for PRs which will be included in INAV 10.x

If master is the correct target for this change, no action is needed.


This is an automated suggestion to help route contributions to the appropriate branch.

@qodo-code-review
Copy link
Contributor

Review Summary by Qodo

Add SOLOGOODF722 flight controller target support

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add SOLOGOODF722 flight controller target with STM32F722 MCU
• Configure 8 PWM outputs with timer hardware definitions
• Support multiple IMU sensors (MPU6000, BMI270, ICM42605)
• Enable OSD, barometer, magnetometer, and rangefinder support
• Configure 6 UART ports with CRSF receiver default
Diagram
flowchart LR
  A["SOLOGOODF722 Target"] --> B["STM32F722 MCU"]
  A --> C["Timer Hardware"]
  A --> D["Sensors & Peripherals"]
  C --> E["8 PWM Outputs"]
  D --> F["IMU: MPU6000/BMI270/ICM42605"]
  D --> G["OSD, Baro, Mag, Rangefinder"]
  D --> H["6 UART Ports"]
  D --> I["SPI Flash & ADC"]
Loading

Grey Divider

File Changes

1. src/main/target/SOLOGOODF722/target.h ⚙️ Configuration changes +177/-0

Board configuration and peripheral definitions

• Define board identifier "SGF7" and USB product string
• Configure SPI1 for gyro/accelerometer with support for MPU6000, BMI270, and ICM42605
• Setup I2C1 for barometer (DPS310), magnetometer, and rangefinder
• Configure SPI2 for MAX7456 OSD and SPI3 for M25P16 flash storage
• Define 6 UART ports (UART1-6) with CRSF receiver on UART2
• Setup ADC for voltage and current monitoring
• Configure LED strip on PB3 and PINIO pins for additional control

src/main/target/SOLOGOODF722/target.h


2. src/main/target/SOLOGOODF722/target.c ⚙️ Configuration changes +40/-0

Timer hardware and PWM output configuration

• Define timer hardware array with 8 PWM output channels
• Map TIM8, TIM1, TIM3 for servo outputs (S1-S8)
• Configure TIM2 for WS2812 LED strip control
• Calculate timer hardware count dynamically

src/main/target/SOLOGOODF722/target.c


3. src/main/target/SOLOGOODF722/CMakeLists.txt ⚙️ Configuration changes +1/-0

Build system configuration for target

• Add CMake build configuration for SOLOGOODF722 target
• Specify STM32F722XE MCU variant

src/main/target/SOLOGOODF722/CMakeLists.txt


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Mar 3, 2026

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Duplicate macro defines 🐞 Bug ⛯ Reliability
Description
target.h redefines MAX_PWM_OUTPUT_PORTS, USE_DSHOT, and USE_ESC_SENSOR. This is error-prone and can
fail builds under WARNINGS_AS_ERRORS due to macro redefinition warnings.
Code

src/main/target/SOLOGOODF722/target.h[R161-177]

+#define MAX_PWM_OUTPUT_PORTS 8
+#define USE_SERIAL_4WAY_BLHELI_INTERFACE
+#define USE_DSHOT
+#define USE_ESC_SENSOR
+#define CURRENT_METER_SCALE 250
+
+#define TARGET_IO_PORTA         0xffff
+#define TARGET_IO_PORTB         0xffff
+#define TARGET_IO_PORTC         0xffff
+#define TARGET_IO_PORTD         0xffff
+#define TARGET_IO_PORTE         0xffff
+#define TARGET_IO_PORTF         0xffff
+
+#define MAX_PWM_OUTPUT_PORTS        8
+
+#define USE_DSHOT
+#define USE_ESC_SENSOR
Evidence
SOLOGOODF722/target.h contains duplicated #define blocks for the same macros. The build system can
promote warnings to errors via -Werror, making macro-redefinition warnings fatal in some
toolchains/configurations.

src/main/target/SOLOGOODF722/target.h[161-177]
cmake/stm32.cmake[250-253]

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

## Issue description
`src/main/target/SOLOGOODF722/target.h` contains duplicated macro definitions (`MAX_PWM_OUTPUT_PORTS`, `USE_DSHOT`, `USE_ESC_SENSOR`). This is easy to miss during edits and may break builds when warnings are treated as errors.

## Issue Context
The file currently defines these macros twice in the same header.

## Fix Focus Areas
- src/main/target/SOLOGOODF722/target.h[161-177]

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



Remediation recommended

2. Overbroad IO port masks 🐞 Bug ➹ Performance
Description
TARGET_IO_PORTD/E/F are set to 0xffff even though this target header doesn’t reference any PE*/PF*
pins and only references PD2. This inflates DEFIO_IO_USED_COUNT, increasing RAM used by ioRecs[] and
work done in IOInitGlobal().
Code

src/main/target/SOLOGOODF722/target.h[R167-173]

+#define TARGET_IO_PORTA         0xffff
+#define TARGET_IO_PORTB         0xffff
+#define TARGET_IO_PORTC         0xffff
+#define TARGET_IO_PORTD         0xffff
+#define TARGET_IO_PORTE         0xffff
+#define TARGET_IO_PORTF         0xffff
+
Evidence
The IO system sizes ioRecs[] based on the bitcounts of TARGET_IO_PORT* masks and iterates over
every set bit at boot in IOInitGlobal(). Defining full 16-bit masks for unused ports therefore
increases RAM and boot-time init. Other F722 targets commonly constrain these masks (example:
FLASHHOBBYF722 only marks PD2 on port D).

src/main/target/SOLOGOODF722/target.h[167-172]
src/main/drivers/io_def_generated.h[9-61]
src/main/drivers/io_def_generated.h[1404-1405]
src/main/drivers/io.c[420-441]
src/main/drivers/io_impl.h[21-27]
src/main/drivers/resource.h[22-58]
src/main/target/FLASHHOBBYF722/target.h[154-158]

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

## Issue description
`SOLOGOODF722/target.h` marks *all* pins on ports D/E/F as used (`0xffff`). This increases `DEFIO_IO_USED_COUNT`, inflates the `ioRecs[]` table in RAM, and increases work in `IOInitGlobal()`.

## Issue Context
From the target header, this board configuration does not reference any `PE*`/`PF*` pins, and appears to only use `PD2` for UART5 RX.

## Fix Focus Areas
- src/main/target/SOLOGOODF722/target.h[167-172]

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


3. Ambiguous gyro EXTI note 🐞 Bug ⛯ Reliability
Description
A committed comment states the author doesn’t know how to map GYRO_EXTI. Leaving this in the target
definition makes the hardware mapping ambiguous for future maintainers.
Code

src/main/target/SOLOGOODF722/target.h[R54-55]

+//resource GYRO_EXTI 1 C04   - donno how to map here!
+
Evidence
The target header includes an unresolved note about gyro EXTI mapping; this is effectively an
in-repo TODO without actionable information.

src/main/target/SOLOGOODF722/target.h[54-55]

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

## Issue description
There is an unresolved/uncertain hardware mapping comment in the target header regarding gyro EXTI.

## Issue Context
Even if gyro EXTI isn’t required for this target, the current wording creates ambiguity and looks like incomplete work.

## Fix Focus Areas
- src/main/target/SOLOGOODF722/target.h[54-55]

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


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@valeriyc valeriyc changed the base branch from master to maintenance-9.x March 3, 2026 23:25
Comment on lines +161 to +177
#define MAX_PWM_OUTPUT_PORTS 8
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
#define USE_DSHOT
#define USE_ESC_SENSOR
#define CURRENT_METER_SCALE 250

#define TARGET_IO_PORTA 0xffff
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD 0xffff
#define TARGET_IO_PORTE 0xffff
#define TARGET_IO_PORTF 0xffff

#define MAX_PWM_OUTPUT_PORTS 8

#define USE_DSHOT
#define USE_ESC_SENSOR
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Duplicate macro defines 🐞 Bug ⛯ Reliability

target.h redefines MAX_PWM_OUTPUT_PORTS, USE_DSHOT, and USE_ESC_SENSOR. This is error-prone and can
fail builds under WARNINGS_AS_ERRORS due to macro redefinition warnings.
Agent Prompt
## Issue description
`src/main/target/SOLOGOODF722/target.h` contains duplicated macro definitions (`MAX_PWM_OUTPUT_PORTS`, `USE_DSHOT`, `USE_ESC_SENSOR`). This is easy to miss during edits and may break builds when warnings are treated as errors.

## Issue Context
The file currently defines these macros twice in the same header.

## Fix Focus Areas
- src/main/target/SOLOGOODF722/target.h[161-177]

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@valeriyc valeriyc force-pushed the sologoodf722 branch 2 times, most recently from eab90dd to 4f29a1c Compare March 3, 2026 23:52
@valeriyc valeriyc marked this pull request as draft March 3, 2026 23:54
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