首先请看STM32官方文档(RM0008)里,在描述RCC_APB2ENR、RCC_APB1ENR、RCC_AHBENR这3个寄存器时,都有着同样的提示:
No wait states, except if the access occurs while an access to a peripheral in the APB2/APB1
domain is on going. In this case, wait states are inserted until the access to APB2 peripheral
is finished.
When the peripheral clock is not active, the peripheral register values may not be readable
by software and the returned value is always 0x0.

STM32官方文档指出,RCC_APB2ENR、RCC_APB1ENR、RCC_AHBENR在访问时若APB2/APB1域的外设正在访问,会插入等待状态。如果外围设备时钟未激活,其寄存器无法被软件读取。这意味着在RCC配置之前,如GPIO、USART等外设的配置可能是无效的。然而,NVIC、GPIO、RCC自身可以在RCC配置前设置,但GPIO输出可能无效,输入正常。其他如USART、ADC、TIME等外设先于RCC配置则无效。
最低0.47元/天 解锁文章
2351

被折叠的 条评论
为什么被折叠?



