cancel
Showing results for 
Search instead for 
Did you mean: 

How to use RCC to reset a peripheral?

TwelveSquared
Senior

STM32G474RE: I need to reset the USART3 peripheral and I see the register RCC_APB1RSTR1.USART3RST. I assume this bit needs to be set, then cleared, after a delay. But there doesn't seem to be documentation. What is the correct procedure and how long should the delay be?

1 REPLY 1
TDK
Guru

I don't think any delay is needed. I've never used one and haven't yet run into issues. Could be wrong.

The HAL macros for it don't have any delay, unlike the HAL clock enable macros.

#define __HAL_RCC_USART3_FORCE_RESET()   (RCC->APB1RSTR |= (RCC_APB1RSTR_USART3RST))
#define __HAL_RCC_USART3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_USART3RST))

If you feel a post has answered your question, please click "Accept as Solution".