cancel
Showing results for 
Search instead for 
Did you mean: 

X-CUBE-SBSFU : Bootloader is really slow (6s) (STM32F429)

Peeters.Bram
Senior

I ported the SBSFU to an STM32F429 and everything works but it takes almost up to 6s (!) before the bootloader exits and jumps to the main application.

My application is about 1.3Mb (entire flash is 2Mb) so it is not exactly small, but 6s boot time is just unacceptable for my application.

After analysing the where this time is lost I see that SFU_IMG_VerifyActiveImg is called twice and takes 1.4s to run each time, and SFU_IMG_VerifyActiveSlot is called once which takes a whopping 2.8s. Are these expected times ? Why call SFU_IMG_VerifyActiveImg twice( not that it would help much to do it only once timing wise)

Apparently the sha256 calculation which is at the core of these is really slow.

Any suggestions for speeding this up ? At the moment I am thinking of trying to either replace this by a simple CRC32 ( if I recall correctly I manage to do that in 500ms ) or just skip these verification steps entirely.

10 REPLIES 10

Hi Eivor,

It's been a while ago now but I started from the example, changed the cpu etc in the project file (and downgraded the project file to iar 7.x which we are still using) , made sure the correct defines are set to be using 429 drivers instead of 413, configured the linker files to match our memory layout, and probably a lot of other small things that popped up along the way.

Then I modified the existing bootloader into something the customer wanted (with a gui, usb support to load new firmware, load files in emmc etc etc ).

I also remember disabling the MMU protections because there are only a limited number of 'zones' available and I needed more.

And I swapped out the verficiation algorithm with a simpeler CRC as noted above so the boot time was reduced to something acceptable.

I dont remember any particular big issues, but in the end it took a few weeks to get to the desired result (which as noted above has a lot of custom stuff).