Question
NUCLEO-L476RG 2 Images Configuration SBSFU firmware update failure
The download & decryption & swapping of the firmware looks fine at first sight.
But then a critical failure occurs because additional code is detected beyond the FW image.
======================================================================
= (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 Hardware reset!
INFO: Last execution status before Reboot was:Executing Fw Image.
INFO: Last execution detected error was: No error. Success.
= [SBOOT] STATE: CHECK NEW FIRMWARE TO DOWNLOAD
= [SBOOT] STATE: DOWNLOAD NEW USER FIRMWARE
File> Transfer> YMODEM> Send
[Ready to receive].[EOT].
FwSize=-16843010 | PartialFwSize=-16843010 | PartialFwOffset=-16843010 | 33632 bytes received
= [SBOOT] STATE: REBOOT STATE MACHINE
========= End of Execution ================================================================================
= (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!
INFO: Last execution status before Reboot was:Rebooting the State Machine
INFO: Last execution detected error was: No error. Success.
= [SBOOT] STATE: CHECK NEW FIRMWARE TO DOWNLOAD
= [SBOOT] STATE: CHECK USER FW STATUS
= [FWIMG] SLOT_ACTIVE_1 state = 1
New Fw to be installed from slot SLOT_DWL_1
= [SBOOT] STATE: INSTALL NEW USER FIRMWARE
= [SBOOT] RuntimeProtections: 0
33120 bytes of ciphertext decrypted.
Image preparation done.
Swapping the firmware images.....................................................
= Installation procedure completed.
= [FWIMG] FW installation succeeded.
========= End of Execution ================================================================================
= (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!
INFO: Last execution status before Reboot was:Installing new Fw Image.
INFO: Last execution detected error was: No error. Success.
= [SBOOT] STATE: CHECK NEW FIRMWARE TO DOWNLOAD
= [SBOOT] STATE: CHECK USER FW STATUS
= [FWIMG] SLOT_ACTIVE_1 state = 4
New Fw to be installed from slot SLOT_DWL_1
= [SBOOT] STATE: INSTALL NEW USER FIRMWARE
= [SBOOT] RuntimeProtections: 0
= [FWIMG] Additional code detected beyond FW image!
= Installation procedure cannot be finalized!
= [FWIMG] FW installation failed!
= [SBOOT] STATE: HANDLE CRITICAL FAILURE
= [EXCPT] FLASH ERROR!
= [SBOOT] STATE: REBOOT STATE MACHINE
========= End of Execution ==========The failure comes from the following function (in PrepareCandidateImageForInstall() in sfu_fwimg_swap.c):
e_ret_status = VerifySlot((uint8_t *) SlotStartAdd[DwlSlot], SLOT_SIZE(DwlSlot),
pFwImageHeader->PartialFwSize + (pFwImageHeader->PartialFwOffset %
SLOT_SIZE(SLOT_SWAP)));Any idea why this could be happening?
