cancel
Showing results for 
Search instead for 
Did you mean: 

STM32N6 FreeRTOS_Queues_ThreadFlags_TrustZone example compile error

Tuomas95
Associate II

Hello,

After creating a new project based on the FreeRTOS_Queues_ThreadFlags_TrustZone example from MX and generating code, there is a compile error:

[build] C:/Users/tuoma/AppData/Local/stm32cube/bundles/gnu-tools-for-stm32/13.3.1+st.9/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld.exe: CMakeFiles/FreeRTOS_Queues_ThreadFlags_TrustZone_AppliNonSecure.dir/Src/stm32n6xx_hal_timebase_tim.c.obj: in function `HAL_InitTick':
[build] C:/Users/tuoma/STM32Cube/Example/FreeRTOS_Queues_ThreadFlags_TrustZone/AppliNonSecure/Src/stm32n6xx_hal_timebase_tim.c:56:(.text.HAL_InitTick+0x1e): undefined reference to `HAL_RCCEx_GetTIMGFreq'
[build] Memory region         Used Size  Region Size  %age Used

[build]              RAM:       66120 B       511 KB     12.64%

[build] collect2.exe: error: ld returned 1 exit status
[build] ninja: build stopped: subcommand failed.
[build] ninja: build stopped: subcommand failed.
[proc] The command: cube-cmake --build C:/Users/tuoma/STM32Cube/Example/FreeRTOS_Queues_ThreadFlags_TrustZone/build/Debug -- exited with code: 1
[driver] Build completed: 00:00:20.980
[build] Build finished with exit code 1

The function HAL_RCCEx_GetTIMGFreq is not found from the stm32n6xx_hal_rxx_ex.c where it should be based on another project.

After adding HAL_RCCEx_GetTIMGFreq to stm32n6xx_hal_rxx_ex.c and LL_RCC_CALC_TIMG_FREQ to stm32n6xx_ll_rcc.h, the code compiles.

After adding the above mentioned functions to get the code to build, it hard faults when running and debugging:

HardFault_Handler@0x3418ee1c (c:\Users\tuoma\STM32Cube\Example\FreeRTOS_Queues_ThreadFlags_TrustZone\FSBL\Src\stm32n6xx_it.c:89)
<signal handler called>@0xfffffff9 (Unknown Source:0)
HAL_RCCEx_PeriphCLKConfig@0x34183c80 (c:\Users\tuoma\STM32Cube\Example\FreeRTOS_Queues_ThreadFlags_TrustZone\Drivers\STM32N6xx_HAL_Driver\Src\stm32n6xx_hal_rcc_ex.c:129)
SystemClock_Config@0x3418eb06 (c:\Users\tuoma\STM32Cube\Example\FreeRTOS_Queues_ThreadFlags_TrustZone\FSBL\Src\main.c:167)
main@0x3418e9d8 (c:\Users\tuoma\STM32Cube\Example\FreeRTOS_Queues_ThreadFlags_TrustZone\FSBL\Src\main.c:92)

 Is there a working example project for the STM32N6 with FSBL, AppliSecure and AppliNonSecure used?

0 REPLIES 0