Copper Shorting Issue Fix
Considering the best approach...
Table
| Function | STM32 pin | Connected net | Connected device | Direction | Notes |
|---|---|---|---|---|---|
| I2C SDA | PB7 | I2C_SDA | U3 MPU6050 SDA, U4 BME280 SDI, R1 4.7 kΩ | Open-drain I/O | Configure I2C1 SDA with external pull-up. |
| I2C SCL | PB6 | I2C_SCL | U3 MPU6050 SCL, U4 BME280 SCK, R2 4.7 kΩ | Open-drain output | Configure I2C1 SCL with external pull-up. |
| ESP UART TX from STM32 | PA0 | UART_ESP_RX | U2 ESP-12F RXD / GPIO3 | Output | STM32 transmit to ESP receive. |
| ESP UART RX to STM32 | PA1 | UART_ESP_TX | U2 ESP-12F TXD / GPIO1 | Input | STM32 receive from ESP transmit. |
| Motor PWM | PA2 | MOTOR_PWM | R3 to Q1 base | PWM output | Drives vibration motor low-side transistor through 1 kΩ. |
| RGB red PWM | PA3 | LED_R_PWM | R5 to LED1 red | PWM output | 330 Ω series resistor. |
| RGB green PWM | PA4 | LED_G_PWM | R6 to LED1 green | PWM output | 220 Ω series resistor. |
| RGB blue PWM | PA5 | LED_B_PWM | R7 to LED1 blue | PWM output | 220 Ω series resistor. |
| SOS button | PA6 | SOS_BTN | SW1 | Input with pull-up | Button pulls input to GND when pressed. |
| IMU interrupt | PA7 | IMU_INT | U3 INT | Input interrupt | Optional data-ready/motion interrupt. |
| Microphone ADC | PA8 | MIC_ADC | U5 MAX4466 OUT | ADC input | Sample audio envelope/waveform; signal is biased near mid-supply. |
| Reset | PF2-NRST | MCU_NRST | SW2 and J2 | Reset input | Reset button pulls NRST low. |
| SWDIO | PA13 | SWDIO | J2 | Debug I/O | SWD programming. |
| SWCLK / BOOT0 | PA14-BOOT0 | SWCLK_BOOT0 | J2 and R12 | Debug clock / boot | 100 kΩ pull-down for normal boot. |
C
// Configure in CubeMX: I2C1 PB6/PB7, USART on PA0/PA1 mapping, ADC PA8, GPIO/PWM pins. #define MPU6050_ADDR (0x68 << 1) #define BME280_ADDR (0x76 << 1) void app_init(void) { HAL_GPIO_WritePin(MOTOR_GPIO_Port, MOTOR_Pin, GPIO_PIN_RESET); HAL_GPIO_WritePin(LED_R_GPIO_Port, LED_R_Pin, GPIO_PIN_RESET); HAL_GPIO_WritePin(LED_G_GPIO_Port, LED_G_Pin, GPIO_PIN_RESET); HAL_GPIO_WritePin(LED_B_GPIO_Port, LED_B_Pin, GPIO_PIN_RESET); HAL_I2C_IsDeviceReady(&hi2c1, MPU6050_ADDR, 3, 100); HAL_I2C_IsDeviceReady(&hi2c1, BME280_ADDR, 3, 100); HAL_UART_Transmit(&huart1, (uint8_t*)"AT\r\n", 4, 100); }
Platform & Toolchain
Pin Mapping
External Device Configuration
Bring-up Sequence
Minimal HAL Pseudocode Skeleton
Verification Checklist