Topic: I want to split my boot partion between internal and external flash

Hello is there any examples on a wolfBoot config that has the boot partion split between internal and external flash? I am trying to learn how to configure wolfboot for update swapping and boot authentication when the boot partion is not contiguous

Share

Re: I want to split my boot partion between internal and external flash

Hello ballen,

We do not support this feature currently, but by writing your own custom HAL functions, you can add support for it.  For more on wolfBoot HAL, see: https://github.com/wolfSSL/wolfBoot/blo … ocs/HAL.md
Our STM32F7 HAL is a good example, in particular see the array flash_sector.  You could use this code as a rough template and make these sectors non-contiguous:  https://github.com/wolfSSL/wolfBoot/blo … /stm32f7.c
I also wanted to note we do support external flash partitions, we just don't currently support splitting a partition without code changes.  For more on wolfBoot partitions, see: https://github.com/wolfSSL/wolfBoot/blo … titions.md

May I ask what platform you are using wolfBoot on?

Thanks,
Kareem

Share

Re: I want to split my boot partion between internal and external flash

Kinetis K81. We have the external QSPI memory mapped and have wolfBoot working with a boot partition external

Thanks for the example

Share

Re: I want to split my boot partion between internal and external flash

Hi Kareem, in the STM32 example how is the bootloader calculating the SHA256?

After writing my own HAL would I need to modify *get_sha_block()
https://github.com/wolfSSL/wolfBoot/blo … age.c#L346

to use my custom "hal_flash_read()"

Share

Re: I want to split my boot partion between internal and external flash

Hi ballen,

To accomplish a split partition between onboard and external QSPI you will need to implement your own custom image_sha256() function to have awareness of the partition geometry, since the SHA calculation is currently done on contiguous addresses.

We support the NXP Kinetis K82 hardware and the K81 is compatible. The FRDM-K82F board we use for testing has an external QSPI with XIP support, which I have used successfully. However, I have not tried setting up a split boot partition. If you would like some consulting help with this feature please email facts@wolfssl.com with some project details and we can quote this. If you would like to implement support and provide these changes upstream feel free to open a GitHub pull request.

Thanks,
David Garske, wolfSSL

Share