2022-04-06 03:02 PM
For sbsfu in the following parts:
In AN5056 rev6, see section 8.5 How to validate a firmware image.
In UM2262 rev8, Appendix J
It says: At the first user application start-up, if the execution is correct (for example after self-tests execution) the user application must call a running service SE_APP_Validate(slot_id) if available or update dedicated flags in RAM otherwise to validate the firmware image.
What dedicated flags are those? How can I know about the slot_id?
2022-04-20 11:43 AM
Hello @hotuz.1 ,
the SBSFU package contains example of such implementation.
For instance on L4:
Projects\NUCLEO-L476RG\Applications\2_Images\2_Images_UserApp\Src\fw_update_app.c
And on L4+
Projects\B-L4S5I-IOT01A\Applications\2_Images_KMS\2_Images_UserApp\Src\fw_update_app.c
For L4/L4+ you don't need to use dedicated flags as you can directly call SECoreBin service.
Best regards
Jocelyn
2022-04-21 11:03 AM
The X-CUBE-SBSFU Secure Boot and Secure Firmware Update solution allows the update of the STM32 microcontroller built-in program with new firmware versions, adding new features and correcting potential issues. The update process is performed in a secure way to prevent unauthorized updates and access to confidential on-device data. The Secure Boot (Root of Trust services) is an immutable code, always executed after a system reset, that checks STM32 static protections, activates STM32 runtime protections and then verifies the authenticity and integrity of user application code before every execution in order to ensure that invalid or malicious code cannot be run. The Secure Firmware Update application receives the firmware image via a UART interface with the Ymodem protocol, checks its authenticity, and checks the integrity of the code before installing it. The firmware update is done on the complete firmware image, or only on a portion of the firmware image. Examples are provided for single firmware image configuration in order to maximize firmware image size, and for dual firmware image configurations in order to ensure safe image installation and enable over-the-air firmware update capability commonly used in IoT devices. Examples can be configured to use asymmetric or symmetric cryptographic schemes with or without firmware encryption.