cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_PWREx_EnterSHUTDOWNMode not working due USART_DMAREQUESTS_SW_WA being set on stm32u5xx

rp.1
Associate

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?
1 ACCEPTED SOLUTION

Accepted Solutions
rp.1
Associate

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.

View solution in original post

1 REPLY 1
rp.1
Associate

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.