Echo Tail

STM32 UART Losing Characters Debug

Symptom

Keys typed one at a time echo. At full speed, a line echoes only its first characters. The tail never appears. The registers and bit fields are on the Datasheet tab.

Circuit

Block diagram: a serial console at J1 connects to USART1 of U1, an STM32F4, on PA9 and PA10 at 9600 baud 8N1, and U1's I2C1 on PB8 and PB9 connects to U2, the log chip at address 0x50, with pull-ups R1 and R2 to 3V3

Pass condition

The whole line echoes and every character lands in the log chip. LOGGED:<n> follows once each character is stored.

Expected output for a line sent at full speed: the three bytes A to C and a newline arrive one every 1.04 ms, the console gets ABC back, the log chip gets three one-byte writes, A at address 0 through C at address 2, and then the console gets LOGGED colon 3

Notes

An operator types at 9600 baud (BRR = 0x683) for as long as the board runs. Each write to the log chip is one byte and takes 5 ms, with no ready sign. On this bench only I2C1 needs its clock enabled, and the program enables it. Your program is built and run at -O0, then at -O2. Both must pass.

Related challenges

Loading the interactive arena.