
GD32F403xx User Manual
404
USART_CTL2 register is set, or if the RBNEIE is set.
If a noise error (NERR), parity error (PERR), frame error (FERR) or overrun error (ORERR)
is generated during a receiving process, then NERR, PERR, FERR or ORERR will be set at
same time with RBNE. If DMA is disabled, the software needs to check whether the RBNE
interrupt is caused by noise error, parity error, framing error or overflow error when the RBNE
interrupt occurs.
17.3.5.
Use DMA for data buffer access
To reduce the burden of the processor, DMA can be used to access the transmitting and
receiving data buffer. The DENT bit in USART_CTL2 is used to enable the DMA transmission,
and the DENR bit in USART_CTL2 is used to enable the DMA reception.
When DMA is used for USART transmission, DMA transfers data from internal SRAM to the
transmit data buffer of the USART. The configuration steps are shown in
Configuration step when using DMA for USART transmission
.
Figure 17-5. Configuration step when using DMA for USART transmission
Set the address of USART_DATA as
the DMA destination address
Set the address of data in internal
sram as the DMA source address
Set the number of data as the DMA
transfer number
Set other configurations of DMA,
interrupt enable, priority, etc
Clear the TC bit in USART_STAT
Enable the DMA channel for USART
Wait the TC bit to be set