Skip to main content
Associate II
October 17, 2023
Question

Issue with SBSFU integration with custom user application

  • October 17, 2023
  • 3 replies
  • 3922 views

 

Hi,

I am trying to integrate custom user application with SBSFU bootloader for p-nucleo-WB55 and I was wondering in case anyone saw the following issue.

When I try to use the Secure Engine functions for validation in my user application, the program gets stuck and watchdog resets after timeout sometimes. Here is the call stack flow when I come across this issue:


Reset_Handler() at startup_stm32wb55xx_cm4.s:52 0x8000640
<signal handler called>() at 0xffffffe9
memcmp() at 0x80027b4
SE_IMG_GetActiveFwState() at se_fwimg.c:354 0x8001d5e
SE_CallGateService() at se_callgate.c:1,213 0x80017b6
SE_CallGate() at se_callgate.c:319 0x80002d0
SE_APP_GetActiveFwState() at se_interface_application.c:185 0x8003978

 

I don't see this issue consistently so I am a bit lost on where the issue could be. Highly appreciate you taking the time to read this. Thanks.

This topic has been closed for replies.

3 replies

Bubbles
ST Employee
October 18, 2023

Hello @kaur,

do you test the integration with SECBOOT_DISABLE_SECURITY_IPS defined in app_sfu.h?

what project was your starting point, 1_image or 2_image?

When you say it's not consistent, do you mean that sometimes it passes, or you rather see different error in other cases?

BR,

J

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.
kaurAuthor
Associate II
October 18, 2023

Hi Bubbles,

Thanks for your prompt response. Yes, I have SECBOOT_DISABLE_SECURITY_IPS defined in app_sfu.h.

The starting point was 2_image and I modified mapping_fwimg.ld to expand active slot and Dwl slot to 320 KB from original 208 KB.

Sometimes, the SE_IMG_GetActiveFwState() returns as expected and I don't see this issue. However, sometimes I come across the issue I mentioned. I don't see a different error. 

Also, I had trouble generating se_interface_app.o so I ended up using se_interface_application.o, se_interface_bootloader.o and se_interface_common.o in my UserApp application for the SE interface functions.

Bubbles
ST Employee
October 19, 2023

Hi @kaur,

looking at the default linker file, I fail to see where you could have found the additional >200kB.

But obviously you are having trouble with the SE interface in the first place. I don't think the provision you use for the SE interface will work with security enabled.

BR,

J

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.
kaurAuthor
Associate II
October 19, 2023

Hi @Bubbles,

I am using stm32wb55rg which has 1MB flash as a result of which I am able to use 320K KB image slots.

Could you please clarify which security you are referring to. I have ENABLE_IMAGE_STATE_HANDELING and SECBOOT_DISABLE_SECURITY_IPS defined in app_sfu.h which should be sufficient for using SE_APP_GetActiveFwState() for image validation in my understanding.

Bubbles
ST Employee
November 2, 2023

Hi @kaur,

the default memory mapping in the ST delivered SBSFU is for 1MB device. If you need larger FW slots, you need to use a single image variant of the SBSFU, external flash or forfeit some of the functionality. Please look at AN5056 and AN5185.

BR,

J

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.
kaurAuthor
Associate II
October 26, 2023

Hi Bubbles,

I suspect that this issue could be due to some misconfiguration in porting the P-NUCLEO-WB55.Nucleo/Applications/2_Images project to the STM32WB55CG MCU that I am using. Could you please help me with the steps that need to be taken to port the default SBSFU code for STM32WB55CG.

Bubbles
ST Employee
November 2, 2023

Hi @kaur,

both RG and CG have the same 1MB flash memory. just the package is different.

BR,

J

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.
kaurAuthor
Associate II
November 17, 2023

Hi Bubbles, 

Thank for your support. I am unable to reproduce this issue. I am still not sure what caused it but I will update this thread if I discover the root cause.