Skip to content

Conversation

ThanYangFPV
Copy link

@ThanYangFPV ThanYangFPV commented Jul 9, 2025

PR Type

Enhancement


Description

  • Add new flight controller target DAKEFPVF435

  • Configure AT32F43x microcontroller with peripherals

  • Set up motor outputs, sensors, and communication interfaces

  • Enable OSD, flash storage, and LED strip support


Changes diagram

flowchart LR
  A["New Target"] --> B["Hardware Config"]
  B --> C["Timer Setup"]
  B --> D["Sensor Config"]
  B --> E["Communication"]
  C --> F["10 Motor Outputs"]
  D --> G["IMU/Baro/Mag"]
  E --> H["6 UARTs"]
Loading

Changes walkthrough 📝

Relevant files
Configuration changes
config.c
Target configuration setup                                                             

src/main/target/DAKEFPVF435/config.c

  • Configure PINIO box permanent IDs for USER1 and USER2
  • Set up target-specific configuration function
  • +32/-0   
    CMakeLists.txt
    Build system configuration                                                             

    src/main/target/DAKEFPVF435/CMakeLists.txt

    • Add CMake target definition for AT32F43x microcontroller
    +1/-0     
    Enhancement
    target.c
    Timer and PWM configuration                                                           

    src/main/target/DAKEFPVF435/target.c

  • Define timer hardware for 10 motor outputs (M1-M8, S1-S2)
  • Map PWM pins to timer channels with proper alternate functions
  • Configure additional timer for general use
  • +65/-0   
    target.h
    Hardware peripheral definitions                                                   

    src/main/target/DAKEFPVF435/target.h

  • Define board identifier and USB product string
  • Configure SPI buses, I2C, UARTs, and GPIO pins
  • Set up IMU (MPU6500/ICM42605), barometer, magnetometer, OSD
  • Enable flash storage, LED strip, and PINIO functionality
  • +174/-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.
  • Copy link

    qodo-merge-pro bot commented Jul 9, 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

    Inconsistent Spacing

    Mixed use of tabs and spaces in timer hardware definitions creates inconsistent indentation that could affect code readability and maintainability

    DEF_TIM(TMR8, CH4, PC9,  TIM_USE_OUTPUT_AUTO, 0,8), // M8
    DEF_TIM(TMR5, CH2, PH3,  TIM_USE_OUTPUT_AUTO, 0,9), // S1
    DEF_TIM(TMR5, CH1, PH2,  TIM_USE_OUTPUT_AUTO, 0,10),// S2
    Duplicate Configuration

    The USE_BARO define appears twice with different associated configurations, which could lead to confusion about which barometer settings are active

    //Baro 
    #define USE_BARO
    #define USE_BARO_BMP280
    #define BMP280_I2C_BUS          DEFAULT_I2C_BUS
    
    // Other sensors
    
    #define USE_BARO
    #define BARO_I2C_BUS            DEFAULT_I2C_BUS
    #define USE_BARO_ALL
    Compilation Workaround

    UART3_TX_PIN is set to PC13 with a comment indicating it's just for compilation pass, suggesting incomplete UART3 configuration that may cause runtime issues

    #define UART3_TX_PIN         PC13 // PC13 is just for compilation pass

    Copy link

    qodo-merge-pro bot commented Jul 9, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Fix missing DMA index sequence

    There's a gap in the DMA index sequence - index 7 is missing while index 8 is
    used. This could cause issues with DMA resource allocation and should follow a
    sequential pattern.

    src/main/target/DAKEFPVF435/target.c [56]

    -DEF_TIM(TMR8, CH4, PC9,  TIM_USE_OUTPUT_AUTO, 0,8), // M8
    +DEF_TIM(TMR8, CH4, PC9,  TIM_USE_OUTPUT_AUTO, 0,7), // M8
    • Apply / Chat
    Suggestion importance[1-10]: 9

    __

    Why: The suggestion correctly identifies a skipped DMA index (7 is missing), which is likely a bug that could lead to incorrect resource allocation or runtime errors.

    High
    General
    Fix inconsistent indentation style

    The indentation is inconsistent with the rest of the timer definitions. Use
    spaces instead of tabs to match the existing code style and maintain consistency
    throughout the file.

    src/main/target/DAKEFPVF435/target.c [56-58]

    -	DEF_TIM(TMR8, CH4, PC9,  TIM_USE_OUTPUT_AUTO, 0,8), // M8
    -	DEF_TIM(TMR5, CH2, PH3,  TIM_USE_OUTPUT_AUTO, 0,9), // S1
    -	DEF_TIM(TMR5, CH1, PH2,  TIM_USE_OUTPUT_AUTO, 0,10),// S2
    +DEF_TIM(TMR8, CH4, PC9,  TIM_USE_OUTPUT_AUTO, 0,8), // M8
    +DEF_TIM(TMR5, CH2, PH3,  TIM_USE_OUTPUT_AUTO, 0,9), // S1
    +DEF_TIM(TMR5, CH1, PH2,  TIM_USE_OUTPUT_AUTO, 0,10),// S2
    • Apply / Chat
    Suggestion importance[1-10]: 3

    __

    Why: The suggestion correctly identifies inconsistent indentation (tabs vs. spaces), but the improved code is flawed as it removes indentation entirely rather than replacing tabs with spaces.

    Low
    Add missing newline at EOF

    The file is missing a newline at the end, which can cause issues with some text
    editors and version control systems. Add a newline character at the end of the
    file.

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

    +target_at32f43x_xGT7(DAKEFPVF435)
     
    -
    • Apply / Chat
    Suggestion importance[1-10]: 2

    __

    Why: The suggestion correctly points out a missing newline at the end of the file, which is a good practice, but it's a very minor style issue with low impact.

    Low
    • More

    @ThanYangFPV
    Copy link
    Author

    I skipped DMA7 because when I used DMA7 M8 there was no PWM output. I've also tried reversing the order, DMA7 is placed on M1, M2, M3 or M4, etc., and there will be no PWM output on the click pin where DMA7 is located. Eventually I tried to skip DMA7 and it turned out to be good.

    @sensei-hacker sensei-hacker added the New target This PR adds a new target label Jul 26, 2025
    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