Skip to content

Conversation

@HiFiPhile
Copy link
Collaborator

Describe the PR
Some BSP have either:

  • Enabled SysTick without OPT_OS_NONE check
  • Forget to disable SysTick ISR with FreeRTOS

Fix them.

Copilot AI review requested due to automatic review settings November 25, 2025 15:01
Copilot finished reviewing on behalf of HiFiPhile November 25, 2025 15:05
Copy link
Contributor

Copilot AI left a 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_Config calls with OPT_OS_NONE checks 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.

@sonarqubecloud
Copy link

Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

@hathach hathach merged commit 8205b60 into master Nov 26, 2025
172 checks passed
@hathach hathach deleted the disable_isr branch November 26, 2025 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants