Skip to main content
sheng yang
Senior
Dec 12, 2025 6:28 AM UTC
Solved

DBP bit couldn't be set to 1

I want to use stm32f103rct6 inner RTC, I write some code as below to active RTC, But I found I couldn't set DBP bit of PWR_CR reg to 1,  

 __HAL_RCC_PWR_CLK_ENABLE();
 __HAL_RCC_BKP_CLK_ENABLE();
 LL_PWR_EnableBkUpAccess();

when I debug the reg as below

(gdb) x/2x 0x40007000
0x40007000: 0x00000000 0x00000000

 

sheng yang
sheng yangBest answer
Senior
Dec 12, 2025 8:04 AM UTC

I made a mistake , it was becase I use LSE as RTC clock. But it was not exist, I changed to LSI , then it's ok.

1 reply

sheng yang
sheng yangAuthorBest answer
Senior
Dec 12, 2025 8:04 AM UTC

I made a mistake , it was becase I use LSE as RTC clock. But it was not exist, I changed to LSI , then it's ok.