cancel
Showing results for 
Search instead for 
Did you mean: 

SBSFU - flash erase 0x0000 instead of 0xFFFF

STsch.1
Associate III

Hi,

I try to use the SBSFU in a project with a STM32F722 and so far it works to flash an initial firmware. Now what I would like to do is to update the firmware and for that, since I can only use one image because of the limited flash size, I corrupt the flash from the application level and trigger then a restart.

After the restart, I can see the following:

0693W00000HrFgpQAF.pngIt seems to erase the flash, but when I then have a look at the flash, everything is 0x0000 instead of 0xFFFF and I cannot update the flash anymore. Also the SVC_NVIC_SystemReset(); does only restart the application and not the bootloader, and I really don't want to restart a damaged application.

What I further would like to achieve is to boost the startup behaviour of the bootloader and this can be achieved according the referenece manual by stop checking the flash for corruption, but then I could not really use the method from above to destroy the firmware image, right?

What I would like to do with the SBSFU is the following:

  • I destroy the image header by writing 0x0000 into the flash
  • I trigger a restart and the bootloader starts again
  • The bootloader detects an invalid flash header (no need to check for corrupt flash over the whole sector)
  • The bootloader erases the WHOLE application sector (I don't need the anti-rollback check)
  • After this, I can flash a new firmware as it works initially.

Can I somehow achieve this and if so, how can I say the SBSFU to only check for the header corruption and erase the whole sector?

1 REPLY 1
Jocelyn RICARD
ST Employee

Hello @STsch.1​ 

There is no need to corrupt your firmware to force the installation of a new one.

In the example you have started from, there is an input GPIO connected to the user button that allows the forcing of the update. Pressing user button on startup will activate the update.

This activation can be also done by the application firmware itself by using a magic in SRAM for instance. Application writes this magic, and resets. SBSFU will read this specific SRAM location and will trigger an update. An implementation of this method is provided in the WB55 One image to activate the standalone loader.

Best regards

Jocelyn