SBSFU - Build Structure
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
- MCU: STM32 (Cortex-M series)
- Bootloader: SBSFU
- Application: Custom firmware using HAL, middleware, and CubeMX-generated code
- Development tool: STM32CubeIDE
Challenges I’m Facing
1. Shared Drivers & Middleware
Both my bootloader and application require:
- HAL Drivers
- Some middleware components
What is the best way to manage duplication vs sharing?
- Should bootloader and application maintain completely separate copies of Drivers/Middleware?
- Is there any recommended way to keep them in sync without tight coupling?
2. Impact of .ioc Changes
I use CubeMX via .ioc for peripheral configuration.
If I:
- Add a new peripheral
- Modify clock or pin configuration
How should this be handled without breaking SBSFU?
- Should bootloader and application always have separate .ioc files?
- Any best practices to avoid regeneration issues affecting secure boot?
3. Folder Structure for Maintainability
What is a recommended folder structure for:
- SBSFU Bootloader
- User Application
- Shared interfaces (if any)
Goal:
- Easy reuse across projects
- Clean separation of responsibilities
- Minimal integration issues
4. Crypto / Encryption Flexibility
I may want to experiment with different encryption schemes in the future.
What is the best way to:
- Abstract crypto implementation in SBSFU?
- Replace or extend existing encryption (e.g., AES-GCM)?
Are there any extension points/hooks provided in SBSFU for this?
5. Project Integration in CubeIDE
What is the recommended workflow to:
- Import SBSFU and Application projects into CubeIDE
- Manage them as separate or linked projects
- Build and flash step-by-step (bootloader + application + secure image)
6. References / Best Practices
Could you please suggest:
- Application notes
- Reference projects
- Real-world examples
especially for:
- Clean SBSFU + Application separation
- Maintainable architecture
- Production-ready setups
Goal
To build a robust, reusable, and scalable secure firmware update architecture using SBSFU that can support:
- Future feature additions
- Crypto changes
- Multiple applications
Any insights, architecture suggestions, or real-world experiences would be extremely helpful.
Thanks in advance!
