2023-08-08 03:25 AM - edited 2023-08-08 03:56 AM
I am working on STM32H7 with Azure RTOS ThreadX core; same project with CubeIDE toolchain builds and works fine but when the code is generated with MAKEFILE toolchain and I try to build the following error is encoutered:
arm-none-eabi-gcc -x assembler-with-cpp -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DTX_INCLUDE_USER_DEFINE_FILE -DUSE_HAL_DRIVER -DSTM32H723xx -ICore/Inc -IAZURE_RTOS/App -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -IMiddlewares/ST/threadx/common/inc/ -IMiddlewares/ST/threadx/ports/cortex_m7/gnu/inc/ -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/tx_thread_stack_build.d" Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_stack_build.s -o build/tx_thread_stack_build.o
arm-none-eabi-gcc -x assembler-with-cpp -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DTX_INCLUDE_USER_DEFINE_FILE -DUSE_HAL_DRIVER -DSTM32H723xx -ICore/Inc -IAZURE_RTOS/App -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -IMiddlewares/ST/threadx/common/inc/ -IMiddlewares/ST/threadx/ports/cortex_m7/gnu/inc/ -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/tx_thread_system_return.d" Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_system_return.s -o build/tx_thread_system_return.o
arm-none-eabi-gcc -x assembler-with-cpp -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DTX_INCLUDE_USER_DEFINE_FILE -DUSE_HAL_DRIVER -DSTM32H723xx -ICore/Inc -IAZURE_RTOS/App -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -IMiddlewares/ST/threadx/common/inc/ -IMiddlewares/ST/threadx/ports/cortex_m7/gnu/inc/ -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/tx_timer_interrupt.d" Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_timer_interrupt.s -o build/tx_timer_interrupt.o
arm-none-eabi-gcc build/main.o build/app_threadx.o build/stm32h7xx_it.o build/stm32h7xx_hal_msp.o build/app_azure_rtos.o build/stm32h7xx_hal_cortex.o build/stm32h7xx_hal_rcc.o build/stm32h7xx_hal_rcc_ex.o build/stm32h7xx_hal_flash.o build/stm32h7xx_hal_flash_ex.o build/stm32h7xx_hal_gpio.o build/stm32h7xx_hal_hsem.o build/stm32h7xx_hal_dma.o build/stm32h7xx_hal_dma_ex.o build/stm32h7xx_hal_mdma.o build/stm32h7xx_hal_pwr.o build/stm32h7xx_hal_pwr_ex.o build/stm32h7xx_hal.o build/stm32h7xx_hal_i2c.o build/stm32h7xx_hal_i2c_ex.o build/stm32h7xx_hal_exti.o build/stm32h7xx_hal_tim.o build/stm32h7xx_hal_tim_ex.o build/system_stm32h7xx.o build/tx_initialize_high_level.o build/tx_initialize_kernel_enter.o build/tx_initialize_kernel_setup.o build/tx_block_allocate.o build/tx_block_pool_cleanup.o build/tx_block_pool_create.o build/tx_block_pool_delete.o build/tx_block_pool_info_get.o build/tx_block_pool_initialize.o build/tx_block_pool_prioritize.o build/tx_block_release.o build/tx_byte_allocate.o build/tx_byte_pool_cleanup.o build/tx_byte_pool_create.o build/tx_byte_pool_delete.o build/tx_byte_pool_info_get.o build/tx_byte_pool_initialize.o build/tx_byte_pool_prioritize.o build/tx_byte_pool_search.o build/tx_byte_release.o build/tx_event_flags_cleanup.o build/tx_event_flags_create.o build/tx_event_flags_delete.o build/tx_event_flags_get.o build/tx_event_flags_info_get.o build/tx_event_flags_initialize.o build/tx_event_flags_set.o build/tx_event_flags_set_notify.o build/tx_mutex_cleanup.o build/tx_mutex_create.o build/tx_mutex_delete.o build/tx_mutex_get.o build/tx_mutex_info_get.o build/tx_mutex_initialize.o build/tx_mutex_prioritize.o build/tx_mutex_priority_change.o build/tx_mutex_put.o build/tx_queue_cleanup.o build/tx_queue_create.o build/tx_queue_delete.o build/tx_queue_flush.o build/tx_queue_front_send.o build/tx_queue_info_get.o build/tx_queue_initialize.o build/tx_queue_prioritize.o build/tx_queue_receive.o build/tx_queue_send.o build/tx_queue_send_notify.o build/tx_semaphore_ceiling_put.o build/tx_semaphore_cleanup.o build/tx_semaphore_create.o build/tx_semaphore_delete.o build/tx_semaphore_get.o build/tx_semaphore_info_get.o build/tx_semaphore_initialize.o build/tx_semaphore_prioritize.o build/tx_semaphore_put.o build/tx_semaphore_put_notify.o build/tx_thread_create.o build/tx_thread_delete.o build/tx_thread_entry_exit_notify.o build/tx_thread_identify.o build/tx_thread_info_get.o build/tx_thread_initialize.o build/tx_thread_preemption_change.o build/tx_thread_priority_change.o build/tx_thread_relinquish.o build/tx_thread_reset.o build/tx_thread_resume.o build/tx_thread_shell_entry.o build/tx_thread_sleep.o build/tx_thread_stack_analyze.o build/tx_thread_stack_error_handler.o build/tx_thread_stack_error_notify.o build/tx_thread_suspend.o build/tx_thread_system_preempt_check.o build/tx_thread_system_resume.o build/tx_thread_system_suspend.o build/tx_thread_terminate.o build/tx_thread_time_slice.o build/tx_thread_time_slice_change.o build/tx_thread_timeout.o build/tx_thread_wait_abort.o build/tx_time_get.o build/tx_time_set.o build/txe_block_allocate.o build/txe_block_pool_create.o build/txe_block_pool_delete.o build/txe_block_pool_info_get.o build/txe_block_pool_prioritize.o build/txe_block_release.o build/txe_byte_allocate.o build/txe_byte_pool_create.o build/txe_byte_pool_delete.o build/txe_byte_pool_info_get.o build/txe_byte_pool_prioritize.o build/txe_byte_release.o build/txe_event_flags_create.o build/txe_event_flags_delete.o build/txe_event_flags_get.o build/txe_event_flags_info_get.o build/txe_event_flags_set.o build/txe_event_flags_set_notify.o build/txe_mutex_create.o build/txe_mutex_delete.o build/txe_mutex_get.o build/txe_mutex_info_get.o build/txe_mutex_prioritize.o build/txe_mutex_put.o build/txe_queue_create.o build/txe_queue_delete.o build/txe_queue_flush.o build/txe_queue_front_send.o build/txe_queue_info_get.o build/txe_queue_prioritize.o build/txe_queue_receive.o build/txe_queue_send.o build/txe_queue_send_notify.o build/txe_semaphore_ceiling_put.o build/txe_semaphore_create.o build/txe_semaphore_delete.o build/txe_semaphore_get.o build/txe_semaphore_info_get.o build/txe_semaphore_prioritize.o build/txe_semaphore_put.o build/txe_semaphore_put_notify.o build/txe_thread_create.o build/txe_thread_delete.o build/txe_thread_entry_exit_notify.o build/txe_thread_info_get.o build/txe_thread_preemption_change.o build/txe_thread_priority_change.o build/txe_thread_relinquish.o build/txe_thread_reset.o build/txe_thread_resume.o build/txe_thread_suspend.o build/txe_thread_terminate.o build/txe_thread_time_slice_change.o build/txe_thread_wait_abort.o build/tx_timer_activate.o build/tx_timer_change.o build/tx_timer_create.o build/tx_timer_deactivate.o build/tx_timer_delete.o build/tx_timer_expiration_process.o build/tx_timer_info_get.o build/tx_timer_initialize.o build/tx_timer_system_activate.o build/tx_timer_system_deactivate.o build/tx_timer_thread_entry.o build/txe_timer_activate.o build/txe_timer_change.o build/txe_timer_create.o build/txe_timer_deactivate.o build/txe_timer_delete.o build/txe_timer_info_get.o build/startup_stm32h723xx.o build/tx_thread_schedule.o build/tx_thread_context_restore.o build/tx_thread_context_save.o build/tx_thread_interrupt_control.o build/tx_thread_interrupt_disable.o build/tx_thread_interrupt_restore.o build/tx_thread_stack_build.o build/tx_thread_system_return.o build/tx_timer_interrupt.o -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -specs=nano.specs -TSTM32H723VEHx_FLASH.ld -lc -lm -lnosys -Wl,-Map=build/h7test.map,--cref -Wl,--gc-sections -o build/h7test.elf
c:/program files/microsoft visual studio/2022/community/linux/gcc_arm/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: build/tx_initialize_kernel_enter.o: in function `_tx_initialize_kernel_enter':
C:\Users\fahar\Desktop\h7test/Middlewares/ST/threadx/common/src/tx_initialize_kernel_enter.c:117: undefined reference to `_tx_initialize_low_level'
collect2.exe: error: ld returned 1 exit status
Makefile:340: recipe for target 'build/h7test.elf' failed
Tried adding .s files to path in MAKEFILE as:
ASM_SOURCES = \
startup_stm32h723xx.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_schedule.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_context_restore.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_context_save.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_interrupt_control.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_interrupt_disable.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_interrupt_restore.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_stack_build.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_system_return.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_timer_interrupt.s
Also tried renaming .S to .s and the other way around
No change in error observed;
Note that same project with same configurations works fine on stmcubeide toolchain
https://community.st.com/t5/embedded-software-mcus/azure-rtos-mdk-arm-linking-errors/m-p/121602 I have read almost same issue here; but it was MDK-ARM @Haithem Rahmani
2023-08-08 03:26 AM
This error is only encountered while adding Azure RTOS otherwise it works fine on makefile
2023-08-14 05:57 AM
Hello @faharintisar,
the link issue is due to the missing "tx_initialize_low_level.S" file. it is located under "<project_path>/Core/Src", Could you add it to the file list and retry?
Meanwhile the issue will reported internally to be fixed.
regards
Haithem.
2023-08-15 01:42 PM
Hi @Haithem Rahmani ,
I am encountering the same problem. I also tried what you suggested (adding the tx_initialize_low_level.s file) but it still doesn't work. I am looking forward to any further suggestions or bug fixes.
Thank you!
Regards,
TNG812
2023-08-16 09:22 AM
Hi @tng812 ,
you should have another problem, not the originally reported, could you share more details about the error log?
thanks.
2023-08-16 10:12 AM
Hi @Haithem Rahmani ,
Thank you!
Followings is my error log:
arm-none-eabi-gcc build/main.o build/stm32f4xx_it.o build/stm32f4xx_hal_msp.o build/stm32f4xx_hal_timebase_tim.o build/stm32f4xx_hal_tim.o build/stm32f4xx_hal_tim_ex.o build/stm32f4xx_hal_rcc.o build/stm32f4xx_hal_rcc_ex.o build/stm32f4xx_hal_flash.o build/stm32f4xx_hal_flash_ex.o build/stm32f4xx_hal_flash_ramfunc.o build/stm32f4xx_hal_gpio.o build/stm32f4xx_hal_dma_ex.o build/stm32f4xx_hal_dma.o build/stm32f4xx_hal_pwr.o build/stm32f4xx_hal_pwr_ex.o build/stm32f4xx_hal_cortex.o build/stm32f4xx_hal.o build/stm32f4xx_hal_exti.o build/system_stm32f4xx.o build/app_threadx.o build/app_azure_rtos.o build/tx_initialize_high_level.o build/tx_initialize_kernel_enter.o build/tx_initialize_kernel_setup.o build/tx_block_allocate.o build/tx_block_pool_cleanup.o build/tx_block_pool_create.o build/tx_block_pool_delete.o build/tx_block_pool_info_get.o build/tx_block_pool_initialize.o build/tx_block_pool_prioritize.o build/tx_block_release.o build/tx_byte_allocate.o build/tx_byte_pool_cleanup.o build/tx_byte_pool_create.o build/tx_byte_pool_delete.o build/tx_byte_pool_info_get.o build/tx_byte_pool_initialize.o build/tx_byte_pool_prioritize.o build/tx_byte_pool_search.o build/tx_byte_release.o build/tx_event_flags_cleanup.o build/tx_event_flags_create.o build/tx_event_flags_delete.o build/tx_event_flags_get.o build/tx_event_flags_info_get.o build/tx_event_flags_initialize.o build/tx_event_flags_set.o build/tx_event_flags_set_notify.o build/tx_mutex_cleanup.o build/tx_mutex_create.o build/tx_mutex_delete.o build/tx_mutex_get.o build/tx_mutex_info_get.o build/tx_mutex_initialize.o build/tx_mutex_prioritize.o build/tx_mutex_priority_change.o build/tx_mutex_put.o build/tx_queue_cleanup.o build/tx_queue_create.o build/tx_queue_delete.o build/tx_queue_flush.o build/tx_queue_front_send.o build/tx_queue_info_get.o build/tx_queue_initialize.o build/tx_queue_prioritize.o build/tx_queue_receive.o build/tx_queue_send.o build/tx_queue_send_notify.o build/tx_semaphore_ceiling_put.o build/tx_semaphore_cleanup.o build/tx_semaphore_create.o build/tx_semaphore_delete.o build/tx_semaphore_get.o build/tx_semaphore_info_get.o build/tx_semaphore_initialize.o build/tx_semaphore_prioritize.o build/tx_semaphore_put.o build/tx_semaphore_put_notify.o build/tx_thread_create.o build/tx_thread_delete.o build/tx_thread_entry_exit_notify.o build/tx_thread_identify.o build/tx_thread_info_get.o build/tx_thread_initialize.o build/tx_thread_preemption_change.o build/tx_thread_priority_change.o build/tx_thread_relinquish.o build/tx_thread_reset.o build/tx_thread_resume.o build/tx_thread_shell_entry.o build/tx_thread_sleep.o build/tx_thread_stack_analyze.o build/tx_thread_stack_error_handler.o build/tx_thread_stack_error_notify.o build/tx_thread_suspend.o build/tx_thread_system_preempt_check.o build/tx_thread_system_resume.o build/tx_thread_system_suspend.o build/tx_thread_terminate.o build/tx_thread_time_slice.o build/tx_thread_time_slice_change.o build/tx_thread_timeout.o build/tx_thread_wait_abort.o build/tx_time_get.o build/tx_time_set.o build/txe_block_allocate.o build/txe_block_pool_create.o build/txe_block_pool_delete.o build/txe_block_pool_info_get.o build/txe_block_pool_prioritize.o build/txe_block_release.o build/txe_byte_allocate.o build/txe_byte_pool_create.o build/txe_byte_pool_delete.o build/txe_byte_pool_info_get.o build/txe_byte_pool_prioritize.o build/txe_byte_release.o build/txe_event_flags_create.o build/txe_event_flags_delete.o build/txe_event_flags_get.o build/txe_event_flags_info_get.o build/txe_event_flags_set.o build/txe_event_flags_set_notify.o build/txe_mutex_create.o build/txe_mutex_delete.o build/txe_mutex_get.o build/txe_mutex_info_get.o build/txe_mutex_prioritize.o build/txe_mutex_put.o build/txe_queue_create.o build/txe_queue_delete.o build/txe_queue_flush.o build/txe_queue_front_send.o build/txe_queue_info_get.o build/txe_queue_prioritize.o build/txe_queue_receive.o build/txe_queue_send.o build/txe_queue_send_notify.o build/txe_semaphore_ceiling_put.o build/txe_semaphore_create.o build/txe_semaphore_delete.o build/txe_semaphore_get.o build/txe_semaphore_info_get.o build/txe_semaphore_prioritize.o build/txe_semaphore_put.o build/txe_semaphore_put_notify.o build/txe_thread_create.o build/txe_thread_delete.o build/txe_thread_entry_exit_notify.o build/txe_thread_info_get.o build/txe_thread_preemption_change.o build/txe_thread_priority_change.o build/txe_thread_relinquish.o build/txe_thread_reset.o build/txe_thread_resume.o build/txe_thread_suspend.o build/txe_thread_terminate.o build/txe_thread_time_slice_change.o build/txe_thread_wait_abort.o build/tx_timer_activate.o build/tx_timer_change.o build/tx_timer_create.o build/tx_timer_deactivate.o build/tx_timer_delete.o build/tx_timer_expiration_process.o build/tx_timer_info_get.o build/tx_timer_initialize.o build/tx_timer_system_activate.o build/tx_timer_system_deactivate.o build/tx_timer_thread_entry.o build/txe_timer_activate.o build/txe_timer_change.o build/txe_timer_create.o build/txe_timer_deactivate.o build/txe_timer_delete.o build/txe_timer_info_get.o build/startup_stm32f412zx.o -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -specs=nano.specs -TSTM32F412ZETx_FLASH.ld -lc -lm -lnosys -Wl,-Map=build/azure-rtos-led.map,--cref -Wl,--gc-sections -o build/azure-rtos-led.elf
/usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: build/tx_initialize_kernel_enter.o: in function `_tx_initialize_kernel_enter':
/home/azure-rtos-led/Middlewares/ST/threadx/common/src/tx_initialize_kernel_enter.c:142: undefined reference to `_tx_thread_schedule'
/usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: /home/tung/p-work/gitlab/p-firmware/azure-rtos-led/Middlewares/ST/threadx/common/src/tx_initialize_kernel_enter.c:111: undefined reference to `_tx_initialize_low_level'
/usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: build/tx_thread_create.o: in function `_tx_thread_create':
/home/azure-rtos-led/Middlewares/ST/threadx/common/src/tx_thread_create.c:210: undefined reference to `_tx_thread_stack_build'
collect2: error: ld returned 1 exit status
make: *** [Makefile:330: build/azure-rtos-led.elf] Error 1
Looking forward to hearing from you!
Kind Regards,
TNG812
2023-08-28 02:53 PM
Hi @Haithem Rahmani ,
Would you be able to have a look at the error log above? Any suggestion is greatly appreciated.
Thank you!
Kind Regarsd,
TNG812
2023-11-10 05:42 AM
Hi @tng812,
the issue is confirmed, fix implmented and it is under validation, it will be part of the coming soon STM32CubeMX 6.10.0.
regards
Haithem.
2023-11-27 08:54 AM
Hi @tng812,
the STM32CubeMX 6.10.0 is released and the issue is fixed.
please give it a try and let us know.
regards.
2024-01-03 08:35 AM
Still has the problem on 6.10.0 - Confirmed on Windows 10 with compiler:
com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235
Example Project Tx_Thread_Creation