Low-power universal asynchronous receiver transmitter (LPUART) RM0351
1262/1693 DocID024597 Rev 3
Reception using DMA
DMA mode can be enabled for reception by setting the DMAR bit in LPUART_CR3 register.
Data is loaded from the LPUART_RDR register to a SRAM area configured using the DMA
peripheral (refer Section 10: Direct memory access controller (DMA) on page 295)
whenever a data byte is received. To map a DMA channel for LPUART reception, use the
following procedure:
1. Write the LPUART_RDR register address in the DMA control register to configure it as
the source of the transfer. The data is moved from this address to the memory after
each RXNE event.
2. Write the memory address in the DMA control register to configure it as the destination
of the transfer. The data is loaded from LPUART_RDR to this memory area after each
RXNE event.
3. Configure the total number of bytes to be transferred to the DMA control register.
4. Configure the channel priority in the DMA control register
5. Configure interrupt generation after half/ full transfer as required by the application.
6. Activate the channel in the DMA control register.
When the number of data transfers programmed in the DMA Controller is reached, the DMA
controller generates an interrupt on the DMA channel interrupt vector.
Figure 415. Reception using DMA
Error flagging and interrupt generation in multibuffer communication
In multibuffer communication if any error occurs during the transaction the error flag is
asserted after the current byte. An interrupt is generated if the interrupt enable flag is set.
For framing error, overrun error and noise flag which are asserted with RXNE in single byte
reception, there is a separate error flag interrupt enable bit (EIE bit in the LPUART_CR3
register), which, if set, enables an interrupt after the current byte if any of these errors occur.
06Y9
7;OLQH
)UDPH
)
)
6HWE\KDUGZDUHFOHDUHGE\
'0$UHDG
)
)UDPH
)UDPH
5;1(IODJ
/38$57B7'5
'0$UHTXHVW
'0$UHDGV
/38$57B7'5
'0$7&,)IODJ
WUDQVIHUFRPSOHWH
6RIWZDUHFRQILJXUHV
WKH'0$WRUHFHLYH
GDWDEORFNVDQGHQDEOHV
WKH/38$57
'0$UHDGV)
IURP
/38$57B7'5
7KH'0$
WUDQVIHULV
FRPSOHWH
7&,) LQ
'0$B,65
6HWE\KDUGZDUH
&OHDUHGE\
VRIWZDUH
'0$UHDGV)
)URP
/38$57B7'5
'0$UHDGV
)IURP
/38$57B7'5