Skip to main content
Arno1
Senior
February 1, 2021
Solved

Port fails on __IS_SFU_RESERVED()

  • February 1, 2021
  • 2 replies
  • 1019 views

Hi,

I've been trying to port the STM32H753 SBSFU project to the STM32H735G-DK.

The bootloader fails in SFU_BOOT_Init due to failing SE_Init().

This is the result of __IS_SFU_RESERVED() failing it's test:

0x08008A00 < 0x08008061 < 0x0801FFFF (SB_REGION_ROM_START < __get_LR() < SB_REGION_ROM_END).

As you can see the LR register value is outside of the expected range.

Does anyone have an idea why this could be the case?

Thanks!

This topic has been closed for replies.
Best answer by Arno1

I've got it working now. I was trying to find the reason for a hard fault and added some printfs for debugging. These however caused the LR confusion.

The original fault was because I was still building with the older cryptographic library (v3.0.0 I think).

I now have a working port to the discovery board.

2 replies

Jocelyn RICARD
ST Employee
February 1, 2021

Hi Arno,

The purpose of this __IS_SFU_RESERVED function is to check that dedicated SBSFU functions are called from SBSFU.

You should check which function is calling SE_Init. This function should be in SBSFU address range.

SE_Init itself should be located in the SE interface address range.

So, only question: what function called SE_Init ?

Best regards

Jocelyn

Arno1
Arno1Author
Senior
February 2, 2021

Hi Jocelyn,

It fails at start, here is the order of execution:

main.c: main
sfu_boot.c: SFU_BOOT_RunSecureBootService
sfu_boot.c: SFU_BOOT_Init
se_interface_bootloader.c: SE_Init
Fails here

Could it be the SBSFU is somehow loaded in the wrong range?

Best regards,

Arno

Arno1
Arno1AuthorBest answer
Senior
February 5, 2021

I've got it working now. I was trying to find the reason for a hard fault and added some printfs for debugging. These however caused the LR confusion.

The original fault was because I was still building with the older cryptographic library (v3.0.0 I think).

I now have a working port to the discovery board.