Skip to content

Conversation

@dixi83
Copy link
Contributor

@dixi83 dixi83 commented Oct 31, 2025

User description

Added support for FlyingRC F4wing mini
see #11009 for more details
Test board has been shipped but, still on its way.


PR Type

Enhancement, New Target


Description

  • Add support for FlyingRC F4wing mini flight controller

  • Define timer hardware configuration for 6 servo outputs

  • Configure IMU, barometer, magnetometer, and rangefinder sensors

  • Set up UART and SoftSerial communication interfaces


Diagram Walkthrough

flowchart LR
  A["FlyingRC F4wing mini<br/>STM32F405"] --> B["Timer Hardware<br/>6 Servos + LED"]
  A --> C["SPI1 IMU<br/>ICM42605"]
  A --> D["I2C Sensors<br/>Baro/Mag/Range"]
  A --> E["UART/SoftSerial<br/>6 Ports"]
  A --> F["ADC VBAT<br/>Current Meter"]
Loading

File Walkthrough

Relevant files
Configuration changes
target.h
Board hardware and peripheral configuration                           

src/main/target/FLYINGRCF4WINGMINI/target.h

  • Define board identifier and LED pins for status indication
  • Configure SPI1 for ICM42605 IMU with CW90_DEG_FLIP alignment
  • Set up I2C1 for barometer, magnetometer, rangefinder, and pitot
    sensors
  • Define 6 UART ports and SoftSerial1 for communication
  • Configure ADC for battery voltage monitoring and current measurement
  • Enable features: OSD, telemetry, current meter, blackbox, and 4-way
    ESC interface
+112/-0 
target.c
Timer hardware definitions and servo mapping                         

src/main/target/FLYINGRCF4WINGMINI/target.c

  • Define timer hardware array with 8 timer configurations
  • Map TIM8 channels to S1/S2 servo outputs on PC9/PC8
  • Map TIM1 channels to S3/S4 servo outputs on PB15/PA8
  • Map TIM2 channels to S5/S6 servo outputs on PB11/PB10
  • Configure TIM3 and TIM5 for LED and SoftSerial functionality
+42/-0   
config.c
Target configuration function stub                                             

src/main/target/FLYINGRCF4WINGMINI/config.c

  • Create empty targetConfiguration function for board-specific setup
  • Include necessary headers for platform, MSP box, config, and piniobox
+27/-0   
CMakeLists.txt
CMake build configuration for target                                         

src/main/target/FLYINGRCF4WINGMINI/CMakeLists.txt

  • Define CMake build configuration for STM32F405XG microcontroller
  • Register FLYINGRCF4WINGMINI as a valid build target
+1/-0     

@qodo-merge-pro
Copy link
Contributor

qodo-merge-pro bot commented Oct 31, 2025

PR Compliance Guide 🔍

All compliance sections have been disabled in the configurations.

@qodo-merge-pro
Copy link
Contributor

qodo-merge-pro bot commented Oct 31, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Resolve critical pin resource conflicts

Resolve the resource conflict on pin PA2, which is simultaneously configured for
UART2_TX, SOFTSERIAL_1_TX, and SOFTSERIAL_1_RX, by removing or reassigning the
conflicting peripherals.

src/main/target/FLYINGRCF4WINGMINI/target.h [69-83]

-#define USE_UART2
-#define UART2_TX_PIN            PA2
-#define UART2_RX_PIN            PA3
-
 #define USE_UART4
 ...
 #define UART5_RX_PIN            PD2
 
 #define USE_SOFTSERIAL1
-#define SOFTSERIAL_1_TX_PIN      PA2
-#define SOFTSERIAL_1_RX_PIN      PA2
+// Softserial TX is on PA2, using TIM5_CH3 as defined in target.c
+// Softserial RX pin needs to be defined on a free pin if used.
+#define SOFTSERIAL_1_TX_PIN      PB0 // Example: Use a free pin
+#define SOFTSERIAL_1_RX_PIN      PB1 // Example: Use a free pin

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 9

__

Why: The suggestion correctly identifies a critical pin resource conflict on PA2, which is assigned to UART2_TX, SOFTSERIAL_1_TX, and SOFTSERIAL_1_RX, preventing these peripherals from functioning correctly.

High
Fix SoftSerial TX/RX pin assignment

Assign SOFTSERIAL_1_RX_PIN to a different pin, as it is currently incorrectly
assigned to the same pin PA2 as SOFTSERIAL_1_TX_PIN.

src/main/target/FLYINGRCF4WINGMINI/target.h [81-83]

 #define USE_SOFTSERIAL1
 #define SOFTSERIAL_1_TX_PIN      PA2
-#define SOFTSERIAL_1_RX_PIN      PA2
+#define SOFTSERIAL_1_RX_PIN      PB0 // Example: Assign to an unused pin
  • Apply / Chat
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies that SOFTSERIAL_1_TX_PIN and SOFTSERIAL_1_RX_PIN are assigned to the same pin PA2, which would make softserial non-functional.

Medium
Correct timer usage for SoftSerial

In the timer definition for TIM5, change the usage from TIM_USE_ANY to the more
specific TIM_USE_SOFTSERIAL to correctly configure it for the softserial driver.

