Drift

STM32 UART Garbage Characters Debug

Symptom

The firmware builds and the sensor answers, but the console shows garbage. The scope reads 19200 baud, not 9600. The registers and bit fields are on the Datasheet tab.

Circuit

Block diagram: U2 temperature sensor at address 0x48 hangs on U1's I2C1 lines, SCL on PB6 and SDA on PB7, USART1 leaves on PA9 to TP1 a serial monitor, and crystal Y1 marked 8MHz sits on the OSC pins

Pass condition

The timing registers match this board. The console shows TEMP:<degrees>.

Expected output for the room temperature case: the line TEMP:26 on the serial monitor and the byte exchange on the bus, with the registers read back when the run ends

Notes

The bench plays the temperature sensor on I2C1. The program reads the sensor once after reset and prints one line. The bench ignores baud and bus timing, so it reads those registers back. Do not change the clock tree.

Related challenges

Loading the interactive arena.