cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4A6 with SBSFU and external flash

jmcoreymv
Associate

Hi,

I'm trying to get started with the SBSFU (2.6.2) on my custom board running an STM32L4A6.  I've got a large external SDMMC flash chip (4GB) connected to the STM32 that I use for user application purposes.  I'd like to allocate a small section of this chip to act as the download slot for the SBSFU, but I want to understand the implications, if any, for the SBSFU.

I've read through the SBSFU User Manual and Integration Guide, but I'm still not completely sure on the following:

1. I'd like to be able to use the full STM32 internal flash space for a single image, and have my download slot be in the external flash.  So basically a 2_Images config with external flash.

2. I saw one of the examples in SBSFU package is a 2_Images config with external SPI flash, so I think I'd just be modifying this example to include the drivers for the SDMMC flash instead of SPI?

3. Will I still be able to store the downloaded image as an encrypted image in the external flash, even though my chip doesn't support OTFDEC? I'm okay with using the default AES-CBC mode.

Is there anything about this approach I should be aware of?

Thank you

2 REPLIES 2
Jocelyn RICARD
ST Employee

Hello @jmcoreymv ,

yes the project Projects\B-L475E-IOT01A\Applications\2_Images_ExtFlash\ is a good starting point for your use case.

You will not be able to use the full internal flash space for a single image. You need to take into account the secureboot used space. I guess this is what you meant.

The image that you will download in external flash is the .sfb file that is encrypted if you use default crypto scheme.

Now, in this case the SBSFU is setup in NOSWAP (#define SFU_NO_SWAP  in app_sfu.h) meaning that during installation of a new firmware, the old firmware will be erased and replaced by the new one. If this installation is interrupted by a reset, SBSFU will restart it on next boot.

Best regards

Jocelyn

HI @Jocelyn RICARD 

Thanks for the response.  Could you help clarify the last paragraph regarding the NOSWAP implications?  If there is no image swapping going on, and the old firmware is erased and replaced by the new one, then there is no ability to 'rollback' to the original firmware if the new one fails any sort of validation checks?  Is that correct?

However, I think what you were saying is that if the power is interrupted during a copy of the image from download to active, the SBSFU can resume and complete the copy to use the new image?

Thanks!