Facing issue in project creation through STM32Cube IDE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-05-20 3:02 AM - edited ‎2023-11-20 5:02 AM
Hello Support Team,
Good day,
For product development, we chose the STM32U585 family, a trust zone-based MCU. Consequently, we are having a problem when we generate projects using Cube Ide.
I've listed the actions we're taking below.
- Selected IC STM32U585AII6
- Enabled Trustzone
- Enabled X-CUBE-FREERTOS and active for non-secure region
- Generate a project code
- Compile code as per generated tool
When I compiled code we have seen below compilation error
undefined reference to `SecureContext_SaveContext' portasm.c
undefined reference to `SecureContext_AllocateContext' port.c
undefined reference to `SecureContext_LoadContext'
undefined reference to `SecureContext_Init'
I've included a screenshot of the error for debugging.
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-05-22 8:19 AM - edited ‎2023-11-20 5:02 AM
Hello @HirenThumar2702​
First let me thank you for posting.
The compilation error you are facing are caused by the fact that X-Cube-FreeRtos is not selected for the secure project. Therefore, some dependencies are not generated and will lead to those errors.
However, at he moment the tool will not allow you to select the pack for both context at the same time whichi will make the errors appear every time. This is a know issue and it's tracked by this ticket to be resolved asap 151921 (This is an internal tracking number and is not accessible or usable by customers).
In the mean while, and as a temporary solution, I advise you to follow these steps to generate your project:
- Go to [Software Packs]->[Select Components] : select the X-Cube-FreeRtos for the secure context
- Under [Middleware and Software Packs]->[X-CUBE-FREERTOS] : Select the "CMSIS RTOS2" for the secure context
- Under [Project Manager]->[Code Generator] :
- select the "Copy all used libraries into the project folder"
- Uncheck the "Delete previously generated files when not re-generated"
- Generate Code
- Go back to the [Software Packs]->[Select Components] : uncheck the X-Cube for the secure context and select the pack for the non-secure one with the heap configuration you need
- Under [Middleware and Software Packs]->[X-CUBE-FREERTOS] : Select the "CMSIS RTOS2" for the non-secure context with the configuration you want
- Generate Code
This solution should resolve the dependency issue, waiting for a permanent fix.
Don't hesitate to ask further question if you still facing any misbehavior in the tool.
Kind regards,
Semer.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-05-22 8:19 AM - edited ‎2023-11-20 5:02 AM
Hello @HirenThumar2702​
First let me thank you for posting.
The compilation error you are facing are caused by the fact that X-Cube-FreeRtos is not selected for the secure project. Therefore, some dependencies are not generated and will lead to those errors.
However, at he moment the tool will not allow you to select the pack for both context at the same time whichi will make the errors appear every time. This is a know issue and it's tracked by this ticket to be resolved asap 151921 (This is an internal tracking number and is not accessible or usable by customers).
In the mean while, and as a temporary solution, I advise you to follow these steps to generate your project:
- Go to [Software Packs]->[Select Components] : select the X-Cube-FreeRtos for the secure context
- Under [Middleware and Software Packs]->[X-CUBE-FREERTOS] : Select the "CMSIS RTOS2" for the secure context
- Under [Project Manager]->[Code Generator] :
- select the "Copy all used libraries into the project folder"
- Uncheck the "Delete previously generated files when not re-generated"
- Generate Code
- Go back to the [Software Packs]->[Select Components] : uncheck the X-Cube for the secure context and select the pack for the non-secure one with the heap configuration you need
- Under [Middleware and Software Packs]->[X-CUBE-FREERTOS] : Select the "CMSIS RTOS2" for the non-secure context with the configuration you want
- Generate Code
This solution should resolve the dependency issue, waiting for a permanent fix.
Don't hesitate to ask further question if you still facing any misbehavior in the tool.
Kind regards,
Semer.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-05-26 2:21 AM
Hello Semer,
Good day,
Thanks for providing support
I tried as per provided step but the same issue was faced so can you provide me with an example(NS side freeRTOS and Enble Trustzone) or .ioc file
c:\st\stm32cubeide_1.6.1\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.200.202301161003\tools\arm-none-eabi\bin\ld.exe: D:/EVLoop/Project/POC1/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM33/non_secure/port.c:826: undefined reference to `SecureContext_LoadContext'
c:\st\stm32cubeide_1.6.1\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.200.202301161003\tools\arm-none-eabi\bin\ld.exe: D:/EVLoop/Project/POC1/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM33/non_secure/port.c:836: undefined reference to `SecureContext_FreeContext'
c:\st\stm32cubeide_1.6.1\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.200.202301161003\tools\arm-none-eabi\bin\ld.exe: D:/EVLoop/Project/POC1/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM33/non_secure/port.c:845: undefined reference to `SecureInit_DePrioritizeNSExceptions'
c:\st\stm32cubeide_1.6.1\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.200.202301161003\tools\arm-none-eabi\bin\ld.exe: D:/EVLoop/Project/POC1/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM33/non_secure/port.c:848: undefined reference to `SecureContext_Init'
c:\st\stm32cubeide_1.6.1\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.200.202301161003\tools\arm-none-eabi\bin\ld.exe: ./Middlewares/RTOS2/CMSIS/RTOS2/Core/TZ_Non_Secure/portasm.o: in function `PendSV_Handler':
D:/EVLoop/Project/POC1/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM33/non_secure/portasm.c:214: undefined reference to `SecureContext_SaveContext'
Thanks
Hiren R. Thumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-05-26 3:30 AM - edited ‎2023-11-20 5:03 AM
Hello @Semer CHERNI ,
I've taken the steps above, but I'm still getting the below errors .
port.c:826: undefined reference to `SecureContext_LoadContext'
port.c:836: undefined reference to `SecureContext_FreeContext'
port.c:845: undefined reference to `SecureInit_DePrioritizeNSExceptions'
port.c:848: undefined reference to `SecureContext_Init'
I am not able to select "Copy all used libraries in to project folder" option.(attached image)
So Please guide how to use FREERTOS in non-secure zone. Please share .ioc file if possible
I am using STM32U585AII6.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-03-26 12:07 AM
Hi
I followed the above steps , I am still getting the same error Also Can you guide me how to use FreeRtos when TrustZone is enabled .
/STM32CubeIDE/workspace_1.14.4/TRustZone_FreeRtos/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM33/non_secure/port.c:889: undefined reference to `SecureContext_LoadContext'
/STM32CubeIDE/workspace_1.14.4/TRustZone_FreeRtos/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM33/non_secure/port.c:900: undefined reference to `SecureContext_FreeContext'
/RoopaN/STM32CubeIDE/workspace_1.14.4/TRustZone_FreeRtos/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM33/non_secure/port.c:909: undefined reference to `SecureInit_DePrioritizeNSExceptions'
/STM32CubeIDE/workspace_1.14.4/TRustZone_FreeRtos/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM33/non_secure/port.c:912: undefined reference to `SecureContext_Init'
/Middlewares/RTOS2/CMSIS/RTOS2/Core/TZ_Non_Secure/portasm.o: in function `PendSV_Handler':
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-31 9:52 AM
@Semer CHERNI could you please provide an update on ST Internal ticket #151921? It's been over a year and this "ASAP" issue still seems problematic.
