-
Notifications
You must be signed in to change notification settings - Fork 1.3k
bsp: Disable SysTick ISR if FreeRTOS is enabled #3368
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes SysTick timer configuration issues across multiple BSP (Board Support Package) implementations to ensure proper behavior when FreeRTOS is enabled. The changes prevent SysTick ISR from running before the FreeRTOS scheduler starts, which could cause timing issues and undefined behavior.
Key changes:
- Added explicit SysTick disable (
SysTick->CTRL &= ~1U;) for FreeRTOS configurations - Wrapped
SysTick_Configcalls withOPT_OS_NONEchecks where they were missing - Ensured consistent handling across 30+ BSP family implementations
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 33 comments.
Show a summary per file
| File | Description |
|---|---|
| hw/bsp/tm4c/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/stm32u5/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/stm32u0/family.c | Added OPT_OS_NONE guard for SysTick_Config and FreeRTOS disable logic |
| hw/bsp/stm32l4/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/stm32f3/family.c | Fixed indentation and added SysTick disable for FreeRTOS |
| hw/bsp/stm32f2/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/stm32f1/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/samg/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/same7x/family.c | Added OPT_OS_NONE guard and FreeRTOS disable with IRQ priority |
| hw/bsp/samd5x_e5x/family.c | Added OPT_OS_NONE guard for SysTick_Config and FreeRTOS disable logic |
| hw/bsp/samd2x_l2x/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/samd11/family.c | Added OPT_OS_NONE guard for SysTick_Config and FreeRTOS disable logic |
| hw/bsp/ra/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/nuc100_120/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/msp432e4/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/mm32/family.c | Added OPT_OS_NONE guard for SysTick_Config and FreeRTOS disable logic |
| hw/bsp/mcx/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/maxim/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/lpc54/family.c | Added OPT_OS_NONE guard and restructured conditionals with FreeRTOS disable |
| hw/bsp/lpc51/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/lpc43/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/lpc40/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/lpc18/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/lpc17/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/lpc15/family.c | Added OPT_OS_NONE guard and restructured conditionals with FreeRTOS disable |
| hw/bsp/lpc13/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/lpc11/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/kinetis_kl/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/kinetis_k/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/imxrt/family.c | Added SysTick disable for FreeRTOS configuration |
| hw/bsp/at32f435_437/family.c | Added SysTick disable for FreeRTOS, but SysTick_Config still called unconditionally |
| hw/bsp/at32f402_405/family.c | Restructured to add OPT_OS_NONE guard for SysTick_Config and FreeRTOS disable with IRQ priority configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
65dca4a to
734e733
Compare
734e733 to
8221ea2
Compare
|
hathach
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you



Describe the PR
Some BSP have either:
OPT_OS_NONEcheckFix them.