src/main/target/FLYINGRCF4WINGMINI/target.c [39]

-DEF_TIM(TIM5,  CH3,  PA2,  TIM_use_ANY,    0, 0), //TX2  softserial1_Tx
+DEF_TIM(TIM5,  CH3,  PA2,  TIM_USE_SOFTSERIAL,    0, 0), //TX2  softserial1_Tx

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 7

__

Why: The suggestion correctly points out that TIM_USE_SOFTSERIAL is more appropriate than TIM_USE_ANY for a timer intended for softserial, improving configuration clarity and correctness.

Medium
  • Update

@dixi83 dixi83 changed the title Target: FlyingRC F4wing mini New target: FlyingRC F4wing mini Oct 31, 2025
@MrD-RC
Copy link
Member

MrD-RC commented Nov 16, 2025

You will need to update your branch from the current master for this build to compile.

As this is a new board, it will need to comply with the New Hardware Policy to be added to the main branch.

I also thing that this target should come with a warning. It is extremely cheap, so is made with low quality components. It is also lacking a lot of basic feature found on modern "wing" FCs. This should only be used on a park flyer, going no further than LOS distances.

To be honest, I'm of two minds whether this target should be added at all. As I question the quality and reliability of the hardware. Which is a safety concern.

@MrD-RC MrD-RC added Don't merge hardware needed Blocked by lack of hardware to reproduce issue labels Nov 16, 2025
@dixi83
Copy link
Contributor Author

dixi83 commented Nov 19, 2025

You will need to update your branch from the current master for this build to complete.

As this is a new board, it will need to comply with the New Hardware Policy to be added to the main branch.

Not sure what you want me to do here.

  • the board is send and as far as I can see, picked up from the post office by @DzikuVx .

I also thing that this target should come with a warning. It is extremely cheap, so is made with low quality components. It is also lacking a lot of basic feature found on modern "wing" FCs. This should only be used on a park flyer, going no further than LOS distances.

To be honest, I'm of two minds whether this target should be added at all. As I question the quality and reliability of the hardware. Which is a safety concern.

I totally agree with the warning!

  • There are boards reported with potential issues, the boards I have (and had) had only 1 issue. The lack of power on the 4v5 pins for the GPS. small GPSes had no issue, bigger ones where not seeing any satellites.

@DzikuVx DzikuVx removed Don't merge hardware needed Blocked by lack of hardware to reproduce issue labels Nov 20, 2025
@DzikuVx DzikuVx added this to the 9.0 milestone Nov 20, 2025
@DzikuVx DzikuVx merged commit 8437209 into iNavFlight:master Nov 20, 2025
21 checks passed
@MrD-RC
Copy link
Member

MrD-RC commented Nov 22, 2025

I really think this target should have been discussed before merging. The hardware seems unreliable. There are even comments about things not working in the threads on here.

From a safety standpoint point. I think it should have been discussed before merging.

@sensei-hacker
Copy link
Member

sensei-hacker commented Nov 22, 2025

Hear where you're coming from, Mr D.
On one hand, people want support because it's the only wing board that small and because it's cheap.

On the other hand, it doesn't seem like the most stable, reliable manufacturer.

I probably wouldn't recommended this board other than maybe for sub 250 or smaller builds. What's the line between recommending and having it available? I wouldn't recommend a certain V3 board either.

I wouldn't mind naming the target FLYRCF4WING_NOT_RECOMMENDED or something. :)

@MrD-RC
Copy link
Member

MrD-RC commented Nov 25, 2025

IMHO, cheap should not be a consideration for the thing keeping your aircraft in the air. Especially when its saving $20 on an FC when people are willing to spend $120+ on a video system. FC, RX, and servos should be given cost priorities over the video link.

Renaming the target seems like a good option. Also adding a document in the targets folder. It would be nice if these can be brought in to configurator on flashing at some point.

@MrD-RC
Copy link
Member

MrD-RC commented Nov 25, 2025

I also noticed that SoftSerial has been added. But there is no physical connection for it on the FC. PA2 does not appear to be broken out.

@Flying-RC
Copy link

IMHO, cheap should not be a consideration for the thing keeping your aircraft in the air. Especially when its saving $20 on an FC when people are willing to spend $120+ on a video system. FC, RX, and servos should be given cost priorities over the video link.

Renaming the target seems like a good option. Also adding a document in the targets folder. It would be nice if these can be brought in to configurator on flashing at some point.

Do not worry to much about the stability of the FC. Most people who found that the fc did not work is because the fc comes in with AP firmware flashed. And when they try to flash matek f405 te inav into the fc, it will NOT boot correctly. This is because the fc does not have an osd chip, and INAV will not boot when an osd chip is added in firmware compilation but not detected in hardware. So, its really just software issues.
Thanks for the consideration regarding the stability. Perhaps you could be reassured by that fact that this fc has already been sold for more than 5000pcs, without any report of stability issues. 🎄◟(˶> ᎑ <˶)◞🎄

@dixi83 dixi83 deleted the FlyingRC_F4WingMini branch November 26, 2025 06:52
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