Introduction - If you have any usage issues, please Google them yourself
USART & DMA ping-pong operation to receive data of arbitrary length.
STM32 microcontroller reference code
complete works.
This code can be found in the discussion thread Amo Forum (All rights belong to the original author).