Skip to content

Conversation

@LYNHQQ
Copy link
Contributor

@LYNHQQ LYNHQQ commented Jul 8, 2025

User description

add target hummingbird fc305


PR Type

Enhancement


Description

  • Add complete target support for HUMMINGBIRD_FC305 flight controller

  • Configure ICM42605 IMU, SPL06 barometer, and MAX7456 OSD

  • Set up 6 UART ports with CRSF receiver on UART6

  • Enable SD card logging and LED strip support


Changes diagram

flowchart LR
  A["New Target"] --> B["Hardware Config"]
  B --> C["SPI Devices"]
  B --> D["I2C Sensors"]
  B --> E["UART Ports"]
  C --> F["ICM42605 IMU"]
  C --> G["MAX7456 OSD"]
  C --> H["SD Card"]
  D --> I["SPL06 Baro"]
  E --> J["CRSF RX"]
Loading

Changes walkthrough 📝

Relevant files
Configuration changes
target.h
Main target hardware configuration definitions                     

src/main/target/HUMMINGBIRD_FC305/target.h

  • Define board identifier and USB product string
  • Configure SPI buses for IMU, OSD, and SD card
  • Set up I2C bus for barometer and magnetometer
  • Define 6 UART ports with CRSF receiver configuration
  • Enable LED strip, ADC channels, and default features
  • +163/-0 
    target.c
    Hardware device registration and timer setup                         

    src/main/target/HUMMINGBIRD_FC305/target.c

  • Register SPI devices for ICM42605 IMU, SD card, MAX7456 OSD
  • Register I2C device for SPL06 barometer
  • Define timer hardware for 4 motor outputs and LED strip
  • +41/-0   
    config.c
    Target-specific default configuration settings                     

    src/main/target/HUMMINGBIRD_FC305/config.c

  • Set SPL06 as default barometer hardware
  • Configure UART4 for ESC serial communication
  • Set up PINIO box for permanent user control
  • +33/-0   
    CMakeLists.txt
    CMake build configuration                                                               

    src/main/target/HUMMINGBIRD_FC305/CMakeLists.txt

    • Add CMake target definition for STM32F722XE processor
    +2/-0     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • @qodo-merge-pro
    Copy link

    qodo-merge-pro bot commented Jul 8, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Device Mismatch

    The ICM42605 device is registered with variable name busdev_icm42688 which suggests ICM42688 hardware, but the device type is DEVHW_ICM42605. This naming inconsistency could lead to confusion during maintenance.

    BUSDEV_REGISTER_SPI_TAG(busdev_icm42688, DEVHW_ICM42605, ICM42605_SPI_BUS, ICM42605_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN);
    BUSDEV_REGISTER_SPI(busdev_sdcard_spi,  DEVHW_SDCARD,       SDCARD_SPI_BUS,     SDCARD_CS_PIN,      NONE,           DEVFLAGS_SPI_MODE_0,  0);
    Duplicate Definition

    USE_OSD is defined twice in the file, once at line 81 and again at line 161. This redundant definition should be removed to avoid potential compilation issues.

    #define USE_OSD
    #define USE_DSHOT

    @qodo-merge-pro
    Copy link

    qodo-merge-pro bot commented Jul 8, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Fix device name inconsistency

    The variable name busdev_icm42688 doesn't match the device type DEVHW_ICM42605.
    This inconsistency could cause confusion and potential issues when referencing
    the device.

    src/main/target/HUMMINGBIRD_FC305/target.c [27]

    -BUSDEV_REGISTER_SPI_TAG(busdev_icm42688, DEVHW_ICM42605, ICM42605_SPI_BUS, ICM42605_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN);
    +BUSDEV_REGISTER_SPI_TAG(busdev_icm42605, DEVHW_ICM42605, ICM42605_SPI_BUS, ICM42605_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN);
    • Apply / Chat
    Suggestion importance[1-10]: 7

    __

    Why: The suggestion correctly identifies a naming inconsistency between the registered device busdev_icm42688 and its type DEVHW_ICM42605, improving code clarity and preventing potential future bugs.

    Medium
    Remove duplicate macro definition
    Suggestion Impact:The commit removed the duplicate USE_OSD macro definition as suggested, eliminating the redundant definition

    code diff:

    -#define USE_OSD

    The USE_OSD macro is defined twice in the file. This duplication is unnecessary
    and could lead to preprocessor warnings or confusion during compilation.

    src/main/target/HUMMINGBIRD_FC305/target.h [81-161]

     #define USE_OSD
     #define USE_MAX7456
    -MAX7456_SPI_BUS		    BUS_SPI3
    +#define MAX7456_SPI_BUS		    BUS_SPI3
     #define MAX7456_CS_PIN          PC13
    -...
    -#define USE_OSD

    [To ensure code accuracy, apply this suggestion manually]

    Suggestion importance[1-10]: 4

    __

    Why: The suggestion correctly identifies that the USE_OSD macro is defined twice (lines 81 and 161), and removing the redundant definition improves code quality.

    Low
    Fix inconsistent indentation formatting

    The line contains mixed tabs and spaces for indentation, which can cause
    formatting inconsistencies. Use consistent spacing to match the surrounding code
    style.

    src/main/target/HUMMINGBIRD_FC305/target.h [83]

    -#define MAX7456_SPI_BUS		    BUS_SPI3
    +#define MAX7456_SPI_BUS         BUS_SPI3
    • Apply / Chat
    Suggestion importance[1-10]: 3

    __

    Why: The suggestion correctly points out inconsistent use of tabs and spaces for alignment on line 83, and fixing it improves code style and readability.

    Low
    • Update

    @sensei-hacker sensei-hacker added the New target This PR adds a new target label Jul 8, 2025
    @sensei-hacker
    Copy link
    Collaborator

    sensei-hacker commented Aug 30, 2025

    • Samples received
    • Flash firmware
    • Calibrate
    • Orientation matches
    • Gyro working
    • Accel working
    • Baro working
    • UART1
    • UART2
    • UART3
    • UART4
    • UART5
    • UART6 (onboard elrs)
    • Analog Camera working
    • Video Out working
    • OSD working
    • LEDs working
    • Buzzer working
    • DShot support on m1-4 ( see HUMMINGBIRD_FC305 motor order newbeedrone/inav#1 )
    • Additional motor / servo outputs (none)
    • Blackbox
    • RSSI (none)
    • Voltage
    • Current
    • I2C Bus
    • PINIO1

    @sensei-hacker
    Copy link
    Collaborator

    In testing, the OSD does not seem to function for me. I see the board does not have the standard MAX7456 chip?

    @sensei-hacker
    Copy link
    Collaborator

    For the motor order to match the silkscreen, please see:
    newbeedrone#1

    @LYNHQQ
    Copy link
    Contributor Author

    LYNHQQ commented Sep 22, 2025

    在测试中,OSD 似乎对我不起作用。我看到电路板没有标准的MAX7456芯片?

    Hi, please add:
    BUSDEV_REGISTER_SPI(busdev_max7456, DEVHW_MAX7456, MAX7456_SPI_BUS, MAX7456_CS_PIN, NONE, DEVFLAGS_USE_RAW_REGISTERS, 0);

    @sensei-hacker
    Copy link
    Collaborator

    The one thing I can't confirm by testing is the external i2c. The sample may have had a fault before that test could be completed. @LYNHQQ can you please confirm you have tested the i2c pads with this target?

    @LYNHQQ
    Copy link
    Contributor Author

    LYNHQQ commented Oct 27, 2025

    The one thing I can't confirm by testing is the external i2c. The sample may have had a fault before that test could be completed. @LYNHQQ can you please confirm you have tested the i2c pads with this target?

    Hi @sensei-hacker , the sample is brand new. If it has any issues, could you please consider testing it with the Betaflight firmware? It has the barometer connected by default. If it doesn't work, please feel free to contact me, and I will arrange for a new sample to be sent to you for testing

    @sensei-hacker
    Copy link
    Collaborator

    sensei-hacker commented Oct 28, 2025

    The one thing I can't confirm by testing is the external i2c. The sample may have had a fault before that test could be completed. @LYNHQQ can you please confirm you have tested the i2c pads with this target?

    Hi @sensei-hacker , the sample is brand new. If it has any issues, could you please consider testing it with the Betaflight firmware? It has the barometer connected by default. If it doesn't work, please feel free to contact me, and I will arrange for a new sample to be sent to you for testing

    I understand it was new. I am hesitant to connect the faulted board to power again since it already burned up one of my testers.

    Would you be able to simply test the external i2c pads with the INAV target to confirm it works for you?

    @LYNHQQ
    Copy link
    Contributor Author

    LYNHQQ commented Oct 28, 2025

    The one thing I can't confirm by testing is the external i2c. The sample may have had a fault before that test could be completed. @LYNHQQ can you please confirm you have tested the i2c pads with this target?

    Hi @sensei-hacker , the sample is brand new. If it has any issues, could you please consider testing it with the Betaflight firmware? It has the barometer connected by default. If it doesn't work, please feel free to contact me, and I will arrange for a new sample to be sent to you for testing

    I understand it was new. I am hesitant to connect the faulted board to power again since it already burned up one of my testers.

    Would you be able to simply test the external i2c pads with the INAV target to confirm it works for you?

    Hi @sensei-hacker , I'm aware of the situation and will be running some tests on it. This will take some time
    image

    @LYNHQQ
    Copy link
    Contributor Author

    LYNHQQ commented Oct 30, 2025

    我无法通过测试确认的一件事是外部 i2c。在完成测试之前,样品可能出现了故障。您能否确认您已经使用此目标测试了 I2C 焊盘?

    嗨,样品是全新的。如果有任何问题,您能考虑使用 Betaflight 固件进行测试吗?它默认连接了气压计。如果不起作用,请随时与我联系,我会安排将新样品发送给您进行测试

    我知道这是新的。我犹豫是否要再次将有故障的电路板连接到电源,因为它已经烧毁了我的一个测试仪。

    您是否可以简单地使用 INAV 目标测试外部 i2c 焊盘,以确认它适合您?

    image image Hi @sensei-hacker , I've re-tested it, and it seems to be working correctly now. I have registered the I2C bus to the MAG, and everything looks good. Please feel free to contact me if you have any new questions or need new samples.

    @sensei-hacker
    Copy link
    Collaborator

    Thank you very much.

    @sensei-hacker sensei-hacker self-assigned this Oct 30, 2025
    @sensei-hacker sensei-hacker added this to the 9.0 milestone Oct 30, 2025
    @sensei-hacker sensei-hacker merged commit af0765d into iNavFlight:master Oct 30, 2025
    21 checks passed
    @LYNHQQ
    Copy link
    Contributor Author

    LYNHQQ commented Oct 30, 2025

    谢谢。

    Hold on, I need to add it to target.h.

    @sensei-hacker
    Copy link
    Collaborator

    sensei-hacker commented Oct 30, 2025

    Oh, I didn't realize a change was needed. Sorry about that.
    Since I already merged this PR, we'll have a new very small PR for whatever needs to change.

    @LYNHQQ
    Copy link
    Contributor Author

    LYNHQQ commented Oct 30, 2025

    哦,我没有意识到需要改变。对不起。由于我已经合并了这个 PR,我们将有一个新的非常小的 PR 来处理任何需要更改的内容。

    Thanks a lot for your help. I will open a new PR to address this.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    New target This PR adds a new target Review effort 2/5

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants