|
22 | 22 | #define USBD_PRODUCT_STRING "FrSkyF405" |
23 | 23 |
|
24 | 24 | // *************** LED & BEEPER ********************** |
25 | | -// Status LEDs share SWD debug pins - only available in release builds |
26 | | -// In debug builds, these pins must remain in SWD mode for debugging |
27 | | -// Red LED is likely a power indicator (always-on, no GPIO control) |
28 | | -#ifndef DEBUG_BUILD |
29 | | - #define LED0 PA14 // Blue LED (shares SWCLK) via R34 1K |
30 | | - #define LED1 PA13 // Green LED (shares SWDIO) via R35 1K |
31 | | -#endif |
32 | | -// Red LED appears to be power indicator (connected to VCC, not GPIO) |
| 25 | +#define LED0 PA14 // shares SWCLK |
| 26 | +#define LED1 PA13 // shares SWDIO |
33 | 27 |
|
34 | 28 | #define BEEPER PC15 |
35 | | -#define BEEPER_INVERTED // INAV beeper driver writes !onoff; BEEPER_INVERTED makes it write HIGH to activate the N-channel MOSFET (Q2) |
| 29 | +#define BEEPER_INVERTED |
36 | 30 |
|
37 | 31 | // *************** Gyro & ACC ********************** |
38 | 32 | #define USE_SPI |
|
42 | 36 | #define SPI1_MISO_PIN PA6 |
43 | 37 | #define SPI1_MOSI_PIN PA7 |
44 | 38 |
|
45 | | -// IIM-42688P Gyro on SPI1 |
46 | | -#define USE_IMU_ICM42605 // IIM-42688P is compatible with ICM42605 driver |
| 39 | +// IIM-42688P is compatible with ICM42605 driver |
| 40 | +#define USE_IMU_ICM42605 |
47 | 41 | #define ICM42605_CS_PIN PA4 |
48 | 42 | #define ICM42605_SPI_BUS BUS_SPI1 |
49 | | -#define IMU_ICM42605_ALIGN CW0_DEG // TODO: Verify orientation from board layout |
| 43 | +#define IMU_ICM42605_ALIGN CW0_DEG |
50 | 44 |
|
51 | 45 |
|
52 | 46 | // *************** OSD ***************************** |
|
55 | 49 | #define SPI2_MISO_PIN PC2 |
56 | 50 | #define SPI2_MOSI_PIN PC3 |
57 | 51 |
|
58 | | -// AT7456E OSD on SPI2 |
59 | 52 | #define USE_MAX7456 |
60 | 53 | #define MAX7456_SPI_BUS BUS_SPI2 |
61 | 54 | #define MAX7456_CS_PIN PB12 |
62 | 55 |
|
63 | 56 | // *************** SD Card ************************* |
64 | 57 | #define USE_SPI_DEVICE_3 |
65 | | -#define SPI3_SCK_PIN PC10 |
66 | | -#define SPI3_MISO_PIN PC11 |
67 | | -#define SPI3_MOSI_PIN PC12 |
| 58 | +#define SPI3_SCK_PIN PB3 |
| 59 | +#define SPI3_MISO_PIN PB4 |
| 60 | +#define SPI3_MOSI_PIN PB5 |
68 | 61 |
|
69 | | -// SD Card on SPI3 |
70 | | -// NOTE: PC14 used for CS (Chip Select) - OSC32_IN pin used as GPIO for slow CS signal |
71 | 62 | #define USE_SDCARD |
72 | 63 | #define USE_SDCARD_SPI |
73 | 64 | #define SDCARD_SPI_BUS BUS_SPI3 |
|
77 | 68 |
|
78 | 69 | // *************** UART ***************************** |
79 | 70 | #define USE_VCP |
80 | | -// Note: USB VBUS sensing not clearly defined in schematic |
81 | 71 |
|
82 | 72 | #define USE_UART1 |
83 | 73 | #define UART1_TX_PIN PA9 |
|
87 | 77 | #define UART2_TX_PIN PA2 |
88 | 78 | #define UART2_RX_PIN PA3 |
89 | 79 |
|
90 | | -// USART2 has SBUS inverter circuit |
| 80 | +// UART2 has two pads: standard (for CRSF etc) and hardware-inverted SBUS |
91 | 81 | #define SERIALRX_UART SERIAL_PORT_USART2 |
92 | 82 | #define SERIALRX_PROVIDER SERIALRX_SBUS |
93 | 83 | #define DEFAULT_RX_TYPE RX_TYPE_SERIAL |
94 | 84 |
|
95 | | -// UART3 conflicts with I2C2 (shares PB10/PB11) |
96 | | -// User must choose: enable UART3 OR I2C2, not both |
97 | 85 | #define USE_UART3 |
98 | | -#define UART3_TX_PIN PB10 // Conflicts with I2C2_SCL |
99 | | -#define UART3_RX_PIN PB11 // Conflicts with I2C2_SDA |
| 86 | +#define UART3_TX_PIN PC10 |
| 87 | +#define UART3_RX_PIN PC11 |
100 | 88 |
|
101 | 89 | #define USE_UART4 |
102 | 90 | #define UART4_TX_PIN PA0 |
103 | | -#define UART4_RX_PIN PC5 // Shared with RSSI_ADC |
| 91 | +#define UART4_RX_PIN PA1 |
| 92 | + |
104 | 93 |
|
105 | | -// UART5 TX conflicts with SPI3_MOSI (PC12) |
106 | | -// User must choose: enable UART5 OR SD card, not both |
107 | 94 | #define USE_UART5 |
108 | | -#define UART5_TX_PIN PC12 // Conflicts with SPI3_MOSI |
| 95 | +#define UART5_TX_PIN PC12 |
109 | 96 | #define UART5_RX_PIN PD2 |
110 | 97 |
|
111 | 98 | #define USE_UART6 |
112 | 99 | #define UART6_TX_PIN PC6 |
113 | 100 | #define UART6_RX_PIN PC7 |
114 | 101 |
|
115 | | -#define SERIAL_PORT_COUNT 7 // VCP + UART1-6 |
| 102 | +#define SERIAL_PORT_COUNT 7 // VCP + UART1-5, UART6 |
116 | 103 |
|
117 | 104 | // *************** I2C **************************** |
118 | 105 | #define USE_I2C |
119 | 106 |
|
120 | | -// I2C1 for barometer (SPL06) |
121 | 107 | #define USE_I2C_DEVICE_1 |
122 | 108 | #define I2C1_SCL PB8 |
123 | 109 | #define I2C1_SDA PB9 |
124 | 110 |
|
125 | | -// I2C2 conflicts with UART3 (shares PB10/PB11) |
126 | | -// Enable one or the other, not both |
127 | | -// #define USE_I2C_DEVICE_2 |
128 | | -// #define I2C2_SCL PB10 // Conflicts with UART3_TX |
129 | | -// #define I2C2_SDA PB11 // Conflicts with UART3_RX |
| 111 | +#define USE_I2C_DEVICE_2 |
| 112 | +#define I2C2_SCL PB10 |
| 113 | +#define I2C2_SDA PB11 |
130 | 114 |
|
131 | 115 | #define DEFAULT_I2C_BUS BUS_I2C1 |
132 | 116 |
|
133 | | -// SPL06 Barometer on I2C1 @ address 0x76 |
134 | 117 | #define USE_BARO |
135 | 118 | #define BARO_I2C_BUS BUS_I2C1 |
136 | 119 | #define USE_BARO_SPL06 |
137 | 120 |
|
138 | | -// Magnetometer on I2C (external via connector) |
139 | 121 | #define USE_MAG |
140 | 122 | #define MAG_I2C_BUS DEFAULT_I2C_BUS |
141 | 123 | #define USE_MAG_ALL |
|
150 | 132 | #define ADC_INSTANCE ADC1 |
151 | 133 | #define ADC1_DMA_STREAM DMA2_Stream0 |
152 | 134 |
|
153 | | -#define ADC_CHANNEL_1_PIN PC0 // VBAT_ADC |
154 | | -#define ADC_CHANNEL_2_PIN PC1 // CURR_ADC |
155 | | -#define ADC_CHANNEL_3_PIN PC5 // RSSI_IN (shared with UART4_RX) |
| 135 | +#define ADC_CHANNEL_1_PIN PC0 |
| 136 | +#define ADC_CHANNEL_2_PIN PC1 |
| 137 | +#define ADC_CHANNEL_3_PIN PC5 |
156 | 138 |
|
157 | 139 | #define VBAT_ADC_CHANNEL ADC_CHN_1 |
158 | 140 | #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2 |
159 | 141 | #define RSSI_ADC_CHANNEL ADC_CHN_3 |
160 | 142 |
|
161 | | -// Current sensor: INA139 with 0.25mΩ shunt |
162 | | -#define CURRENT_METER_SCALE 250 // TODO: Calibrate based on INA139 + shunt values |
| 143 | +#define CURRENT_METER_SCALE 250 |
163 | 144 |
|
164 | 145 | #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_BLACKBOX) |
165 | 146 |
|
166 | 147 | // *************** LED STRIP *********************** |
167 | | -// CON23 LED output - PA15 (T2_1 signal on schematic) |
168 | 148 | #define USE_LED_STRIP |
169 | | -#define WS2811_PIN PA15 // TIM2_CH1, labeled as T2_1 on schematic |
| 149 | +#define WS2811_PIN PA15 |
170 | 150 |
|
171 | 151 | // *************** PWM OUTPUTS ********************* |
172 | | -// 9 motor outputs (S1-S9) |
173 | | -// Note: S7/S8 on TIM12 do not support DShot (no DMA on TIM12 for STM32F405) |
| 152 | +// S7/S8 on TIM12 do not support DShot |
174 | 153 | #define MAX_PWM_OUTPUT_PORTS 9 |
175 | 154 |
|
176 | 155 | // *************** Other *************************** |
|
181 | 160 | #define TARGET_IO_PORTA 0xffff |
182 | 161 | #define TARGET_IO_PORTB 0xffff |
183 | 162 | #define TARGET_IO_PORTC 0xffff |
184 | | -#define TARGET_IO_PORTD (BIT(2)) // PD2 used for UART5_RX |
185 | | - |
186 | | -// *************** NOTES & ISSUES ******************* |
187 | | -// |
188 | | -// DESIGN NOTES: |
189 | | -// 1. PC14 used for SPI3_NSS (SD card CS) - RTC clock domain, should be fine for slow CS signal |
190 | | -// |
191 | | -// 2. Status LEDs share SWD debug pins (PA13/PA14) - HANDLED WITH #ifndef DEBUG_BUILD |
192 | | -// Release builds: Pins configured as GPIO outputs for status LEDs |
193 | | -// Debug builds: Pins remain in SWD mode for debugging (LEDs disabled) |
194 | | -// Red LED appears to be power indicator (always-on, no GPIO control needed) |
195 | | -// |
196 | | -// PIN CONFLICTS (target or user must choose): |
197 | | -// 3. UART3 vs I2C2: PB10/PB11 shared |
198 | | -// - Enable UART3 for telemetry/GPS, OR |
199 | | -// - Enable I2C2 for additional sensors |
200 | | -// |
201 | | -// 4. UART5 TX vs SD Card: PC12 shared (SPI3_MOSI) |
202 | | -// - Enable UART5 for telemetry, OR |
203 | | -// - Enable SD card for blackbox logging |
204 | | -// |
205 | | -// 5. UART4_RX vs RSSI ADC: PC5 shared |
206 | | -// - May be intentional if RSSI comes via UART protocol |
207 | | -// |
208 | | -// MISSING INFORMATION: |
209 | | -// 6. Gyro orientation (IMU_ALIGN) unknown - needs physical board inspection |
210 | | -// 7. USB VBUS sensing pin not clearly defined in schematic (PC13 may be used) |
| 163 | +#define TARGET_IO_PORTD (BIT(2)) // PD2 - UART5_RX |
0 commit comments