TODAY | STM32 Summit 2026
Ask questions and find answers on STM32 security frameworks and tools, including cryptographic libraries, TrustZone, and the Secure Manager.
Most recent activity
I am using mbedtls module to verify the signature of firmware using RSA and its giving MBEDTLS_ERR_PK_INVALID_PUBKEY after parsing the public key. I am using OpenSSL for generating public and private keys the public key is generated using openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048andopenssl rsa -pubout -in private_key.pem -outform DER -out public_key.derin der format and then converted to a .h file using python -c "data=open('public_key.der','rb').read(); print('const unsigned char public_key_der[] = {'); print(', '.join(f'0x{b:02x}' for b in data), end=''); print('};'); print(f'const unsigned int public_key_der_len = {len(data)};');" > public_key.hIn the mbedtls_config.h file I have enabled the following things#define MBEDTLS_PKCS1_V15#define MBEDTLS_PK_C#define MBEDTLS_PK_PARSE_C#define MBEDTLS_RSA_C#define MBEDTLS_BIGNUM_C#define MBEDTLS_ASN1_PARSE_C#define MBEDTLS_OID_CHere is the main function I am using to parse the public
Hi, I am using ADC1 on stm32H563ZI nucleo board with trustzone enabled, I am not getting proper adc values (getting adc count of 822). When trust zone is disabled I am getting proper value of around 4095 with input of 3.3Volt .I am attaching the project.Please help with this issue.
I’m using STM32WL5MOCH6STR and want to add STSAFE-A110 for security in a LoRaWAN application.I want to know:How to use STSAFE-A110 for authentication, key storage, encryption and secure boot & secure firmware update.Which software packages are needed to implement this security feature(like X-CUBE-STSAFE, X-CUBE-LRWAN, or others)?Is there any example or application note for STM32WL + STSAFE-A110 integration?Kindly let me know if there are any ways or recommended methods to achieve security with help of STSAFE-A110 with STM32WL MCUs.Thanks in advance!
Hello STM32 Community,I’ve successfully built a Zephyr RTOS blinky application for the NUCLEO-H533RE board. Flashing the zephyr.hex using west flash or STM32CubeProgrammer works perfectly — the LED blinks and the serial terminal prints the expected status messages.To enhance security, I’m now trying to encrypt and sign the firmware using STM32TrustedPackageCreator and provision the board using STiROT. I followed the STM32CubeH5 GitHub examples and used the STiROT_Code_Init_Image.xml file, modifying it to point to my zephyr.bin. Provisioning was successful, and the board state was set to PROVISIONED.However, after flashing the generated zephyr_enc_sign.hex, the board does not blink, and the serial terminal remains silent — indicating the firmware is not executing.Here’s what I’ve done:Used STiROT/Image/STiROT_Code_Init_Image.xml and modified paths to point to zephyr.bin.Generated the encrypted and signed image using STM32TrustedPackageCreator.Successfully provisioned the board and set i
Hi,I come to you about the key provisioning process for the iROT in the STM32H5.Using TrustedPackageCreator, the keys provided in the file STiROT_Config.xml for the Secure Boot (field <Authentication key>) are both the private and public keys of the .pem file. However, only the public key is needed, and will be embedded in the device. This method of provisioning is limiting for us for two reasons:- on the one hand, it doesn't allow to subcontract the provisioning task, as we don't want to give the private key to the subcontractor- secondly, the private key may be generated by an HSM and cannot leave the vault. So, is there a way to provision only the public key at this stage? Best regards,Christine
Hello,I'm using STM32F439 with LWIP, SNMPv3, and mbedTLS, without FreeRTOS. I've encountered a performance issue when using the hardware acceleration for AES and SHA1 provided by ST (aes_alt.c, sha1_alt.c).Specifically, when decoding SNMPv3 messages, the software implementation of AES128 + SHA1 from mbedTLS is significantly faster than the hardware-accelerated version. I measured the execution time of snmp_receive() using a timer:- mbedTLS software AES128 + SHA1: ~800 µs- mbedTLS + ST-provided hardware AES (aes_alt.c) + SHA1: ~2.4 msThis is a 3x slowdown when using the hardware path.Can anyone explain why the hardware implementation is slower? Is this expected behavior due to HAL overhead, lack of DMA, or something else?Thanks in advance for any insights!Best regards, Piotr
Hi everyone,We’re developing an IoT node for agricultural applications and plan to make it compliant with certification requirements (CE, CRA, RED).We’re using the X-CUBE-AZURE package as our starting point and want to use TF-M (Trusted Firmware-M) for security.We’re new to cybersecurity and TrustZone, so I’d like to ask the community:Which peripherals and parts of the application stack should be implemented on the secure side of TF-M in this case?In our design we have various interfaces: UART, I2C, SPI, Wi-Fi module, Digital I/O, Analog I/O, CANBus, Modbus, and SDI-12.Which of these should be configured as secure or non-secure, and which parts of the Azure IoT stack are typically expected to run in the secure vs non-secure world?Any practical examples or recommendations based on your experience with X-CUBE-AZURE and TF-M would be very helpful. Thanks in advance!
I’m working with a NUCLEO-H533RE board (STM32H5 series, TrustZone enabled) and using ST-LINK for debugging.Here is the issue:Debug Authentication succeeds (certificate-based).Immediately after, the tool disconnects and shows:Error: Unable to get core ID Error: Cannot connect to access port 1! If you are trying to connect to a device with TrustZone enabled please try to connect with HotPlug mode. If you are trying to connect to a device which supports Debug Authentication with certificate and password, please open your device using it.Log shows:SDMAuthenticate: Authentication successful Debug Authentication Success Disconnected from device. ST-LINK FW: V3J16M8 Board: NUCLEO-H533RE Voltage: 3.28VST-Link configuration:Port: SWDMode: HotPlugAccess Port: 0Reset Mode: Software ResetSWD Frequency: 8000 kHzShared: DisabledI've tried:HotPlug Mode as recommended for TrustZone.Debug Authentication with valid certificate and key.ST-Link firmware is up to date.Still, after authentication, I cannot
Hello,My device contains both a bootloader and an application. I’m currently trying to protect the bootloader using PCROP on the STM32G0B1.As a first approach, I attempted to configure PCROP using STM32CubeProgrammer. However, this failed — once PCROP was activated for the bootloader region, the bootloader was unexpectedly erased.Here’s what I did:Flashed the bootloader to address range 0x08000000–0x0800BFFF.Activated PCROP by setting the start and end addresses for the bootloader region (see screenshot below). After this, the bootloader was erased.Even when I deactivated PCROP_END, the result remained the same — the bootloader was still erased.I would greatly appreciate any insights into why this is happening and how to properly activate PCROP without losing the bootloader.Best regards,Alexander
Hi ST team,I am using STM32U5G9 as secondary MCU. It has simple firmware upgrade feature. It would be reset by main MCU and enter system memory bootloader using Boot0 pin. The system memory bootloader would receive upgrade image (application) from main MCU by USART and write the image into internal flash. (AN3155 and AN2606)This method is simple but it does not have any sercrity feature. I would like to ask if I could add MCUBoot and secure boot into this method with minimum effort?1. System memory bootloader would receive signed image (application) from main MCU and write it into non-secure area.2. Exit system memory bootloader and enter secure boot3. Secure boot verifies the authenticity and integrity of the application.4. Execute the application.Is this possible?
Hi.During production, we use USB to test the board. Finally, the MCU is supposed to be password-protected against flash reads. Unfortunately, it turns out that as long as the USB cable is connected, it's impossible to program the OBK. Segger Device Provisioner returns an "Error writing OBK". Using STLink and CubeProgrammer also doesn't work. After disconnecting the USB, changing the state to Closed works. BOOT0 is connected to ground. Is there a solution?Artur
Hi, I have a doubt. I made some changes in the secure bootloader to achieve certain functionality, but I am unsure whether the code in the secure bootloader is developed by ST (such as drivers or APIs), or if it is intended for user modifications. Specifically, I modified the sfu_interface_crypto_scheme.c file to achieve my functionality.As far as I understand, apart from the Secure Engine project and the we can't modify Bootloader project HAL and LL APIs, CMSIS APIs, and middleware like Secure Engine, KMS, and Crypto. Please correct me if I am wrong.For reference, I am using the STM32WLE5CC controller.
Hi Team, I am working on project where we are implementing Secure upgrade feature using SBSFU package, we followed the steps as mentioned by ST community and to integrate SBSFU in our project. we have two modes Debug mode and Release mode.in Debug Mode: below Protection flags are disable#define SFU_WRP_PROTECT_ENABLE#define SFU_RDP_PROTECT_ENABLE#define SFU_TAMPER_PROTECT_ENABLE #define SFU_DAP_PROTECT_ENABLEand bootloader and application are working fine. we can see the software upgrade is happening. In Release mode:all above Protection flags are enable. bootloader is not working I think it is not coming up properly.I can see through STMCubeprogrammer the protection changes applied to flash.worst part is, I couldn't debug bootloader code.it would be great somebody help me in building SBSFU in Release mode.Thanks in Advance.
Hello,In a project with STM32 using SBSFU in a U575 microcontroller, why can a local variable of type structure within a function cause failures or unexpected behaviour in the secure zone, while a global variable of the same type works correctly?
Section 6.1 of AN5056 (for X-CUBE-SBSFU) states that the projects are delivered with the highest level of compiler optimizations turned on for size aspects.If the Optimization Level was set to 'None', then how much larger is the generated code expected to grow for the mapped regions (SE, SBSFU, etc.) excluding the image regions? (% increase in general)Which of the regions will be impacted the most?Update: To aid debug via IAR EWARM, I prefer to develop without any optimizations enabled, understanding that the code output size will be larger. I have no issues if the mappings are allowed to be adjusted to accommodate the larger code outputs.
Hello , I am trying to calculate a MAC using `cmox_mac_compute()` from this lib on an STM32L562 in the Secure code.The code looks like this :auto r = cmox_initialize(NULL); /*default template with stm32l5xx.h included*/ auto ret = cmox_mac_compute(CMOX_CMAC_AES_ALGO, in, in_s, key, 16, NULL, 0, out, 16, NULL);This exact code works when run on non secure mode if everything is set as non secure in stm32CubeMX.I tried to debug the library to understand what was wrong and found out that the issue comes from the fact that cmox_mac_compute tries to access my crc peripheral from 0x40023000 instead of 0x50023000 (CRC non secure and secure addresses).I am also almost sure that my GTZ and SAU are correctly set because i was able to write at address 0x50023000 and not at 0x40023000 when running from Secure code.I also have :CRC_BASE_S => 0x50023000 CRC_BASE_NS => 0x40023000 CRC_BASE => 0x50023000So this looks fine. I also tried to forcefuly set CRC_BASE_NS to
Hello! I want to implement secure boot / secure firmware install on my STM32u5A9 custom board. I am starting by trying to modify the SBSFU example code from B-U585I-IOT02A example project to run on my board. I followed the instructions in the README to tailor the project for STM32U5A9. I also made the following changes:My debug terminal is connected to UART5 so I modified the com.h file (attached snippet below)I also changed TFM_TAMPER_ENABLE in boot_hal_cfg.h to NO_TAMPER as I was initially having trouble with that engaging during my testing.I uncommented the MCUBOOT_EXT_LOADER in Linker/flash_layout.h as our custom board has an external flash chip but its pinout is different than the standard dev boards and I have not gotten any of my attempts at a custom loader to work. I’m trying to get secure boot working without an external loader first.Running SBSFU_Update.sh (as is from the B-U585I-IOT02A project) results in successful programming and verification of sbsfu_app_init.b
We have an application running on an STM32WB55M. This user application makes use of standby mode, and the device is able to exit it when the configured pin changes state.However, once the SBSFU is integrated with the BLE_ota application, the user application works correctly, we can perform OTA updates, but when entering standby mode, the device does not wake up/resets.In another different product, where standby mode is not used, everything operates correctly.What could be causing the system not to exit standby mode when the SBSFU is integrated? I know the system restarts upon exiting standby mode, do I need to configure something before entering standby mode? (Restarting the application with the 'NVIC_SystemReset' function, as I do when entering OTA mode, works correctly).Thank you in advance.
Hello,STSELib development is under progressToday (version 1.1.4), STSELib uses some services from STM32_Cryptographic library instead of interfacing STSAFE-A120 component (for example HKDF)Is there any development planning for STSELib giving availability of next versions and their content ?Thx
hello, I'm run a STM32H573DK in OEMiROT example.but following errors occured.[INF] TAMPER Activated[INF] BANK 1 secure flash [0, 15] : OB [0, 14][ERR] Unexpected value for secure flash protection so, I find why occurred this error. In the ob_flash_programming.bat file, sec1_end was set to 0x0E. but In the code end value is set to 0x0F end = (S_IMAGE_PRIMARY_PARTITION_OFFSET + FLASH_S_PARTITION_SIZE - 1) / PAGE_SIZE;( end = 0x1E000 / 0x2000 = 0x0F ) what is correct? what do i fix? ps. I'm using STM32Cube_FW_H5_V1.1.1
Hello @Jocelyn RICARD ,I’m integrating SBSFU v2.7.0 on an STM32WB55 to enable secure OTA firmware updates. I’m hitting a problem where the runtime hash verification fails: the hash computed by SBSFU at boot does not match the hash in the image header, so the image is erased.I dump the decrypted bytes in RAM (before programming) over LPUART and convert them to a binary for comparison with the build output. Assuming the dump/conversion are correct, the streams match up to ~60 KiB, then diverge consistently until the end of the file. This suggests the symmetric key is correct and the early pipeline is fine, but later bytes are corrupted before or during the decrypt-in-place / program sequence.Here is how printing every decrypted chunk within DecryptImageInPlace function:For context, I'm using:Internal MCU flashSingle-bank (no swap/rollback)OTA via ST BLE Sensor appProtections temporarily disabled for debugging; verbose logs enabledWhat worksRan 1_Image example on NUCLEO-WB55RG succes
Hello everyone,I am working with the STM32H7B3-DK and evaluating the SBSFU package with a dual image slot configuration using SECBOOT_ECCDSA_WITH_AES128_CBC_SHA256. I have a few questions and kindly request your guidance:Please confirm if we can load sbsfu.bin or sbsfu.out via USART with BOOT0 = 1 and then program UserApp.sfb via the secure bootloader (BOOT0 = 0). Do we need a header bin? If yes, how can we merge only sbsfu.bin and the header bin while excluding UserApp.bin?With RDP Level 2 set, is it still possible to update UserApp.sfb via USART when BOOT0 = 0?Can SFU_SECURE_USER_PROTECT_ENABLE be enabled or disabled during development, and can reprogramming still be done via USART or SWD outside development mode?During development, can we disable all security IPs, load sbsfu_userapp.bin, and later enable protections over USART followed by a power cycle? Is this workflow possible?If RDP Level 1 is configured, can option bytes and protections (PCROP, secure user area) be reset v
Hello,I’m working on STM32H7 firmware using the STM32 Cryptographic Library (CryptoLib) for firmware decryption.I have the following scenario:Firmware is encrypted with AES128-GCM.Integrity and authenticity are verified separately using ECDSA + SHA-256.I want to decrypt firmware using AES-GCM in counter mode (CTR) without relying on the GCM authentication tag.My questions are:Does AES-GCM in STM32 CryptoLib support CTR-only operation, bypassing the Galois-field authentication step?If not, is there a recommended way to perform AES-CTR decryption using CryptoLib on STM32H7 without tag verification?Are there any known limitations or caveats when skipping GCM tag verification in STM32H7 CryptoLib?Thanks in advance for guidance.@Jocelyn RICARD @Fred
To secure USB against unauthorized usage while maintaining regular operation, implement authentication and encryption for all USB communication, ensuring only authorized devices or users can access the interface for parameter and log management, open-source information, and updates.1. how to enable and disable the stm32 for booting using a debug probe / stm32 flasher from unauthorized access2. How to enable and disable the USB access from Unauthorized access3. Even after locking also authorized user can read and write in the stm32we can do it manually by setting the RDB for read access and WRP for write access but we want it to do it at runtime in software.
Hi All, Does anyone know how to enable the MCO2(PC9) output after secure manager enabled? its work in project without secure manager and it could be enabled in systemClock config function as below: ,but it's not work any more after secure manager on,and we could not call system clock config any more(the demo in repository v1.5.0 are calling).Summarize:1.How to enable MCO2 output in non-secure application;2. It seems after trustzone enabled, rcc would not work in non-secure side, is the demo on repository right or not(call system clock config)? Thanks!
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.