The STM32HSM-V1 hardware security module (HSM) is used to secure the programming of STM32 products, and to avoid product counterfeiting at contract manufacturers' premises.
The SFI feature allows secure loading of customer firmware to STM32 products embedding a secure bootloader. For further information on this feature, refer to the AN4992 application note available from st.com.
After defining the firmware encryption key and encrypting their firmware, the original equipment manufacturer (OEM) stores the encryption key to one or more STM32HSM-V1 HSMs and sets the number of authorized SFI operations (counter value) using the STM32CubeProgrammer and STM32 Trusted Package Creator software tools. Contract manufacturers must utilize the STM32HSM-V1 HSMs to load encrypted firmware to STM32 devices: each HSM only allows the OEM-defined number of programming operations before being irreversibly deactivated.