SBSFU with SFI conflict and have made my board inaccessible.
Hello,
I am developing a new product with the STM32h753, and we are trying to use both SBSFU and SFI. The secure boot implementation was already integrated and working before tackling SFI. When tackling SFI, I first tested it with a simple program without secure boot. This worked perfectly, exactly as advertised. Then I tried using SFI on our debug binary. This binary was the combined SBSFU + User application binary where the bootloader exists at the normal program counter and the user application exists in the first slot. This version of our bootloader had all the protections disabled. (RDP 0 WRP 0 etc.). This is the working firmware of our application, and I tested it with normal programming before testing SFI. So finally I build the SFI image to test the SFI and the STM32CubeProgrammer had some errors, but it seems to complete correctly. Then the device became inaccessible. I tried accessing the device with USB and UART while enabling boot 0 as well as STLINK and the device just doesnt seem to exist. What happened here? The options bytes were not set to any heavy restrictions, so this should not have happened right? I have copied the STM32CubeProgrammer log from the failed SFI process below:
12:44:31 : Requesting Chip Certificate from device ...
12:44:32 : Get Certificate done successfully
12:44:32 : requesting license for the current STM32 device
12:44:32 : Init Communication ...
12:44:32 : P11 lib initialization Success!
12:44:32 : Opening session with slot ID 1...
12:44:32 : Succeed to Open session with reader slot ID 1
12:44:33 : Succeed to generate license for the current STM32 device
12:44:33 : Closing session with reader slot ID 1...
12:44:33 : Session closed with reader slot ID 1
12:44:33 : Closing communication with HSM...
12:44:33 : Communication closed with HSM
12:44:33 : Succeed to get License for Firmware from HSM slot ID 1
12:44:33 : Starting Firmware Install operation...
12:44:33 : Activating security...
12:44:33 : Warning: Option Byte: SECURITY, value: 0x1, was not modified.
12:44:33 : Warning: Option Bytes are unchanged, Data won't be downloaded
12:44:33 : Time elapsed during option Bytes configuration: 00:00:00.057
12:44:33 : Activating security Success
12:44:33 : Setting write mode to SFI
12:44:33 : Warning: Option Byte: BCM4, value: 0x0, was not modified.
12:44:33 : Warning: Option Byte: BCM7, value: 0x1, was not modified.
12:44:33 : Warning: Option Byte: SECURITY, value: 0x1, was not modified.
12:44:33 : Warning: Option Byte: ST_RAM_SIZE, value: 0x3, was not modified.
12:44:33 : Warning: Option Bytes are unchanged, Data won't be downloaded
12:44:33 : Time elapsed during option Bytes configuration: 00:00:00.055
12:44:33 : Succeed to set write mode for SFI
12:44:33 : Starting SFI part 1
12:44:33 : Writing license to address 0x24020800
12:44:33 : Writing Img header to address 0x24021000
12:44:33 : Writing areas and areas wrapper...
12:44:41 : Sending Go command...
12:44:42 : Reconnecting...
12:44:43 : Error: Target device not foundEstablishing connection with the device failed
12:44:43 : ...retrying...
12:44:43 : Error: Target device not foundEstablishing connection with the device failed
12:44:43 : ...retrying...
12:44:44 : Error: Target device not foundEstablishing connection with the device failed
12:44:44 : ...retrying...
12:44:45 : USB speed : Full Speed (12MBit/s)
12:44:45 : Manuf. ID : STMicroelectronics
12:44:45 : Product ID : DFU in FS Mode
12:44:45 : SN : 200364500000
12:44:45 : DFU protocol: 1.1
12:44:45 : Board : --
12:44:45 : Device ID : 0x0450
12:44:45 : Reconnected !
12:44:45 : SECURITY State Success
12:44:45 : Starting SFI part 2
12:44:45 : Writing license to address 0x24020800
12:44:45 : Writing Img header to address 0x24021000
12:44:45 : Writing areas and areas wrapper...
12:44:50 : all areas processed
12:44:50 : Sending Go command...
12:44:50 : Warning: Could not verify security state after last chunk programming
12:44:50 : SFI Process Finished!
12:44:50 : SFI file Install Operation Success
12:44:51 : Warning: Connection to device 0x450 is lost
12:44:51 : Disconnected from device.
