2389958_en-US

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2389958_en-US

2389958_en-US

S32K344 FreeRTOS example fails to link

Hello;

I'm just starting out with the S32K344 EVK (S32K344MINI-EVB) and am using the IDE 3.6.5 with FreeRTOS 7.0.0 (D2511) that came in the FRDM automotive bundle created by the package manager.

I'm trying to build one of the provided sample applications for the 344, via the "S32DS Project from Example", the FreeRTOS_Toggle_Led_Example_S32K344..

I've use the ConfigTools to Update Code, but so far that's the only modification to the code that I've made.

But out of the box the code fails at the link stage:

c:/nxp/s32ds.3.6.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: ./FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1/port.o: in function `vPortStoreTaskMPUSettings':

C:\Workspaces-35\FreeRTOS_Toggle_Led_Example_S32K344\Debug_FLASH/../FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1/port.c:1890: undefined reference to `__FreeRTOS_code_data_start__'

c:/nxp/s32ds.3.6.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: C:\Workspaces-35\FreeRTOS_Toggle_Led_Example_S32K344\Debug_FLASH/../FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1/port.c:1890: undefined reference to `__FreeRTOS_code_data_end__'

c:/nxp/s32ds.3.6.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: ./FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1/port.o: in function `prvSetupMPU':

C:\Workspaces-35\FreeRTOS_Toggle_Led_Example_S32K344\Debug_FLASH/../FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1/port.c:1723: undefined reference to `__FreeRTOS_code_data_end__'

c:/nxp/s32ds.3.6.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: C:\Workspaces-35\FreeRTOS_Toggle_Led_Example_S32K344\Debug_FLASH/../FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1/port.c:1723: undefined reference to `__FreeRTOS_code_data_start__'


freertos_error.png


I assume these are linker sections, but they do not appear to be defined anywhere inside either the sample code, the FreeRTOS folder inside the package, or elsewhere.

Are the "S32DS Project from Example" sample projects outdated? Or is there a simple fix to this issue that I'm missing?

Thanks in advance,
Joe Shidle


Re: S32K344 FreeRTOS example fails to link

Hi Joe Shidle,

Sorry for the inconvenience we bring you!

I was able to reproduce the issue where example does not build correctly because of Ld errors, and their solution is correct:

Root cause: MPU is enabled by default in the S32CT. This causes code generator to emit MPU-aware code (including references to the FreeRTOS MPU linker symbols). However, the linker script for the Toggle_Led_Example_S32K344 (linker_flash_s32k344.ld) does not define these MPU memory regions or their boundary symbols — those are only present in MPU-specific examples (e.g., FreeRTOS_MPU_Example_S32K389/linker_flash_s32k389.ld). The mismatch between the generated code expecting MPU symbols and the non-MPU linker script causes the undefined reference errors.

Disabling 'use mpu' makes the example compile correctly:

Toggle_Led_Example_S32K344 disable MPU.png

Side effect note: Disabling MPU by default means users who need MPU must explicitly enable it in S32CT and configure the memory regions.

Best Regards,
Robin

Tags (1)
No ratings
Version history
Last update:
yesterday
Updated by: