Skip to main content
rp.1
Associate
June 8, 2023
Solved

HAL_PWREx_EnterSHUTDOWNMode not working due USART_DMAREQUESTS_SW_WA being set on stm32u5xx

  • June 8, 2023
  • 1 reply
  • 1273 views

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.

  1. What's the reason behind  USART_DMAREQUESTS_SW_WA?
  2. Is their a way to unset  USART_DMAREQUESTS_SW_WA through CubeMX?
This topic has been closed for replies.
Best answer by rp.1

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.

1 reply

rp.1
rp.1AuthorBest answer
Associate
June 8, 2023

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.