2022-01-19 06:04 PM
Device - STM32H7B3I-DK
Project - STM32H7B3I-DK\Applications\2_Images_ExtFlash
Here app images should be placed in Internal flash and GUI resources(> 15 MB) should be placed in external flash.
Solved! Go to Solution.
2022-01-20 12:00 AM
Hello @Community member,
the SBSFU supports up to 3 active slots with ability to have associated download slots.
In your case, you can have one active slot for your internal flash code and a second active slot for your GUI resources in external flash.
As usual, you can have 1 image or 2 images setup.
In 1 image setup, you can update using a local loader, first erasing the target slot and the updating it.
In 2 image setup, you need at least 1 download slot with size equal to maximum active slot size.
In this setup, you can manage the update through your application in OTA for instance.
So, in your case, if you have a 16MB GUI ressource active slot, you would need at least 16MB download slot to be able to update this part. You can have one other dedicated download slot associated to your internal flash code, either in internal flash or external flash.
Best regards
Jocelyn
2022-01-20 12:00 AM
Hello @Community member,
the SBSFU supports up to 3 active slots with ability to have associated download slots.
In your case, you can have one active slot for your internal flash code and a second active slot for your GUI resources in external flash.
As usual, you can have 1 image or 2 images setup.
In 1 image setup, you can update using a local loader, first erasing the target slot and the updating it.
In 2 image setup, you need at least 1 download slot with size equal to maximum active slot size.
In this setup, you can manage the update through your application in OTA for instance.
So, in your case, if you have a 16MB GUI ressource active slot, you would need at least 16MB download slot to be able to update this part. You can have one other dedicated download slot associated to your internal flash code, either in internal flash or external flash.
Best regards
Jocelyn
2022-01-20 01:02 AM
Thanks @Jocelyn RICARD for the answer :thumbs_up:
Below is direction am moving forward to experiment slots
#define SFU_NB_MAX_ACTIVE_IMAGE 2U /*!< 2 active image managed */
#define SFU_NB_MAX_DWL_AREA 2U /*!< 2 dwl area managed */
#define MASTER_SLOT SLOT_ACTIVE_1 /*!< SLOT_ACTIVE_1 identified as master slot */
Linker file define Active slot 2 and download slot 2 area.
/* Slots must be aligned on sector size */
/* Swap sector : 128 kbytes */
__ICFEDIT_SWAP_start__ = 0x90800000;
__ICFEDIT_SWAP_end__ = 0x9081FFFF;
/* Active slot #1 in external memory : 4 Mbytes
Header located into internal flash to be protected by secure area but
out of WRP protection areas (SBSFU + standalone loader)
*/
/*__ICFEDIT_SLOT_Active_1_header__ = 0x08010000;*/
__ICFEDIT_SLOT_Active_1_start__ = 0x08020000;
__ICFEDIT_SLOT_Active_1_end__ = 0x081DFFFF;
__ICFEDIT_SLOT_Active_1_header__ = __ICFEDIT_SLOT_Active_1_start__;
/* Dwl slot #1 : 4 MBytes */
__ICFEDIT_SLOT_Dwl_1_start__ = 0x90400000;
__ICFEDIT_SLOT_Dwl_1_end__ = 0x905BFFFF;
/* Slots not configured */
__ICFEDIT_SLOT_Active_2_start__ = 0x92800000;
__ICFEDIT_SLOT_Active_2_end__ = 0x93FFFFFF;
__ICFEDIT_SLOT_Active_2_header__ = __ICFEDIT_SLOT_Active_2_start__;
__ICFEDIT_SLOT_Active_3_header__ = 0x00000000;
__ICFEDIT_SLOT_Active_3_start__ = 0x00000000;
__ICFEDIT_SLOT_Active_3_end__ = 0x00000000;
__ICFEDIT_SLOT_Dwl_2_start__ = 0x91800000;
__ICFEDIT_SLOT_Dwl_2_end__ = 0x92FFFFFF;
__ICFEDIT_SLOT_Dwl_3_start__ = 0x00000000;
__ICFEDIT_SLOT_Dwl_3_end__ = 0x00000000;
Follow up question for GUI resources can it we compress and place it at slot 2 __ICFEDIT_SLOT_Dwl_2_start__ decompress and place the GUI resources in __ICFEDIT_SLOT_Active_2_start__
any suggestion on adding compression plugin to SBSFU project. Have been trying with xz compression its giving a good compression ratio for GUI blob.
2022-01-27 07:05 AM
Hello @Community member ,
First, the download slot for slot1 does not need to be bigger than active slot.
Same size is OK.
Also, you can use same download slot for the 2 active slots if update can be done independently.
Regarding your GUI resource slot, I have no specific suggestion about the compression algorithm, all depends on your own constraints.
Anyway, a suggestion would be to make it transparent to SBSFU by handling the decompression inside your application after the download.
Best regards
Jocelyn