Conveyor (81-dma-rx-intake)

A sensor module sends 8-byte data packets over UART. Instead of polling for each byte and burning CPU cycles, your job is to configure DMA2 Stream 2 to receive the data directly into a buffer.

The starter code provides working UART initialization (with RX enabled) and helper functions. Your task is to fill in the DMA configuration: enable the DMA clock, set up the stream registers for peripheral-to-memory transfer, enable UART DMA receive mode, and start the stream.

On the STM32F4, USART1_RX maps to DMA2 Stream 2, Channel 4. The DMA controller lives on AHB1 (RCC AHB1ENR bit 22).

Expected output (public case):

RX:SENSORPK
OK

The DMA receives 8 bytes from UART into a buffer. Once complete, the firmware echoes them back and prints OK. The DMA configuration registers are also inspected directly.

Loading the interactive arena.