Skip to main content
MBax.2
Associate III
Jan 27, 2022 5:53 PM UTC
Question

How to fix undefined references to secure engine functions in a user application that uses SBSFU

I have an undefined reference error to several secure engine functions, for example SE_APP_GetActiveFwState

I have read this thread:

https://community.st.com/s/question/0D53W000017PGUKSA4/how-to-call-secureengine-functions-from-my-application

And what I think needs to be done to resolve this problem is to:

-add the function names to se_interface.txt in the SBSFU folder

-rebuild SBSFU

-add the generated se_interface_app.o as additional object file in my project settings > MCU GCC Linker > Misc

-Add other flags, in project settings > MCU GCC Linker > Misc to be the same as the userapp

After doing this however the problem still persists, and I'm having a hard time finding it. I made sure to copy all project settings from the SBSFU UserApp example, added all the includes and compared the linker scripts, now I have reached a dead end...

The contents of my se_interface.txt file is:

SE_APP_GetActiveFwInfo

SE_APP_GetActiveFwState

SE_APP_ValidateFw

This topic has been closed for replies.

2 replies

MBax.2
MBax.2Author
Associate III
Jan 28, 2022 10:12 AM UTC

Found the problem, needed to add defines for ENABLE_IMAGE_STATE_HANDLING not only in my user app, but also in SECoreBin and SBSFU

MBax.2
MBax.2Author
Associate III
Jan 28, 2022 2:05 PM UTC

Now the problem is back for some reason. To make sure it is not in my own app, I took the SBSFU UserApp example and added defines for ENABLE_IMAGE_STATE_HANDLING to SBSFU, SECoreBin and the user app itself.

So the only change I made was to add those defines, and then building fails undefined reference to

SE_APP_ValidateFw and SE_APP_GetActiveFwState.

This is poorly documented in the manuals. Some help would be greatly appreciated. The UserApp example also contains two instances of se_interface.txt both with different content. This is confusing and I do not know what to do with those. The paths for these are:

C:\STM32CubeExpansion_SBSFU_V2.6.0\Projects\B-L475E-IOT01A\Applications\2_Images\2_Images_SBSFU\MDK-ARM\B-L475E-IOT01_2_Images_SBSFU\se_interface.txt

C:\STM32CubeExpansion_SBSFU_V2.6.0\Projects\B-L475E-IOT01A\Applications\2_Images\2_Images_SBSFU\STM32CubeIDE\se_interface.txt