Skip to content

Exclude sample low-level initialization from module manager builds - #853

Open
Dev10-sys wants to merge 1 commit into
eclipse-threadx:devfrom
Dev10-sys:fix/module-manager-cortex-m33-low-level-init
Open

Dev10-sys wants to merge 1 commit into
eclipse-threadx:devfrom
Dev10-sys:fix/module-manager-cortex-m33-low-level-init

Conversation

@Dev10-sys

Copy link
Copy Markdown

In the Cortex-M33, Cortex-M23, and Cortex-A35 SMP module manager ports, tx_initialize_low_level.S was sitting inside module_manager/src/ instead of example_build/. When building with -DTHREADX_MODULE_MANAGER=ON, the CMake build globs everything in module_manager/src/, which pulled this sample startup file straight into libthreadx.a. This breaks downstream applications linking against ThreadX because the static library ends up exporting strong definitions for SysTick_Handler, HardFault_Handler, and _tx_initialize_low_level, along with references to sample linker symbols like __RAM_segment_used_end__.

To fix this, tx_initialize_low_level.S has been moved to example_build/ across the affected ports, matching the layout used by Cortex-M4 and the rest of the ports. The redundant duplicate copy in rxv2/iar/module_manager/src/ was removed, and the Cortex-M23 GNU assembly file was updated to use the standard GNU linker symbol __RAM_segment_used_end__ instead of Arm Compiler's Image$$ARM_LIB_STACK$$ZI$$Limit.

An explicit filter was also added to CMakeLists.txt under THREADX_MODULE_MANAGER to ensure any tx_initialize_low_level files are excluded from the library build even if one ever ends up in the source directory.

Fixes #852

CMake support for module manager kernels uses file(GLOB ...) to collect
port sources under ${TX_PORT_PATH}/module_manager/src/. In Cortex-M33,
Cortex-M23, and Cortex-A35 SMP ports, sample tx_initialize_low_level.S
files were placed inside module_manager/src/ rather than example_build/.
This caused the sample startup file to be compiled into libthreadx.a,
exporting hardcoded clock constants, memory symbols, and exception
vector handlers (SysTick_Handler, HardFault_Handler, etc.) which led to
multiple-definition linker collisions when linked with applications.

Move tx_initialize_low_level.S to example_build/ across affected ports,
delete the redundant copy in rxv2/iar/module_manager/src/, and update
the Cortex-M23 GNU assembly file to reference the standard GNU linker
symbol __RAM_segment_used_end__.

Additionally, add a regex filter in CMakeLists.txt to exclude any
tx_initialize_low_level files from TX_PORT_SOURCES during module manager
builds as a permanent build-level safeguard.

Fixes eclipse-threadx#852

Signed-off-by: Dev10-sys <kalpanagola9897@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant