Add custom targets for BOTWINGF405 and BOTWINGF722 flight controllers
This pull request adds support for two custom flight controller targets:
- BOTWINGF405 – based on STM32F405 MCU
- BOTWINGF722 – based on STM32F722 MCU
Key Features:
- IMU: ICM42688P over SPI
- Barometer: DPS310 via I2C
- Verified compatibility with INAV Configurator(8.0.0)
Validation:
- All sensors and outputs tested and verified using INAV(version 8.0.0) build system
- Board boots correctly with full initialization.
F405
- [x] Samples received
- [x] Flash firmware
- [x] Calibrate
- [x] Orientation matches
- [x] Gyro working
- [x] Accel working
- [x] Baro working
- [x] Voltage correct
- [x] Current correct
- [ ] Analog RSSI - This is the correct pin. I may have an error in my testing
- [x] Mag I2C Bus
- [x] UART1
- [x] UART2
- [x] UART3
- [x] UART4
- [x] UART5
- [x] UART6
- [x] LEDs working
- [x] Buzzer working
- [x] Motor outputs
- [x] DShot support on m1-4
- [x] Blackbox
- [x] Analog Camera working
- [x] Video Out working
- [x] OSD working
- [x] PINIO1
- [x] PINIO2
F722
- [x] Samples received
- [x] Flash firmware
- [x] Calibrate
- [x] Orientation matches
- [x] Gyro working
- [x] Accel working
- [x] Baro working
- [x] Voltage correct
- [ ] Current correct
- [x] Analog RSSI
- [x] Mag I2C Bus
- [x] UART1
- [x] UART2
- [x] UART3
- [x] UART4
- [x] UART6
- [x] LEDs working
- [x] Buzzer working
- [x] Motor outputs
- [x] DShot support on m1-4
- [x] Servo outputs (if MAX_PWM_OUTPUT_PORTS is increased)
- [x] Blackbox
- [x] Analog Camera working
- [x] Video Out working
- [x] OSD working
- [ ] PINIO1
- [ ] PINIO2
Thanks for the PR!
On the F405, the ADC defintions at the moment are: #define ADC_CHANNEL_1_PIN PC1 #define ADC_CHANNEL_2_PIN PC2
#define VBAT_ADC_CHANNEL ADC_CHN_1 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
In my testing, it appears PC2 is the one labled for RSSI. So RSSI_ADC_CHANNEL should be defined as ADC_CHN_2 (PC2(
#define VBAT_ADC_CHANNEL should then be defined as whichever pin goes to the pad labeled for current?
The voltage scale looks a little off in my testing. We might want soemthing like: #define VBAT_SCALE_DEFAULT 1420
On the F405, target.c contains:
#ifdef SPEEDYBEEF405MINI_6OUTPUTS
#define MAX_PWM_OUTPUT_PORTS 6
#else
#define MAX_PWM_OUTPUT_PORTS 4
#endif
Can we please remove the reference to SPEEDYBEEF405MINI_6OUTPUTS. Also the commented line in target.c
Also, we see UART1 defined to use:
#define UART1_TX_PIN PB6
#define UART1_RX_PIN PB7
But that same pin is defined as S5:
DEF_TIM(TIM4, CH2, PB7, TIM_USE_OUTPUT_AUTO, 0, 0), // S5
It looks like the pin as actually connected to the UART1_RX pad, so the define for S5 should be removed?
On the F405, I see there is a PIO available for the user -- that's great!
That probably needs to be added in config.c, where you already have the other PINIO:
pinioBoxConfigMutable()->permanentId[1] = BOX_PERMANENT_ID_USER2;
PS - thanks for using a more robust switch / button for DFU boot. That's much nicer than some of the other boards. :)
on the F722:
- #define USE_FLASH_W25Q128FV
- #define W25Q128FV_CS_PIN SPI1_NSS_PINAdd commentMore actions
- #define W25Q128FV_SPI_BUS BUS_SPI1
-
+ #define USE_FLASH_M25P16
+ #define M25P16_CS_PIN SPI1_NSS_PIN
+ #define M25P16_SPI_BUS BUS_SPI1
By the way, I could have handed you most of the changes as a pull request, if your new target was in a branch, rather than in master.
On the F722:
#define MAX_PWM_OUTPUT_PORTS 4 Shouldn't this be 6?
TIM_USE_MOTOR and TIM_USE_SERVO should probably be TIM_USE_AUTO
DSHOT_BITBANG_AUTO can be removed. INAV doesn't bit-bang Dshot because the MCU is busy doing navigation, ADSB, radar, etc.
Thanks!
It seems there was some communication difficulty, so I just sent over the updates as a pull request into your branch: https://github.com/PrateekShanker99/inav_custon_target/pull/1
I see on the F722 you have PINIO1_PIN and PINIO2_PIN defined. What do those do, please?
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
| Security Compliance | |
| ⚪ | Unsafe array indexingDescription: Direct indexing into serial port array using findSerialPortIndexByIdentifier without Referred Code
|
Unsafe array indexingDescription: Direct indexing into serial port array using findSerialPortIndexByIdentifier without Referred Code
| |
| Ticket Compliance | |
| ⚪ | 🎫 No ticket provided
|
| Codebase Duplication Compliance | |
| ⚪ | Codebase context is not definedFollow the guide to enable codebase context checks. |
| Custom Compliance | |
| ⚪ | No custom compliance providedFollow the guide to enable custom compliance check. |
| |
Compliance status legend
🟢 - Fully Compliant🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label
PR Code Suggestions ✨
Explore these optional code suggestions:
| Category | Suggestion | Impact |
| High-level |
Assign unique board identifiersThe suggestion points out that both new targets, Examples:src/main/target/BOTWINGF405/target.h [4]
src/main/target/BOTWINGF722/target.h [2]
Solution Walkthrough:Before:
After:
Suggestion importance[1-10]: 10__ Why: This suggestion correctly identifies a critical issue where both new targets share the same | High |
| Possible issue |
✅
| Medium |
Prevent potential out-of-bounds array accessAdd checks for the return value of src/main/target/BOTWINGF405/config.c [15-18]
Suggestion importance[1-10]: 5__ Why: The suggestion correctly identifies a potential out-of-bounds access, which is a valid defensive programming practice, but the risk is low in this target-specific configuration file where the ports are guaranteed to exist. | Low | |
| General |
✅
| Low |
| ||
I can merge this and it will be done as soon as someone clicks the merge here to accept my changes it:
https://github.com/PrateekShanker99/inav_custon_target/pull/1