Cannot get working SBSFU 2 image example for F413H Discovery which ported to custom board with STM32F429
- November 3, 2020
- 4 replies
- 1970 views
Hello, in one my project I need to have SBSFU. On first version on my board I had STM32F405 uC and was successfully ported example STM32F413H_Discovery_2_Images_SBSFU. For test the porting I changed startup file in the discovery example for 405 series and make a bit chagings in functions which writing data to FLASH, also made changes for UART pins and the button. Same things I try to do fo STM32429VIT uC (2 Banks Flash) - but it not working, I have next errors in the UART terminal:
= [SBOOT] STATE: HANDLE CRITICAL FAILURE
= [EXCPT] SIGNATURE CHECK FAILED!
Cheking under debug I found the error became from firmware tag verification part in file
sfu_fwimg_core.c (see more in the attachment):
/* Firmware tag verification */
if (MemoryCompare(fw_tag_output, fw_tag, SE_TAG_LEN) != SFU_SUCCESS)
{
*pSeStatus = SE_SIGNATURE_ERR;
se_ret_status = SE_ERROR;
sfu_ret_status = SFU_ERROR;
memset(fw_tag_validated, 0x00, SE_TAG_LEN);
For the mapping_fwimg.h I used same address like for 405 uC ported project (all located in first bank of the flash) (see more in the attachment);
For the the mapping_sbsfu.h I used same address like in example for 413 and ported 405, just changed SB_REGION_RAM_END address according to my uC (see more in the attachment).
In document Porting X-CUBE-SBSFU onto another board in section 3.2.2 I found next information:
For dual-bank Flash memory devices, firewall specific constraints are:
• Firewall code segment must be in bank1, firewall non-volatile data (including header of Slot #0) segment must be in bank2.
• Firewall code and non-volatile data segments must have the same size and offset compared to the beginning of the bank.
the info not fully clear for me - I tried allocate Slot 0 in Bank 2, - same issue, but maybe I did it not correct;
If someone worked with it before (porting the SBSFU example to an another uC with dual - bank flash) - and understand my issue - please help me to understand what could be wrong.
Thanks!
