Skip to main content
SKim.24
Visitor II
April 29, 2021
Question

On SBSFU, Secure Engine's SE_CORE_Startup() function pointer question.

  • April 29, 2021
  • 1 reply
  • 654 views

Hello all.

I'm trying understand SBSFU source code. At this time, I meet very confuse code.

Middlewares/ST/STM32_Secure_Engine/Core/se_interface_bootloader.c

In the SE_Startup() function, there is function pointer casting code as below:

SE_StartupPtr = (SE_ErrorStatus(*)(void))((uint32_t) SE_STARTUP_REGION_ROM_START + 1U);

SE_STARTUP_REGION_ROM_START point to SE_CORE_Startup() function.

What I want know is why pointer address is "SE_STARTUP_REGION_ROM_START + 1U" rather than "SE_STARTUP_REGION_ROM_START".

Even worse, "SE_STARTUP_REGION_ROM_START + 1U" is not pointer align.

What do I miss understood about this code?

Thanks.

This topic has been closed for replies.

1 reply

Jocelyn RICARD
ST Employee
May 4, 2021

Hi,

Not 100% sure but my guess is that as we are using Thumb code, function address has bit 0 set to 1 (to distinguish from ARM code which is anyway not supported on CortexM).

Best regards

Jocelyn