2026-04-10 3:17 AM - edited 2026-04-10 3:19 AM
Hi everyone,
I’m currently working with STM32 Secure Boot and Secure Firmware Update (SBSFU) and integrating it with my custom application. I’m trying to design the project in a modular and scalable way for long-term use, and I would really appreciate some guidance from those who have worked with SBSFU in production.
Current Scenario
Challenges I’m Facing
1. Shared Drivers & Middleware
Both my bootloader and application require:
What is the best way to manage duplication vs sharing?
2. Impact of .ioc Changes
I use CubeMX via .ioc for peripheral configuration.
If I:
How should this be handled without breaking SBSFU?
3. Folder Structure for Maintainability
What is a recommended folder structure for:
Goal:
4. Crypto / Encryption Flexibility
I may want to experiment with different encryption schemes in the future.
What is the best way to:
Are there any extension points/hooks provided in SBSFU for this?
5. Project Integration in CubeIDE
What is the recommended workflow to:
6. References / Best Practices
Could you please suggest:
especially for:
Goal
To build a robust, reusable, and scalable secure firmware update architecture using SBSFU that can support:
Any insights, architecture suggestions, or real-world experiences would be extremely helpful.
Thanks in advance!
2026-04-10 6:09 AM
Which STM32 MCU do you use? Different STM32's have different security mechanisms for SBSFU. If not decided yet, can you tell more about the requirements, this will help to choose the MCU.
> Should bootloader and application maintain completely separate copies of Drivers/Middleware?
Most likely yes. Because, with "hiding protection", when the app starts, the bootloader code "disappears" and cannot be called from the app. So you don't have to arrange for sharing any runtime code. The projects can be separate. Sharing the drivers & middlewares source code, of course, is possible.
> Should bootloader and application always have separate .ioc files?
Of course, hardware & clock settings of the bootloader and the app should be "harmonized" so that the app won't have to undo what the bootloader did. Basically, the bootloader sets up the environment for the app: if the app runs in external memory, it must be initialized with all dependencies (power, clocks) and the app obviously should not touch these settings in their startup code.
Outside of that, the app is free to enable and set up additional pins, peripherals etc. So if you later change the .ioc to add stuff for the app, you won't have to regenerate the code for bootloader. The same with multiple apps: different apps may need different changes in the .ioc, but as long as these changes do not affect the bootloader - no problem.
For experimenting with crypto methods you can use software simulators or Linux on ARM machines such as Raspberry Pi etc.
Good luck.
2026-04-29 8:29 AM - edited 2026-05-05 1:59 AM
Hello @Vinay_Shirol,
Sorry for the late response.
ST provides many SBSFU solutions, you can consult:
- Also this is ST SBSFU solutions and the supported boards : link
- The wiki to understand which solution is better for you link
From your previous questions, it seems that you are focused on SBSFU for STM32H7.
ST provides for that board X-CUBE-SBSFU a secure boot and secure firmware update solution.
This solution is highly opinionated, meaning it comes with a very predefined structure. It is not a middleware that you can simply drop into any project. ST provides examples that you can adapt and port to your own hardware and software requirements.
In each example, you will typically find 3 folders:
To answer your questions:
The bootloader and the application typically use the same HAL driver APIs, since both are developed for the same board.
For middleware, SBSFU comes with the necessary components: mbedTLS for cryptography, KMS (Key Management Services), the Secure Engine (which provides a secure environment), and STSAFE middleware (which provides APIs to access STSAFE-A110 devices).
You only add the middleware required for your specific needs.
.ioc ChangesYou normally do not configure the SBSFU project through CubeMX.
.ioc files.SBSFU/TargetYou can refer to AN5056, section 8, for user application porting guidance.
A common structure is:
The key goal is to maintain a clean separation of responsibilities.
SBSFU supports predefined crypto schemes controlled by the compiler flag:
SECBOOT_CRYPTO_SCHEME
Examples include:
SECBOOT_ECCDSA_WITH_AES128_CBC_SHA256 (default)SECBOOT_ECCDSA_WITHOUT_ENCRYPT_SHA256SECBOOT_AES128_GCM_AES128_GCM_AES128_GCMThese define:
If you want to implement a new cryptographic scheme, refer to AN5065, section 7.1, which explains how to implement a new crypto scheme for SBSFU.
For integration with CubeIDE:
Import the 3 projects
Make sure the required Python packages are installed:
Middlewares/ST/STM32_Secure_Engine/Utilities/KeysAndImages/requirements.txt
Build in the correct order:
For flashing: