Contents AN5056
2/49 AN5056 Rev 8
Contents
1 General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 Related documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3 Porting X-CUBE-SBSFU onto another board . . . . . . . . . . . . . . . . . . . . . 9
3.1 Hardware adaptation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2 Memory mapping definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2.1 SBSFU region definition parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.2.2 Firmware image slot definition parameters . . . . . . . . . . . . . . . . . . . . . . 14
3.2.3 Project-specific linker files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2.4 Multiple image configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.3 Dual-core adaptation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4 SBSFU configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.1 Features to be configured . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.2 Cryptographic scheme selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.3 Security configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.4 Development or production mode configuration . . . . . . . . . . . . . . . . . . . . 25
5 Generating a cryptographic key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.1 Generating a new firmware AES encryption key . . . . . . . . . . . . . . . . . . . 27
5.2 Generating a new public/private ECDSA pair of keys
for firmware verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.3 STM32WB Series specificities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.4 KMS specificities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.5 STSAFE-A110 specificities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
6 Tips for debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
6.1 Compiler optimizations level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
6.2 Memory mapping adaptation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
6.3 Debugging SECoreBin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7 Adapting SBSFU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34