Linker Errors when enabling CMSIS RTOS v2 and TrustZone
I have started a new project using STM32H573. This is using the following:
- Cube MX 6.16
- Cube IDE 2.0 - Build: 26820_20251114_1348 (UTC)
The project has secure zone enabled. I have written bare metal code and shown I can run/debug code in the non-secure environment without issues, and I can invoke non-secure callable functions etc.
My problem comes when I add Free RTOS and enable CMSIS RTOS v2 to the non-secure side.
When I build, I get linker errors (see below).
When I search the forums, there have been similar issues raised, but most are quite old posts or seem overly complex (which always worries me)
``
C:/Users/531023/git/TEML20/Monitor/NonSecure/Debug/../Core/Src/app_freertos.c:86:(.text.MX_FREERTOS_Init+0xa): undefined reference to `osThreadNew'
C:/ST/STM32CubeIDE_1.18.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.win32_1.0.100.202509120712/tools/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Core/Src/app_freertos.o: in function `StartDefaultTask':
C:/Users/531023/git/TEML20/Monitor/NonSecure/Debug/../Core/Src/app_freertos.c:110:(.text.StartDefaultTask+0xa): undefined reference to `osDelay'
C:/ST/STM32CubeIDE_1.18.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.win32_1.0.100.202509120712/tools/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Core/Src/main.o: in function `main':
C:/Users/531023/git/TEML20/Monitor/NonSecure/Debug/../Core/Src/main.c:96:(.text.main+0x10): undefined reference to `osKernelInitialize'
C:/ST/STM32CubeIDE_1.18.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.win32_1.0.100.202509120712/tools/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld.exe: C:/Users/531023/git/TEML20/Monitor/NonSecure/Debug/../Core/Src/main.c:101:(.text.main+0x18): undefined reference to `osKernelStart'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:91: Monitor_NonSecure.elf] Error 1
"make -j16 all" terminated with exit code 2. Build might be incomplete.I also get the following warning (which is likely related):
Invalid project path: Missing project folder or file: \Monitor_NonSecure\RTOS2 for Source path. Monitor_NonSecure pathentry Path Entry Problem
