
Contents AN5056
2/27 AN5056 Rev 2
Contents
1 General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 Related documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3 Porting X-CUBE-SBSFU onto another board . . . . . . . . . . . . . . . . . . . . . 7
3.1 Hardware adaptation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 Memory mapping definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2.1 SBSFU region definition parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2.2 Firmware image slot definition parameters . . . . . . . . . . . . . . . . . . . . . . 11
3.2.3 Project specific linker files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4 SBSFU configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.1 Features to be configured . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.2 Cryptographic scheme selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.3 Security configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.4 Development or production mode configuration . . . . . . . . . . . . . . . . . . . . 16
5 Generating a new firmware encryption key . . . . . . . . . . . . . . . . . . . . . 18
6 Tips for debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
6.1 Compiler optimizations level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
6.2 Memory mapping adaptation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
6.3 Debugging SECoreBin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7 Adapting the user application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
7.1 Application running in Slot #0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
7.2 Use of the Flash memory to store user data . . . . . . . . . . . . . . . . . . . . . . 22
7.3 Adding an SBSFU compliant firmware download procedure
in the user application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
7.4 Implementing a new cryptographic scheme for SBSFU . . . . . . . . . . . . . . 24
8 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26