SBSFU Abnormal error during swapping of downloaded firmware image
Hi,
I am facing untraceable issue with SBSFU. I integrated SBSFU features to our application running on device with 512kb flash.
After downloading the firmware, during the swapping, it is throwing some abnormal errors while writing to addresses 0x0803FE00, 0x0803EE00 and 0x0803DE00. Below is the error from the trace.
======================================================================
= (C) COPYRIGHT 2017 STMicroelectronics =
= =
= Secure Boot and Secure Firmware Update =
======================================================================
= [SBOOT] SECURE ENGINE INITIALIZATION SUCCESSFUL
= [SBOOT] STATE: CHECK STATUS ON RESET
INFO: A Reboot has been triggered by a Software reset!
Consecutive Boot on error counter = 0
INFO: Last execution detected error was:Error while swapping the images in slot #0 and slot #1.
= [SBOOT] STATE: CHECK USER FW STATUS
Installation Failed: resume installation procedure initiated
= [SBOOT] STATE: RESUME INSTALLATION OF NEW USER FIRMWARE
Image preparation done.
Swapping the firmware images........
Abnormal error 2 at line 1071 in C:/SBSFU_DEMO_HUD/STM32CubeExpansion_SBSFU_V2.3.0/Projects/NUCLEO-L432KC/Applications/2_Images/2_Images_SBSFU/SBSFU/App/sfu_fwimg_core.c - CONTINUE
= [SBOOT] STATE: HANDLE CRITICAL FAILURE
What I observed here is these 3 memory addresses will be having some data and they are not deleted on the time of writing new data. I assume this is causing the issue. But I am not sure why at only these addresses, memory is not cleared before writing. During the writing of data to these addresses, status registry FLASH->SR will be set to 168.
Below the memory distribution I am using for 512kb flash.
/* swap region (8 kbytes) */
__ICFEDIT_region_SWAP_start__ = 0x0800F000;
__ICFEDIT_region_SWAP_end__ = 0x08010FFF;
/* slot 0 region (216 kbytes) */
__ICFEDIT_region_SLOT_0_start__ = 0x08011000;
__ICFEDIT_region_SLOT_0_end__ = 0x08046FFF;
/* slot 1 region (216 kbytes) */
__ICFEDIT_region_SLOT_1_start__ = 0x08047000;
__ICFEDIT_region_SLOT_1_end__ = 0x0807CFFF;
