2023-06-08 12:04 AM
On stm32u5xx HAL_PWREx_EnterSHUTDOWNMode will not work when a DMA is still active.
The fun part is, that after a uart dma transmit, the DMA transmit enable flag is not cleared due the undocumented define USART_DMAREQUESTS_SW_WA.
Solved! Go to Solution.
2023-06-08 12:33 AM
found in the errata:
2.18.2 USART does not generate DMA requests after setting/clearing DMAT bit
Description
If the DMA is used for data transmission (DMAT = 1 in USART_CR3 register), and the software clears DMAT bit
and sets it again to prepare the next transmission, then the peripheral does not generate DMA requests anymore.
As a result, data are not transmitted.
Workaround
• Avoid clearing DMAT.
• If clearing DMAT is needed after the end of DMA transfers, once DMAT is cleared, disable and reenable
the peripheral through UE bit of USART_CR1 register. This workaround is acceptable only if the peripheral
is not used in receiver mode.
• DMAT can be cleared if the next transmission is based on polling/interrupt.
2023-06-08 12:33 AM
found in the errata:
2.18.2 USART does not generate DMA requests after setting/clearing DMAT bit
Description
If the DMA is used for data transmission (DMAT = 1 in USART_CR3 register), and the software clears DMAT bit
and sets it again to prepare the next transmission, then the peripheral does not generate DMA requests anymore.
As a result, data are not transmitted.
Workaround
• Avoid clearing DMAT.
• If clearing DMAT is needed after the end of DMA transfers, once DMAT is cleared, disable and reenable
the peripheral through UE bit of USART_CR1 register. This workaround is acceptable only if the peripheral
is not used in receiver mode.
• DMAT can be cleared if the next transmission is based on polling/interrupt.