Skip to content
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

hw/mcu/stm32: Disable SysTick when RTC is selected as tick source #3287

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

kasjer
Copy link
Contributor

@kasjer kasjer commented Jul 6, 2024

When tick was provided by RTC instead of SysTick (default) and MCUboot used SysTick during boot, SysTick was never turned off and was running in application code.
This resulted in two interrupts advancing mynewt OS tick so clock was running too fast.

Now os_tick_init() from RTC code disables SysTick that could be started in bootloader.
Same code was already applied to STM32F1 that has different RTC block.

When tick was provided by RTC instead of SysTick (default)
and MCUboot used SysTick during boot, SysTick was never turned off
and was running in application code.
This resulted in two interrupts advancing mynewt OS tick so clock
was running too fast.

Now os_tick_init() from RTC code disables SysTick that could be
started in bootloader.
Same code was already applied to STM32F1 that has different
RTC block.

Signed-off-by: Jerzy Kasenberg <[email protected]>
@kasjer kasjer added Trivial Trivial fix BugFix Bug fix STM STM32 related labels Jul 6, 2024
@kasjer kasjer merged commit 5a37e22 into apache:master Jul 10, 2024
17 checks passed
@kasjer kasjer deleted the kasjer/stm32-rtc-systick-fix branch July 10, 2024 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugFix Bug fix STM STM32 related Trivial Trivial fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants