feat(nucleo-f401re): implement comprehensive ThreadX RTOS monitor and primitives showcase#40
feat(nucleo-f401re): implement comprehensive ThreadX RTOS monitor and primitives showcase#40AmmarOkla12772 wants to merge 12 commits into
Conversation
new file: STMicroelectronics/NUCLEO_F401RE/README.md new file: STMicroelectronics/NUCLEO_F401RE/app/CMakeLists.txt new file: STMicroelectronics/NUCLEO_F401RE/app/common/board_init.c new file: STMicroelectronics/NUCLEO_F401RE/app/common/board_init.h new file: STMicroelectronics/NUCLEO_F401RE/app/common/console.c new file: STMicroelectronics/NUCLEO_F401RE/app/common/sntp_client.c new file: STMicroelectronics/NUCLEO_F401RE/app/common/startup/NUCLEO_F401RE.ld new file: STMicroelectronics/NUCLEO_F401RE/app/common/startup/startup_stm32f401xe.s new file: STMicroelectronics/NUCLEO_F401RE/app/common/startup/tx_initialize_low_level.S new file: STMicroelectronics/NUCLEO_F401RE/app/common/stm32cubef4/stm32f4xx_hal_msp.c new file: STMicroelectronics/NUCLEO_F401RE/app/starter/cloud_config.h new file: STMicroelectronics/NUCLEO_F401RE/app/starter/main.c new file: STMicroelectronics/NUCLEO_F401RE/cmake/FindCMSIS.cmake new file: STMicroelectronics/NUCLEO_F401RE/cmake/FindSTM32HAL.cmake new file: STMicroelectronics/NUCLEO_F401RE/cmake/arm-gcc-cortex-m4.cmake new file: STMicroelectronics/NUCLEO_F401RE/cmake/arm-gcc-cortex-toolchain.cmake new file: STMicroelectronics/NUCLEO_F401RE/cmake/utilities.cmake new file: STMicroelectronics/NUCLEO_F401RE/lib/CMakeLists.txt new file: STMicroelectronics/NUCLEO_F401RE/lib/nucleo_bsp/CMakeLists.txt new file: STMicroelectronics/NUCLEO_F401RE/lib/nucleo_bsp/nucleo_bsp.c new file: STMicroelectronics/NUCLEO_F401RE/lib/nucleo_bsp/nucleo_bsp.h new file: STMicroelectronics/NUCLEO_F401RE/lib/stm32cubef4/CMakeLists.txt new file: STMicroelectronics/NUCLEO_F401RE/lib/stm32cubef4/config/stm32f4xx_hal_conf.h
…t board specs and ThreadX requirements
Booted ThreadX on NUCLEO-F401RE Validated scheduler operation Validated UART console output Validated LED thread Validated flashing and hardware execution
…UCLEO-F401RE (continued)
…and event flags. Modified demo README file to reflect changes.
…aphore functionality and 1 hz applicaion timer.
fdesbiens
left a comment
There was a problem hiding this comment.
Just a small change needed. I will merge once this is addressed.
| @@ -1,3 +1,3 @@ | |||
| /* | |||
| * Copyright (c) 2026 Eclipse ThreadX contributors | |||
| * | |||
There was a problem hiding this comment.
You are missing this part of the header:
- This program and the accompanying materials are made available
- under the terms of the MIT license which is available at
https://opensource.org/license/mit.
…ard folders under targets/ and centralized duplicate CMake/toolchain utilities to the root. Also set up directories for shared bsp_interface headers, apps/threadx_demo, and target templates.
fdesbiens
left a comment
There was a problem hiding this comment.
Hi Amar. Thank you for this contribution. However, I cannot merge this PR in its current state.
I understand that you tried to refactor the Nucleo and MXChip AZ3166 samples to avoid code duplication. This is a good idea in theory, since both leverage an STM Cortex-M4 MCU. However, we lack the source code for the AZ3166 driver. This means we are stuck with whatever version of ThreadX was current when the last version of the WiFi driver was contributed.
Thus, it is not possible to share code between the AZ3166 sample and the other samples. This is why this sample is leveraging ThreadX and NetX modules inside its own folder structure and not at the top level like the others. Those modules pull the specific version of ThreadX that work with the WiFi driver we have.
I would suggest to close this PR and create a new one where you would submit only your F410re code. Do not touch the AZ3166 sample, unless you want to add new features to it. Let's not try to share BSP code between that one and the others.
Overview
This PR extends the validation demo for the STMicroelectronics NUCLEO-F401RE board under
STMicroelectronics/NUCLEO_F401RE/.The goal is to provide a comprehensive ThreadX RTOS demonstration showcasing dynamic memory management, runtime diagnostics, thread monitoring, and synchronization primitives using public ThreadX APIs.
Changes
TX_BYTE_POOLTX_BLOCK_POOLfor fixed-size deterministic memory allocationTX_QUEUETX_MUTEXsynchronization with two competing worker threads sharing a simulated SPI resourceTX_EVENT_FLAGS_GROUPsynchronization between the LED heartbeat thread and an event-processing threadTX_SEMAPHOREsynchronization with a dedicated consumer thread awakened by LED activityTX_TIMERperiodic callback executing once per second from the ThreadX system timer threadtx_thread_info_get()0xEFEFEFEF)Validation
Tested on physical NUCLEO-F401RE board:
79028bytes during operation, indicating no byte pool or block pool leaksToolchain
Notes
All runtime diagnostics are implemented using documented ThreadX public APIs. No private kernel structures or undocumented internal ThreadX data are accessed, maintaining portability across ThreadX targets.