This is the documentation for the latest (main) development branch of HPM SDK. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

6.37. UART_DMA receive variable length data

6.37.1. Overview


In this example project, UART receives variable length data via DMA(data size less than defined BUFFER_SIZE in program).

6.37.2. Port Settings


  • Serial port baud rate is set to 115200bps, with one stop bit and no parity bit

6.37.3. Board Setting

  • connect uart transmitter tx pin to uart rx pin on baord, connect GND pin between uart transmitter and baord

  • connect uart rx pin to trgmux input IO

6.37.4. Running the example


When the project runs correctly, the serial port terminal will output the following information:

> uart receive xxx bytes, the received data are:!

the received data will be seen like:

0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9