eclipse-threadx / threadx

Eclipse ThreadX is an advanced real-time operating system (RTOS) designed specifically for deeply embedded applications.
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/threadx/index.md
MIT License
2.89k stars 784 forks source link

'cortex-m0' building fail #292

Open PING020903 opened 1 year ago

PING020903 commented 1 year ago

image

I try building 'cortex-m3' of files, but no error. I do not know how to read there '.s' files, because i do not understand. Where 'undefined reference' should be define in the project? Can you help me, please? My files download form this repository, also unmodified。

williamelamie commented 8 months ago

I duplicated your problem. It seems that the startup code and predefined symbols for this version of ThreadX do not match the current GCC compiler generated symbols, specifically in the section of cortexm0_crt0.S having to do with copying initialized sections into RAM. For a quick proof of concept, I commented-out the following section in cortexm0_crt0.S and got a clean build:

/ ldr r0, =data_load_start ldr r1, =data_start ldr r2, =data_end bl crt0_memory_copy ldr r0, =text_load_start ldr r1, =text_start ldr r2, =text_end bl crt0_memory_copy ldr r0, =fast_load_start ldr r1, =fast_start ldr r2, =fast_end bl crt0_memory_copy ldr r0, =ctors_load_start ldr r1, =ctors_start ldr r2, =ctors_end bl crt0_memory_copy ldr r0, =dtors_load_start ldr r1, =dtors_start ldr r2, =dtors_end bl crt0_memory_copy ldr r0, =rodata_load_start ldr r1, =rodata_start ldr r2, =rodata_end bl crt0_memory_copy /

This may not be the real solution, but at least it identifies the problem!