Skip to content

B fix #1480 : RTC not starting after soft reset #1499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ void rtc_init(void) {
rtc_inited = 1;

RtcHandle.Instance = RTC;

// Check if RTC is already initialized
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;

// Enable Power clock
__PWR_CLK_ENABLE();
Expand Down Expand Up @@ -82,6 +79,9 @@ void rtc_init(void) {
rtc_freq = LSI_VALUE;
}

// Check if RTC is already initialized
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;

// Enable RTC
__HAL_RCC_RTC_ENABLE();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ void rtc_init(void)
rtc_inited = 1;

RtcHandle.Instance = RTC;

// Check if RTC is already initialized
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;

// Enable Power clock
__PWR_CLK_ENABLE();
Expand Down Expand Up @@ -83,6 +80,9 @@ void rtc_init(void)
rtc_freq = LSI_VALUE;
}

// Check if RTC is already initialized
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;

// Enable RTC
__HAL_RCC_RTC_ENABLE();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ void rtc_init(void)
rtc_inited = 1;

RtcHandle.Instance = RTC;

// Check if RTC is already initialized
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;

// Enable Power clock
__PWR_CLK_ENABLE();
Expand Down Expand Up @@ -85,6 +82,9 @@ void rtc_init(void)
rtc_freq = LSI_VALUE;
}

// Check if RTC is already initialized
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;

// Enable RTC
__HAL_RCC_RTC_ENABLE();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ void rtc_init(void)
RCC_OscInitTypeDef RCC_OscInitStruct;
uint32_t rtc_freq = 0;

if((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) { // RTC initialization and status register (RTC_ISR), cold start (with no backup domain power) RTC reset value

RtcHandle.Instance = RTC;

// Enable Power clock
Expand Down Expand Up @@ -79,6 +77,8 @@ void rtc_init(void)
rtc_freq = LSI_VALUE;
}

if((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) { // RTC initialization and status register (RTC_ISR), cold start (with no backup domain power) RTC reset value

// Enable RTC
__HAL_RCC_RTC_ENABLE();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ void rtc_init(void)
rtc_inited = 1;

RtcHandle.Instance = RTC;

// Check if RTC is already initialized
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;

// Enable Power clock
__PWR_CLK_ENABLE();
Expand Down Expand Up @@ -97,6 +94,9 @@ void rtc_init(void)
}
#endif

// Check if RTC is already initialized
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;

// Enable RTC
__HAL_RCC_RTC_ENABLE();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ void rtc_init(void)
rtc_inited = 1;

RtcHandle.Instance = RTC;

// Check if RTC is already initialized
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;

// Enable Power clock
__PWR_CLK_ENABLE();
Expand Down Expand Up @@ -85,6 +82,9 @@ void rtc_init(void)
rtc_freq = 32000;
}

// Check if RTC is already initialized
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;

// Enable RTC
__HAL_RCC_RTC_ENABLE();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ void rtc_init(void)
rtc_inited = 1;

RtcHandle.Instance = RTC;

// Check if RTC is already initialized
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;

// Enable Power clock
__PWR_CLK_ENABLE();
Expand Down Expand Up @@ -85,6 +82,9 @@ void rtc_init(void)
rtc_freq = 32000;
}

// Check if RTC is already initialized
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;

// Enable RTC
__HAL_RCC_RTC_ENABLE();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ void rtc_init(void)
rtc_inited = 1;

RtcHandle.Instance = RTC;

// Check if RTC is already initialized
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;

// Enable Power clock
__PWR_CLK_ENABLE();
Expand Down Expand Up @@ -85,6 +82,9 @@ void rtc_init(void)
rtc_freq = 40000;
}

// Check if RTC is already initialized
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;

// Enable RTC
__HAL_RCC_RTC_ENABLE();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ void rtc_init(void)

RtcHandle.Instance = RTC;

// Check if RTC is already initialized
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;

// Enable Power clock
__HAL_RCC_PWR_CLK_ENABLE();

Expand Down Expand Up @@ -91,6 +88,9 @@ void rtc_init(void)
rtc_freq = 40000;
}

// Check if RTC is already initialized
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;

// Enable RTC
__HAL_RCC_RTC_ENABLE();

Expand Down