cancel
Showing results for 
Search instead for 
Did you mean: 

port SBSFU to an stm32f756 project

ali rostami
Associate III

Hi, I want to port SBSFU to my project which was written for the STM32F756VGT microcontroller by Keil.

So I have some questions regarding this situation.

At first, I took the `STM32F769I-Discovery` example of SBSFU as a base project that I need to make my changes to `2_Images_SBSFU` and `2_Images_SECoreBin` projects and also replace my project with `2_Images_UserApp` and also make some changes to it too.

so here I am, I want to change the addresses in mapping_fwimg.h.

  • Should I take the SWAP part as large as 256KB? -as it is the largest sector of flash-
  • I can't use a lower size than 256KB for the SWAP, right?
  • If it is so, how should I set the slot sizes? On page 14 of an5056, it says it should be multiple of swap size. so does it mean that I should use sector5 for slot0-256KB- and sector6 for slot1-256KB-?
4 REPLIES 4
Bubbles
ST Employee

Hi @ali rostami​ ,

I'm afraid specifically the STM32F756 doesn't offer much choice. Sectors 5, 6 and 7 are probably the best candidates to have slot 1, slot 0 and the swap area. Should you choose some other MCU, with smaller sectors, the swap size could be smaller.

For explanation of SWAP sector use, see UM2262 appendix B.

BR,

J

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thanks @JHOUD​ 

Oops, so bad.

so all of my understanding regarding my questions were right?

Hi @ali rostami​ ,

yes, that's right. If you choose 2x256kB sector for firmware slots, you need another 256kB sector for swap.

At least that's the default SBSFU mode of operation where swap is involved. In theory you could try to modify the SBSFU to some other method of image handling where swap was not necessary. With some compromise of course. It depends what you want to achieve and what do you need the second slot for.

BR,

J

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Piranha
Chief II

Many, if not the most, use cases doesn't even need 2 images or swap space. Those are necessary only in the case when there is a requirement to always have at least one complete and valid image. If the only requirement is that the user can always restore the device to working state, then a single image without a swap space and a proper bootloader is enough.