Add STM32 ThreadX Cortex-M4 support#419
Draft
nhuvaoanh123 wants to merge 8 commits into
Draft
Conversation
nhuvaoanh123
added a commit
to nhuvaoanh123/openbsw
that referenced
this pull request
Mar 30, 2026
Add complete board configuration for NUCLEO-F413ZH (STM32F413ZH): - Cortex-M4, 100 MHz, 1.5 MB Flash, 320 KB SRAM - bxCAN peripheral (vs FDCAN on G474RE) - Board-specific BSP configuration, safety manager, FreeRTOS/ThreadX configs - Main application with CAN ISR handlers and lifecycle hooks - Linker script for F413ZH memory layout Both boards now build and boot: - G474RE (FDCAN): `cmake --preset nucleo-g474re-freertos-gcc` - F413ZH (bxCAN): `cmake --preset nucleo-f413zh-freertos-gcc` Milestone: F413ZH builds and produces bootable ELF. Depends on eclipse-openbsw#419 (PR 7: ThreadX). PR 8 of 10.
This was referenced Mar 30, 2026
a11774f to
ccc1b75
Compare
nhuvaoanh123
pushed a commit
to nhuvaoanh123/openbsw
that referenced
this pull request
Mar 30, 2026
Add complete board configuration for NUCLEO-F413ZH (STM32F413ZH): - Cortex-M4, 100 MHz, 1.5 MB Flash, 320 KB SRAM - bxCAN peripheral (vs FDCAN on G474RE) - Board-specific BSP configuration, safety manager, FreeRTOS/ThreadX configs - Main application with CAN ISR handlers and lifecycle hooks - Linker script for F413ZH memory layout Both boards now build and boot: - G474RE (FDCAN): `cmake --preset nucleo-g474re-freertos-gcc` - F413ZH (bxCAN): `cmake --preset nucleo-f413zh-freertos-gcc` Milestone: F413ZH builds and produces bootable ELF. Depends on eclipse-openbsw#419 (PR 7: ThreadX). PR 8 of 10.
ccc1b75 to
1025a62
Compare
nhuvaoanh123
added a commit
to nhuvaoanh123/openbsw
that referenced
this pull request
Mar 30, 2026
Add complete board configuration for NUCLEO-F413ZH (STM32F413ZH): - Cortex-M4, 100 MHz, 1.5 MB Flash, 320 KB SRAM - bxCAN peripheral (vs FDCAN on G474RE) - Board-specific BSP configuration, safety manager, FreeRTOS/ThreadX configs - Main application with CAN ISR handlers and lifecycle hooks - Linker script for F413ZH memory layout Both boards now build and boot: - G474RE (FDCAN): `cmake --preset nucleo-g474re-freertos-gcc` - F413ZH (bxCAN): `cmake --preset nucleo-f413zh-freertos-gcc` Milestone: F413ZH builds and produces bootable ELF. Depends on eclipse-openbsw#419 (PR 7: ThreadX). PR 8 of 10.
1025a62 to
447b2db
Compare
nhuvaoanh123
added a commit
to nhuvaoanh123/openbsw
that referenced
this pull request
Mar 31, 2026
Add complete board configuration for NUCLEO-F413ZH (STM32F413ZH): - Cortex-M4, 100 MHz, 1.5 MB Flash, 320 KB SRAM - bxCAN peripheral (vs FDCAN on G474RE) - Board-specific BSP configuration, safety manager, FreeRTOS/ThreadX configs - Main application with CAN ISR handlers and lifecycle hooks - Linker script for F413ZH memory layout Both boards now build and boot: - G474RE (FDCAN): `cmake --preset nucleo-g474re-freertos-gcc` - F413ZH (bxCAN): `cmake --preset nucleo-f413zh-freertos-gcc` Milestone: F413ZH builds and produces bootable ELF. Depends on eclipse-openbsw#419 (PR 7: ThreadX). PR 8 of 10.
447b2db to
f27c4c4
Compare
nhuvaoanh123
added a commit
to nhuvaoanh123/openbsw
that referenced
this pull request
Mar 31, 2026
Add complete board configuration for NUCLEO-F413ZH (STM32F413ZH): - Cortex-M4, 100 MHz, 1.5 MB Flash, 320 KB SRAM - bxCAN peripheral (vs FDCAN on G474RE) - Board-specific BSP configuration, safety manager, FreeRTOS/ThreadX configs - Main application with CAN ISR handlers and lifecycle hooks - Linker script for F413ZH memory layout Both boards now build and boot: - G474RE (FDCAN): `cmake --preset nucleo-g474re-freertos-gcc` - F413ZH (bxCAN): `cmake --preset nucleo-f413zh-freertos-gcc` Milestone: F413ZH builds and produces bootable ELF. Depends on eclipse-openbsw#419 (PR 7: ThreadX). PR 8 of 10.
8a47a96 to
f273249
Compare
Import the STM32F4 and STM32G4 CMSIS device headers from STMicroelectronics' dedicated RIM-tracked repositories. Keep only the F413 and G474 headers needed by the STM32 MCU foundation and record the unused upstream headers as RIM ignores.
Add the STM32 platform entry point, chip CMake files, bspMcu startup code, a software reset wrapper, and the STM32 unit-test presets. The platform reuses the shared CMSIS core from libs/3rdparty/cmsis instead of carrying a local copy.
Add STM32 BSP modules for clock, UART, GPIO, timer, ADC, and EEPROM, plus interrupt handling primitives and the ETL platform glue.
5f4c7a5 to
0fe8b05
Compare
Add bxCAN and FDCAN device drivers with STM32 CAN tests. Add the bxCAN transceiver adapter and unit-test registration.
Add the FDCAN transceiver implementation and STM32 test coverage. Wire the FDCAN transceiver into the chip-family CMake selection.
Add the STM32 hard fault handler with RAM dump region and the IWDG watchdog driver. Add the G474RE safety manager sources and watchdog unit tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of this PR
Description
Seventh PR in the STM32 platform series. Adds ThreadX as an alternative RTOS alongside FreeRTOS (PR 6).
What's included
Dual-RTOS design
Both FreeRTOS and ThreadX are selectable at configure time:
cmake --preset nucleo-g474re-freertos-gcccmake --preset nucleo-g474re-threadx-gccThe
main/directory (PR 6) already includes ThreadX-specific hooks (tx_initialize_low_level.S,osHooks/threadx/).Milestone
cmake --preset nucleo-g474re-threadx-gccconfigures successfully. Same binary boots with ThreadX scheduler.Depends on #418 (PR 6: FreeRTOS board config). PR 7 of 10.
Related Issues
Part of STM32 platform port — see #413 for series overview.
Breaking Changes
Test Plan
CC=arm-none-eabi-gcc CXX=arm-none-eabi-g++ cmake --preset nucleo-g474re-threadx-gcccmake --build --preset nucleo-g474re-threadx-gccRegression Tests
Have tests been added/updated? [ ] Yes [x] No