Intake

STM32 UART DMA Receive Debug

Symptom

The sensor module sends A5 08 17 17 64 3A 0F 3E. The board logs RX:3E 00 00 00 00 00 00 00. The registers and bit fields are on the Datasheet tab.

Circuit

Block diagram: the M1 sensor module's TX line runs to PA10 of U1, an STM32F4, where USART1 receives it, DMA2 Stream 2 carries it into an eight-byte frame buffer in RAM, and USART1 transmits the log on PA9 to a serial console

Pass condition

The frame lands in RAM in one eight-byte DMA2 Stream 2 transfer. The log prints RX: and the bytes in hex, in the order they arrived.

Expected log: the module sends the eight bytes A5 08 17 17 64 3A 0F 3E back to back, and the serial console shows one line, RX:A5 08 17 17 64 3A 0F 3E

Notes

The bench sends the frame once, after reset. USART1 RX is DMA2 Stream 2, channel 4. On this bench only DMA2 needs its clock enabled, and the program enables it.

Related challenges

Loading the interactive arena.