Get ready for the STM32 Summit 2026 | Online, November 3
Ask questions and find answers on STM32 security frameworks and tools, including cryptographic libraries, TrustZone, and the Secure Manager.
Most recent activity
Hi,I am using STM32H56x with OEMiROT_Boot example project, and I use MCUBOOT_SWAP_USING_SCRATCH to install application images, is there an API like boot_set_confirmed( ) can used by secure applicaiton code, or a confirmation flag in SRAM like STM32H7?Thank you,Snaku
Hello, I have an STM32H755 nucleo board and I want to use the secure memory area features but I need to clarify my understanding of the reference manual "rm0399" and some follow up questions.My understanding is that:From my normal code (non-secure) in standard mode you enable secure access mode.Then an MCU reset is triggered.Then from my normal code in secure access mode I call RSS_resetAndInitializeSecureAreas that is mentioned in page 258 in the reference manual with the memory area I need to setup to be my secure code and this request triggers a reset.After reset the MCU enters the RSS ROM instead of my normal boot code and then it jumps to my secure code that won't exit it until the API RSS_exitSecureArea.Q1: If I don't call the RSS_exitSecureArea can I keep the secure code running on CM7, Can I run a normal non-secure application on CM4?Q2: Does the RSS have a feature to authenticate a bootloader code and if the answer is yes, where is that documented?
All the provided examples are using USART YMODEM to transfer data. I know, that it really doesn't matter what kind of protocol you use as long as image is placed in a correct place in the memory, but I wonder if I can use DFU feature to update firmware and still use SBSFU. Additionaly is there any reference or resource that supports we only have to upload .sfb file and we can't use .bin file? If we have to use .sfb file only then what is the correct method of downloading it because we can't download .sfb file through cli as it doesnot support .sfb extension and same I am not able to upload it through STM32 CUBE Programmer.
Hi Team,Firmware file are just signed not encrypted through STM32 SigningTool - stm32mcu (STM32_SigningTool_CLI.exe) after generating public and private keys through STM32_KeyGen_CLI.exe.Public key in raw 64 bytes is provided to bootloader_main.c as constant and hash is calculated from firmware data file after placing it at known location.Able to verify magic number as after signing a firmware file a header of 256 bytes is placed at top but failing to verify ECDSA signature. Using API ECDSAverify from legacy_v3 cryptographic library to verify signature.Please anyone help me with example as a reference to know where it is getting wrong.
HelloDo I unterstand correctly that the recommended secure boot option for STM32L4 is SBSFU?It seems that the only resource on how to get started with examples is the playlist on YouTube where a non signed exe from google drive has to be installed.Is there another way to get started with an example that doesn't involve having to install an exe from google drive?Are the scripts shown on the video available without installing the exe?I would really appreciate some guidance.Thank you very much in advance.
Hi everyone,Hi @Jocelyn RICARD, @D.Botelho @Jocelyn RICARDyou made this small bootloader example for testing H7 security features, e.g. RDP:https://community.st.com/ysqtg83639/attachments/ysqtg83639/mcu-security-forum/6051/1/STM32H753_SecureMem_ExampleV1.1.7zIs it possible to provision H5 MCUs and activate the closed product state using UART like the H7 example above?What i want is to implement a custom app that can get commands via UART and provision the device.I would like to have methods like: void setProductState(State state); void provisionDevice(const uin8_t* obkey,size_t obkey_size); // provisionDevice would then provision the device using the obkey send via UART. I see in the reference manual that the RSS offers functions that i can use for the provisioning.But i read somewhere that in PROVISIONING State the flashed application won't run and the device waits to be provisioned via debugger. If that is the case my idea described above won't work because a
Hi ST Team, I am using STM32H7S78-DK development board.I have read and tested following article:https://wiki.st.com/stm32mcu/wiki/Security:STiRoT_for_STM32H7Shttps://wiki.st.com/stm32mcu/wiki/Security:OEMiRoT_OEMuRoT_for_STM32H7Shttps://wiki.st.com/stm32mcu/wiki/Security:How_to_start_with_STiRoT_OEMuRoT_on_STM32H7SI need some help on my project.In How_to_start_with_STiRoT_OEMuRoT_on_STM32H7S wiki page, I got the correct result following "1.5 Full regression" section. But for the "3.1 Debug Opening procedure" section, I got error message after clicking "Execute". The life cycle after clicking discover is "ST_LIFECYCLE_CLOSED (Debug opened)". Any method to fix this error?10:31:36 : STM32CubeProgrammer API v2.20.0 | Windows-64Bits 10:37:49 : Start Debug Authentication Sequence 10:37:49 : SDMOpen : 624 : open : SDM API v1.0 10:37:49 : SDMOpen : 625 : open : SDM Library version v1.2.0 10:37:49 : open_comms : 513 : open : Asserting target reset 10:37:49 : open_com
Hi everyone, I was trying to port TFM + TFM_SB on my STMU575ZI-Q Nucleo following this guide: https://www.st.com/resource/en/user_manual/um2851-getting-started-with-stm32cubeu5-tfm-application-stmicroelectronics.pdf and I've managed to flash secure bootloader and TFM. I've managed to do the regression of the MCU setting the option bytes. When I finally lunched TFM_UPDATE.sh script, logs appeared on tera term as expected, but in the end it got stuck in TFM BOOT log. So I disconnected the board and tried to repeat the process, cleaning and building again the TFM SB image, TFM Appl image etc... But When I tried to mass erase the system flash, an error has occurred: DEV TARGET NOT HALTED. When I reset the board and I observe tera term logs, I can see the following:[INF] Flash operation: Op=0x0, Area=0x0, Address=0x0[INF] Starting bootloader[INF] Checking BL2 NV area[INF] Checking BL2 NV area header[INF] Checking BL2 NV Counter consistency[INF] Consistent BL2 NV Counter 3 = 0x1000000[INF] C
HelloI am developing on the STM32H7B3-DK using X-CUBE-SBSFU v2.7.0 with IAR compiler version 9.70. During the build, I encountered the following critical error:Fatal error[Li004]: file "STM32CryptographicV3.1.3_CM7_IARv8.a" is not an object or archive fileIt appears that the provided static library (STM32CryptographicV3.1.3_CM7_IARv8.a) was built with IAR v8.x and is incompatible with IAR v9.70, preventing successful linking. The static library is present in STM32CubeExpansion_SBSFU_V2.7.0\Middlewares\ST\STM32_Cryptographic\Fw_Crypto\STM32H7A3\LibCould you please advise:Is there an official version of the STM32 Cryptographic static library compatible with IAR v9.x for STM32H7B3?If not, what is the recommended procedure to rebuild or obtain a compatible library for use with IAR v9 ?Thank you for your support. @STackPointer64 @Jocelyn RICARD @Fred
Hello,I have already read the AN4758 application note and I still have a few questions regarding PCROP.I have a project for end-users where the main application provides functions (API) that users can call to develop their own code. I was originally planning to provide these functions as a static library, but since PCROP is very useful and secure, I would prefer to protect my API using PCROP instead of distributing a library with unnecessary header files.In my application, the region 0x08000000 to 0x0805DFFF contains my API code. I plan to flash this code first and then protect this area with PCROP.Here are my questions:If the end-user creates an empty project and I only provide the header files, can they still debug their own application even though the API code region is PCROP-protected?Since a PCROP-protected area cannot be read or written, is there any way to update my API code later? I have a CAN bootloader, but this region will be protected by PCROP.(I am using STM32G474RET6 with
Hi,I am using STM32H56x with OEMiROT_Boot example project, currently the swap method of the OEMiROT_Boot is "MCUBOOT_SWAP_USING_SCRATCH", can I change it to MCUBOOT_SWAP_USING_MOVE?Is there any security concern use MCUBOOT_SWAP_USING_MOVE?Regards,Snaku
I've been playing around with the TrustZone Enabled on the STM32H573 board and using this tutorial:https://wiki.st.com/stm32mcu/wiki/Security:How_to_start_with_OEMiRoT_on_STM32H573_and_563%E2%80%93TrustZone_enabledI had no trouble executing the tutorial, using the Debug Authentication, or changing the permission levels to attach the IAR Debugger to put breakpoints in the main functions of the Non Secure or Secure Applications.However, my group uses the STM32 Cube IDE, and I've been having trouble doing the equivalent using that tool. I know where to enable and set up the Debug Authentication, but I'm having trouble attaching to the running target, hitting the reset button (as instructed in the above tutorial), and having the program stop at the breakpoint I have enabled in the main function of the Secure Application (before it jumps to Non Secure Init) and displaying the associated source code. I have built all the projects (OEMiROT Boot, OEMiROT_Appli_TrustZone_Secure, and
I've been struggling with this problem for several hours.Using bare metal, I can invoke a non-secure callable from the non-secure application.When I added FreeRTOS + CMSIS RTOS v2 wrapper, and try to do the same from a thread context, I get a hard fault when I try to invoke the non-secure callable (see below)I would assume this is related to the thread stack. I am using the following:Cube MX 6.16Cube IDE Version: 2.0.0 Build: 26820_20251114_1348 (UTC)In the secure project is secure_nsc.c, I define my API: CMSE_NS_ENTRY void ToggleBackLight(void) { HAL_GPIO_TogglePin(BACKLIGHT_GPIO_Port, BACKLIGHT_Pin); } In the non-secure project, I invoke this from a thread as follows:/* Private application code --------------------------------------------------*/ /* USER CODE BEGIN Application */ typedef void (*SecureFunc_t)(void) __attribute__((cmse_nonsecure_call)); void doBlinkyThread(void *argument) { /* USER CODE BEGIN defaultTask */ SecureFunc_t secure_func = (SecureFu
HiI am using STM32L562 and sampled and flashed the Zephyr OS example for TrustMode. I could not revert back the TrustZone therefore followed the information from the link https://community.st.com/t5/stm32-mcus-security/reverting-option-byte-configuration-after-tf-m-testing-in/m-p/584225/highlight/true#M5879However, after executing the first two commands the board doesn't respond to the command. Even with the hotplug mode, I can't set RDP level back to 0 STM32_Programmer_CLI -c port=SWD mode=hotplug reset=SWrst -ob RDP=0xAA UNLOCK_1A=1 UNLOCK_1B=1 UNLOCK_2A=1 UNLOCK_2B=1 ------------------------------------------------------------------- STM32CubeProgrammer v2.20.0 ------------------------------------------------------------------- ST-LINK SN : 0046003F3137510C33333639 ST-LINK FW : V3J16M8 Board : STM32L562E-DK Voltage : 3.27V SWD freq : 8000 KHz Connect mode: Hot Plug Reset mode : Software reset Device ID : 0x472 Revision ID : Rev Z Device name : STM32L5xx Fl
Hi team, I provisioned both OEM1 and OEM2 keys. I locked the device using OEM2 key and then put the device in RDP level 2 with the below commands:STM32_Programmer_CLI.exe -c port=SWD mode=hotplug -lockRDP2 0xFEDCBA98 0x76543210Response: "Lock RDP2 password successfully done"Enable RDP2: STM32_Programmer_CLI.exe -c port=SWD mode=hotplug -ob RDP=0xCCIf you see here I used only <word1> and <word2> for password because I followed the below video for STM32U5:URL: https://www.youtube.com/watch?v=B3l6iuA7U8Q&t=752sBut STM32U3 series uses 128 bits of password rather than 64 bits used by STM32U5 series.Could anyone know/share default value that will be passed if we have missed <word3> and <word4>.
HiI am implementing the ECDSA-P256 signing for a payload.I have checked the example code https://github.com/STMicroelectronics/STM32CubeU3/tree/main/Projects/NUCLEO-U385RG-Q/Examples/CCB/CCB_Protected_ECDSA_SignatureThe example code shows that the software has an access to the private-key. Would it be possible to generate a private key using RNG which software/processor can not see and which can be used by the CCB to compute a signature. The same key can be used to get public-key. can I use this API HAL_CCB_ECDSA_GenerateWrapPrivateKey(). Would this key be persistence across reboot or do I need to store the wrapped key?
Hi teams,CPU: STM32U0Current RDP level: Level 1OEM1 RDP lock: Enabled.I had set the 128bit OEM1 key to the OEM key registers [FLASH_OEM1KEYWyR ]accordingly, and the written OEM1 key values was verified using their CRC values by reading OEM1KEYCRC register.Now I am trying to make the regression from level 1 to level 0 according to the user manual description [section: 3.5.1 FLASH read protection (RDP)]. But the operation was failed using my source code. Which is attached below#define STM32U0_DBGMCU_BASE 0x40015800 // Accessible to the software via the APB access port AP0#define STM32U0_DBGMCU_DBG_AUTH_HOST (STM32U0_DBGMCU_BASE + 0x100) // Debug authentication mailbox host register Could you please clarify the following doubts,1. The unlock sequence says, debug access port 1 has to be used for programming the 128-bit OEM1 key in the DBGMCU_DBG_AUTH_HOST register,but when I checked the DBGMCU_DBG_AUTH_HOST register base, it sa
Hello,I am trying to get the OEMiROT example projects running on STM32H563 from "STM32CubeH5\Projects\NUCLEO-H563ZI\Applications\ROT" and this page : https://wiki.st.com/stm32mcu/wiki/Security:How_to_start_with_OEMiRoT_on_STM32H573_and_563%E2%80%93TrustZone_enabled Provisioning works well, unfortunately, I'm blocked on the firmware update step through the internal bootloader. After the message 'Start download with STM32CubeProgrammer through supported interfaces (USART/SPI/I2C/USB)', when I connect CubeProgrammer with uart connection, the bootloader seems to work correctly as I received:Chip ID:0x484 Bootloader protocol version : 4.0Then, CubeProgrammer freezes for 2 mins and the device is disconnected with this message log: 09:54:32 : Error: RDP is set to level 1 or target is held under reset, try using Read UnProtect (-rdu) command in order to remove the Read Out Protection. 09:54:32 : UPLOADING OPTION BYTES DATA ... 09:54:32 : Bank : 0x00 09:54:32 : Address : 0x4
Device detailsMPU: STM32H753AII6Connection:Probe: J-Link V11.00 / SW version V7.98c STM toolset: STM32 Cube Programmer / Trusted Package Creator v2.20.0SFI programming fails with error:Error: SECURITY State FailError: Invalid state after SFI install !Error: RSS internal system error or License is invalid ! I also tried against the STM32H757I-EVAL board, which has a compatible CPU, with the same result.-----HSM provisioningHSM provisioningFor Personalization Data I chose the group with the H753 in it, and from the 4 options in dropdown list the combination of "SFI" and Device ID "45002001" which is how the STM32H753 identifies.SFI creationFor the simplified example, there is only one section of code starting from default address 0x08000000.Settings for RAM size and continuation token are default, and seem to make sense.Option bytes are, except for RDP level = 0xBB (level 1), identical to the defaults after mass erase.SFI creationSFI flashingSFI flashingComplete log:15:25:
Do all the STM32WL series MCUs support STSAFE ? If yes, how it can be done?
Hello!I have a custom PCB using the STM32U5A9 microcontroller.I've been developing my code using Cube IDE with CubeMX generated software including TouchGFX.I need to implement secure boot and OTA. I am following the SBSFU example for the B-U585I-IOT02A board and struggling to incorporate my project in the Non-secure user application segment of that demo project. I’m also trying to go the other way around and implement the SBSFU infrastructure and files into my custom project.First question - all I need is secure boot and OTA is it true that I do not need to enable the Trust Zone? If so, how should I modify the SBSFU build process to only include one image?Second question - It’s been difficult to follow the SBSFU code especially the slot addresses and programming to replicate it within my custom project. The postbuild script for the SBSFU_Boot project pulls firmware size values from image_macros_preprocessed_bl2.c to populate addresses in other scripts like SBSFU_Update.sh. How is this
Hi,is there a possibility to do the complete chain to product state "closed" by non secure user code ?I have a custom bootloader which usually did a set of the old RDP Level.Now, with a STM32H57 device we have to use the new product state. I'm able to set the state to provisioning. But when i use RSSLIB_PFUNC->NSC.DataProvisioning i end up in a hard fault. I tried to set the provisioning data by ST Cube programmer later on which succeeded. But unfortunately i can not regress to open because the password is wrong. Any hints about that ? Thanks in advance.
Does ST offer an implementation of hardware acceleration of mbedtls-2021?I found this:STM32CubeL5\Projects\STM32L562E-DK\Applications\TFM\TFM_Appli\Secure\Src\ecdsa_alt.cSTM32CubeL5\Projects\STM32L562E-DK\Applications\TFM\TFM_Appli\Secure\Src\ecdsa_curves_alt.cfrom https://github.com/STMicroelectronics/STM32CubeL5.gitThis is excactly what I want (a bridge between mbedtls and the PKA_HAL driver), but it's for a 2019 version of mbedtls, and the mbedtls folks since broke the interface, so it doesn't compile. (and it doesn't look like an quick/easy fix)Is there a newer version somewhere?/Troels
I try to understand in details the way the Hash peripheral works on the STM32L552. I need to make the HASH SHA-256 with 224 blocks of 512 bits. The Hash works perfectly until the block 223. Then I enter 16 values in the FIFO (in my code below I have a loop for 15 because I entered previously another value). Then I launch the final digest. I expect the automatic digest of block 224 and the automatic padding in a block 225 to the final hash value. But I always have the wrong value in the final step. Any idea about what I'm missing?
Hello. I'm working with STM32H573. I have a question related with the use of STSAFE-A110 for TLS. I have to authenticate also the client. I've succeded stablishing TLS mutual authentication with HTTPS server and TCP server (different applications, not related) using this type of functions from NetxDuo with the correct data and test certificates: /* TCP Server */ nx_secure_tls_session_create(); nx_secure_tls_ecc_initialize(); memset(&certificate, 0, sizeof(certificate)); // Server Local certificate nx_secure_x509_certificate_initialize(); memset(&certificate_, 0, sizeof(certificate_)); // Client certificate nx_secure_x509_certificate_initialize(); nx_secure_tls_local_certificate_add(); nx_secure_tls_trusted_certificate_add(); nx_secure_tls_session_start(); /* HTTPS */ memset(&certificate, 0, sizeof(certificate)); // Server Local certificate nx_secure_x509_certificate_initialize(); memset(&certificate_, 0, sizeof(certificate_)); // Client certificate nx_secure_x
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.