Advertisement
Guest User

STM32F407VET6 Config Attempt

a guest
Jun 25th, 2025
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.68 KB | Source Code | 0 0
  1. /*
  2.  * This file is part of Betaflight.
  3.  *
  4.  * Betaflight is free software. You can redistribute this software
  5.  * and/or modify this software under the terms of the GNU General
  6.  * Public License as published by the Free Software Foundation,
  7.  * either version 3 of the License, or (at your option) any later
  8.  * version.
  9.  *
  10.  * Betaflight is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13.  *
  14.  * See the GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public
  17.  * License along with this software.
  18.  *
  19.  * If not, see <http://www.gnu.org/licenses/>.
  20.  */
  21.  
  22. #pragma once
  23.  
  24. #define FC_TARGET_MCU     STM32F405
  25.  
  26. #define BOARD_NAME        STM32F4DISCOVERY
  27. #define MANUFACTURER_ID   STMI
  28.  
  29. #define USE_GYRO
  30. #define USE_GYRO_MPU6050
  31. #define USE_ACC
  32. #define USE_ACC_MPU6050
  33. #define USE_BARO
  34. #define USE_BARO_SPI_BMP280
  35.  
  36. #ifndef USE_WING
  37. // for CI build to test wing code
  38. #define USE_WING
  39. #endif
  40.  
  41. #define USE_PWM_OUTPUT
  42. #define MOTOR1_PIN           PB1
  43. #define MOTOR2_PIN           PB0
  44. #define MOTOR3_PIN           PA2
  45. #define MOTOR4_PIN           PA3
  46.  
  47. // #define RX_PPM_PIN           PB9
  48.  
  49. #define USE_I2C
  50. #define USE_I2C1                      // Or I2C2/I2C3 depending on the pins used
  51. #define I2C1_SCL_PIN  PB6             // Example pins (check STM32F407 datasheet)
  52. #define I2C1_SDA_PIN  PB7
  53. #define GYRO_1_I2C_INSTANCE I2C1
  54. #define BARO_SPI_INSTANCE SPI1
  55. #define SPI1_SCK_PIN         PA5
  56. #define SPI1_SDI_PIN         PA6
  57. #define SPI1_SDO_PIN         PA7
  58. #define BARO_CS_PIN          PC13
  59.  
  60. // #define UART1_TX_PIN         PB6
  61. // #define UART2_TX_PIN         PA2
  62. // #define UART3_TX_PIN         PB10
  63. // #define UART4_TX_PIN         PA0
  64. // #define UART6_TX_PIN         PC6
  65. // #define UART1_RX_PIN         PB7
  66. // #define UART2_RX_PIN         PA3
  67. // #define UART3_RX_PIN         PB11
  68. // #define UART4_RX_PIN         PA1
  69. // #define UART6_RX_PIN         PC7
  70.  
  71. // #define SPI1_SCK_PIN         PA5
  72. // #define SPI1_SDI_PIN         PA6
  73. // #define SPI1_SDO_PIN         PA7
  74.  
  75. #define USB_MSC_PIN          PA10
  76.  
  77. // #define USE_I2C
  78. // #define USE_I2C_GYRO
  79. #define USB_DETECT_PIN       PA9
  80.  
  81. #define TIMER_PIN_MAPPING \
  82.     TIMER_PIN_MAP( 0, PB9 , 1, -1) \
  83.     TIMER_PIN_MAP( 1, PB1 , 2,  0) \
  84.     TIMER_PIN_MAP( 2, PB0 , 2,  0) \
  85.     TIMER_PIN_MAP( 3, PA2 , 1,  0) \
  86.     TIMER_PIN_MAP( 4, PA3 , 1,  1)
  87.  
  88.  
  89. // #define SPI2_TX_DMA_OPT     0
  90. // #define ADC1_DMA_OPT        1
  91.  
  92. // #define SYSTEM_HSE_MHZ 8
  93. // //TODO #define LED_INVERSION 3
  94. // #define BARO_1_SPI_INSTANCE SPI1
  95. // #define GYRO_1_ALIGN CW180_DEG_FLIP
  96.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement