Skip to main content
Associate II
January 15, 2025
Solved

SBSFU on STM32H743 SWAP_BANK

  • January 15, 2025
  • 1 reply
  • 2412 views

I am new to SBSFU. I picked the NUCLEO-H753ZI project to try on a board with STM32H743. Everything seems to be running fine but ONLY when the SWAP_BANK is unchecked at startup. When it is checked before flashing, the board doesn't run as it was programmed at BANK2. We unchecked the SWAP_BANK as part of the boot sequence of the SBSFU which means it expects code to be at BANK1. I also noticed that the PCROP and WRP is unchecked for bank2. Please any idea if this is mainly an issue with STM32H743? If yes any idea how to resolve it?

Best answer by STea

Hello @starmour ,

The default optionbyte configuration is the same across new parts so the swap bank option byte will be disabled by default if that's your concern so you will be by default on bank 1.
Regards

1 reply

ST Employee
January 21, 2025

Hello @starmour ,

Are you trying the single image, 2 images or 2 images OSC project?

just note that H7 implementation of SBSFU uses the secure user memory. When only one user secure memory is set, boot is automatically set to this area, whatever the swap bank bit value.
here is the sate machine for H7 series boot: using SBSFU :

STea_0-1737468704462.png

check UM2262 section 5.3 for more details.

Regards

 

starmourAuthor
Associate II
January 21, 2025

I am trying the single image and 2 images. I ordered and received the evaluation board of the NUCLEO-H753ZI and I can see the same issue. It is nothing to do with the security feature as issue is from this call SFU_LL_SECU_SetFlashConfiguration which does the SWAP BANK. I can replicate the issue with the evaluation board too. All I have to do is:

1- go to STM32CubeProgrammer and enable the SWAP BANK bit.

2- Flash the SBSFU image which disable the SWAP_BANK as expected. However as we started with SWAP BANK enable, the image is in BANK2.

When I reboot, nothing runs until I go back to STM32CubeProgrammer and enable back the SWAP BANK bit.

I can also see that nWRP8 was unchecked and not nWRP0. Same with the PCROP which is enabled on AREA2.

All works fine when I flash the SBSFU image with SWAP_BANK disable which is not really something we expect to be done in production.

NB: As I am still debugging, I am NOT running it with SFU_FINAL_SECURE_LOCK_ENABLE. Hence unsure about the secure user memory as it seems to be available only when I have SFU_FINAL_SECURE_LOCK_ENABLE uncommented. I don't have that facility with STM32H743 anyway so I wonder if that will be an issue when I come to it. Thanks. 

ST Employee
January 22, 2025

Hello @starmour ,

When enabled SWAP bank before downloading the firmware the app is running as expected and after terminating the debug session I 'have checked that the swap bank OB is still enabled.

I have tested this with a NUCLEO-H743ZI.

the steps where the following:

1-enable swap bank bit in cube programmer

2-opning a debug session which will trigger programming of the combined image of the 3 projects (i'm disabling protections in app_sfu.h file)

STea_0-1737553781203.png

3-run the app 

4-detache the debugger and recheck the OB of swap bank with Cube programmer which is still set and not cleared by SBSFU 

Could you confirm that following these steps you still have the same issue?

Regards