Ask questions and find answers on STM32 security frameworks and tools, including cryptographic libraries, TrustZone, and the Secure Manager.
Most recent activity
After the build process for the project, I get a file.bin that I want to encrypt to be protected and decrypted in my chip via the bootloader. How is this done, knowing that I use stm32 cube ide?
Hello,I have successfully executed the default OEMiROT and Application projects in STM32CubeH5\Projects\NUCLEO-H563ZI\ on our prototype board based on STM32H563 1MB variant. Slight adaptations were needed for which I got plenty of support in this thread: Solved: STM32CubeProgrammer Default DA Configuration, TZ E... - STMicroelectronics CommunityI would now like the OEMiROT to "skip" Secure application image altogether and directly boot into Non-Secure application image (We have developed our FW entirely in Non-Secure domain and would like to continue with it, with Secure Boot achieved through OEMiROT).Naturally, I started with modifying "flash_layout.h" in OEMiROT_Boot project. Our flash layout configuration in "flash_layout.h" looks like this currently after changes:... /* Flash layout configuration : begin ****************************************/ /* #define MCUBOOT_OVERWRITE_ONLY */ /* Defined: the FW installation uses overwrite method. UnDefined: The FW installation
Hi everyone,We're working with STiROT and TrustZone on an STM32H5 (NUCLEO-H533RE), and during the provisioning process we generate the STiRoT_Config.obk file from the STiRoT_Config.xml using the Trusted Package Creator (TPC).Our question is whether the .obk file itself is encrypted or signed during generation, and if so, which keys are used for that purpose?We're trying to determine if we need to protect any additional private keys used during .obk creation, beyond those already defined for firmware encryption and authentication.Any insight on whether the .obk file is cryptographically protected (encrypted or signed), or if it's simply a binary container holding the public and private keys for secure boot, would be greatly appreciated.Thanks in advance!
When I use mbedtls on my STM32U585 core board without enabling hardware acceleration, it works fine. However, when I follow the instructions in some posts and copy examples, such as the rsa_alt from SBSFU under STM32U5Cube, many errors appear, and it seems difficult to fix. I noticed that the mbedtls in STM32CubeU5 seems to be several versions behind. I also tried using H5 for porting, but the result is still not satisfactory. Will there be new hardware acceleration examples for STM32U585 using STM32-MW-MBEDTLS? Thank you."
Hi,I am trying to get the OEMiROT example projects running on STM32H563 from "STM32CubeH5\Projects\NUCLEO-H563ZI\Applications\ROT". The provision.bat script fails after writing option bytes (probably after enabling TZ) and tries to reconnect to the MCU, which is where the script fails.To get around this, I am trying to do what "provisioning.bat" does manually. I compiled the "OEMiROT_Boot", "OEMiROT_Appli_TrustZone" apps (secure and non-secure) in STM32CubeIDE and the expected .hex are generated. Here are the steps I followed next in STM32CubeProgrammer:Product state set to "Provisioning". At this stage, STM32CubeProgrammer confirms if default DA configuration is to be used. I select yes. Successful.Enable TrustZone. Successful.Write "OEMiROT_Config.obk". Successful.Flash all .bin and .hex compiled in "STM32CubeH5\Projects\NUCLEO-H563ZI\Applications\ROT".Set product state to "iROT Provisioned". MCU disconnects, reset problems reported, debugger cannot reconnect.I try DA. DA is in
Hi, I have a firmware I wan't to give already flashed protected by PCROP to a customer. Insidie my firmware I use some standart library functions line strlen(), vsprintf and some HAL functions to manage peripherals.What is the best way to call these functions from pcrop area?Should I include all needed functions in the pcrop area? Regards,Miguel
Hi everyone,I am trying to use the X-Cube-Cryptolib library to decrypt an array encrypted by an external application.The original data has been encrypted with the AES-GCM 128 using a key of 16 bytes and an IV of 1 byte.Now, I am getting an error where trying to set the IV to a length other than 12 byte.Can you confirm that the method "cmox_cipher_setIV" only accept an IV of 12 byte? It is strange that the method documentation does not contain such info..I tried with an other library that perform a GHASH padding of the IV and it can decrypt my input data.Is there any similar implementation of a standard compliant method to perform an IV padding to be used with the ST library?Thanks,regardsArianna
Hi, We are using STM32u585 device on our board, we want to use a part of internal flash memory for permanent data storage. Please clarify the following. 1)is it possible to use internal flash access using LevleX (non RTOS)?2)is there any reference available?Thanks in advanceG.Vaikundam
Intergrated USB in SBSFU for FW update, and adapting it to work with YMODEM protocol. Only half of the package is downlaoding to microcontroller. Getting error. I will highly appreciate for any help. = [SBOOT] STATE: HANDLE CRITICAL FAILURE= [EXCPT] COM ERROR DURING DOWNLOAD != [SBOOT] STATE: REBOOT STATE MACHINE========= End of Execution ==========with regardsJitu
When using the RAM self-test feature in X-CUBE-STL, I enabled the RAM backup buffer in the application by not defining STL_DISABLE_RAM_BCKUP_BUF. I also allocated a section in the scatter file:; 128KB DTCM RW_STL_TM_RAM 0x20000000 0x20 { ; Place STL RAM TM backup buffer outside tested subsets (i.e., beginning of RAM) *(backup_buffer_section) } This section is explicitly excluded from the self-test region. My question is: How is the integrity of the RAM backup buffer itself ensured? If it is not tested, could errors in this buffer compromise the self-test process or data recovery? Do I need additional measures to guarantee its reliability?
Hello everyone,I'm experimenting PCROP activation on stm32h743 following this ST-tutorial: https://youtu.be/7Wr90XFA8_Q?si=tDpqUtMdin9Oyn-PThe activation works fine but i cannot disable PCROP using CubeProgrammer.I did a RDP1 to RDP0 regression with DMWP1 checked but the PCROP is still activeAfter RDP regression i can se that the unprotected flash are is erase:But not the protected one:I can also not change the option bytes anymore, even RDP0 to RDP1 does not workHow can i recover from this situation ?@Jocelyn RICARD, @Fred
Hello everyone,I've spent a considerable amount of time trying to change the default AES and ECDSA (ECCKEY1) keys, but I can't figure out why it always results in a 'Fw header authentication error' during the firmware image update process.The project is built with STM32CubeIDE under Windows, all paths and necessary modifications needed for the scripts to work from the new project location (prebuild, postbuild, and the encryption scripts) are done and I can confirm 'se_key.s' is updated with the same data as in 'OEM_KEY_COMPANY1'. SeCoreBin compiles without any issues, the same also applies to SBSFU and the UserApp project.I followed the instructions found here:\Middlewares\ST\STM32_Secure_Engine\Utilities\KeysAndImages\readmeand looks like the prepareimage.exe works and generates the 'ECCKEY1', which also when used instead of the one that comes delivered with the package causes the firmware to be rejected immediately. Changing the AES key either manually using a Hex Editor or by u
The documentation I have says the Ethernet calculation with 0x4C11DB7... but I don't get results matching what I get from any other calculator. To remove any endianess or mirroring questions I've tried 0x00000000 and 0x66666666 (e.g.). All calculators I have produce 2144_DF1C and E425_C810 for those 2 inputs. From the CRC unit I get 6904_BB59 and 7B91_8196 (which don't seem to be related by combinations -- on the final value -- of bit flipping and reflection).Yes I asked what the results are -- because I can't imagine what I' don't see in the 1 -> CR; XXXX -> DR; Result <- DR sequence.TIA,Brett
Moved from MPUs forum: STM32C0 is an MCU - not an MPU. Hi, I am not sure if STM32 cryptographic firmware library can run on STM32C071 because this microcontroller does not have embedded Crypto (Hardware) ? Thanks Gregory Saint-Jean
In the SBSFU reference code for the STM32H753ZI controller, I came across the following function:FLOW_CONTROL_CHECK(uFlowProtectValue, FLOW_CTRL_RUNTIME_PROTECT);This function compares whether the two values are the same. In my implementation for the STM32H753ZI MCU, the uFlowProtectValue is set to 0x000030F1U.Now, I am implementing the same logic for the STM32H733 controller, but the uFlowProtectValue variable is set to 0x00005776U.So can you please guide me why I am getting different value for H733, means where this value is updated?
Hello all,I have been working on a bare-metal implementation of the PKA engine in the STM32WBA55CG microcontroller using Rust. So far, I have been able to run modular addition and subtraction, modular exponentiation, arithmetic operations, ECC point check, ECC Multiplication and ECDSA sign and verify. However, there is an issue with the modular multiplication. Whenever I try to multiply operand_a * operand_b mod N, I get zero as a result (or some incorrect value). According to the datasheet:Simple modular multiplication A x B mod na) Compute r2modn using Montgomery parameter computation.b) Compute AR = A x r2modn mod n. Output is in the Montgomery domain.c) Compute AB= AR x B mod n. Output is in natural domainAnd the memory addresses are as follow:I have tried two approaches:1. Loading into the memory operand_a and operand_b and perform the multiplication using mode 0x102. Perform the steps mentioned above, i.e., compute AR, and then AB using AR.In both cases, I get a zero result in th
Good morning, I am Paul Goulpié, technical expert at Smile ECS - integrator of open source embedded solutions. I am contacting you because I have some questions related to the secure boot solution (mcuboot).I am using the following evaluation board: B-U585I-IOT02A.I am using the following reference project: https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/B-U585I-IOT02A/Applications/SBSFU Currently I see that the key format used to create the signature is RSA2048. I would have liked to use an RSA4096 key.Can you tell me if there is a hardware restriction that would prevent it from being used. I am well aware that software modifications at different levels are necessary, however I would have liked to know in advance if a blockage on the hard side (bootRomCode or other) prevents this implementation from being carried out.Are you aware of the completion of this integration (on an internal or external project).On a similar project I have the signing step which is outsou
Hello.With a STM32H563, i can change the product state to 0x17 (provisoring), reconnect with HotPlug,start provisoring with my OBK-File and change the production state to closed (0x72) without any problems.I don't use TrustZone.A full regression after this with STMCubeProgrammer and the password.bin file is possible without problems. I use the explanation from the knowledge base here: https://community.st.com/t5/stm32-mcus/how-to-enable-rdp-like-product-state-flash-protection-in-stm32h5/ta-p/708082 If I try the same thing with an STM32H533 and with the same OBK file i used on the STM32H563 ( <DoEncryption>0</DoEncryption> in XML-File : just as stated in the knowledge base for all STM32H5, because the STM32H533 has crypto), i can do the provisoring, can change product state to closed.But after this a full regression is not more possible.Testet with 2 eval boards and with STMCubeProgrammer V2.18 and STMCubeProgrammer V2.19 If i read out the OBK-K
Porting SBSFU 2.6.2 to STM32G0B1CEU6 (512K FLASH and 144K RAM) based on Nucleo-G071RB example.See the history of my previous Solved: SBSFU 2.6.2 firmware swapping issue - STMicroelectronics CommunityAfter I solved the firmware swapping issue, I went on and test all the other security features. All are good until I turned SFU_MPU_PROTECT_ENABLE on. Now I have hard fault as below: @7:8000000 size:e sub:c0 perm:5 exec:0 @6:20000000 size:b sub:0 perm:1 exec:1 @5:20000000 size:10 sub:0 perm:3 exec:1 @4:8010000 size:a sub:0 perm:1 exec:1 @3:8000000 size:f sub:0 perm:6 exec:0 @2:8000000 size:12 sub:0 perm:3 exec:1 @0:40000000 size:1c sub:0 perm:3 exec:1 @1:40021000 size:9 sub:0 perm:1 exec:1 = [SBOOT] RuntimeProtections: 100 = [SBOOT] System Security Check successfully passed. Starting... ====================================================================== = (C) COPYRIGHT 2017 STMicroelectronics = = = = Secure Boot and Secure Firmware Update = ====
Hi Team,I've updated only the UserApp RAM region. I came across a post stating that SBSFU and the application are independent, so I followed that approach. However, after modifying the RAM region and uploading the sbsfu.bin file to the MCU, I get an "No valid FW found in the active slots" debug log and the system enters Local Download mode. When I try to upload from Local Download, I'm encountering a firmware decryption error.Has anyone faced a similar issue or have suggestions for resolving this?Regards,Prakash Attached the log below: -= [SBOOT] System Security Check successfully passed. Starting...======================================================================= (C) COPYRIGHT 2017 STMicroelectronics == == Secure Boot and Secure Firmware Update ======================================================================== [SBOOT] SECURE ENGINE INITIALIZATION SUCCESSFUL= [SBOOT] STATE: CHECK STATUS ON RESETINFO: A Reboot has been triggered by a Hardware reset!= [SBOOT] STATE: CHEC
Hi,We are using an STM32U585 with the application running from external flash, on an octospi bus. We are also using external SRAM. The external memory architecture on our board is heavily influenced by the B-U585I-IOT02A design (same ports, slightly different parts used).We have successfully experimented with the SBSFU solution here and we have a couple of questions:Is there a flow diagram anywhere that clearly shows the boot sequence for this example/solution? We understand this is difficult because of all the configuration options, but we are still trying to understand if the application images are authenticated on every boot, or only when being copied to the primary slot by the bootloader and how exactly the MCUBOOT_USE_HASH_REF functionality plays into this.We do not need a secure app. Is it possible to remove this and have the bootloader run the non-secure app directly? Any pointers on how to achieve this? This is not a major issue, but it would make the memory map a bit simpler,
Hi there, I'm under mass production with yours STM32L051x8 device. I use the internal EEPROM to keep some data. Note that is not en emulation eeprom on flash, is just 512bytes on internal EEPROM. In addition, I protect my code with ReadOutProtection Level =1. Seems that when I update the version of customer firmware, the EEPROM data is erased. Seems that jumping from Level1 to Level0 produce a mass erase, and in consequence, the EEPROM is erased as well. I would like to know if I'm right. Jumping from Level1 to Level0 produce a mass erase, that produce erase the internal EEPROM as well? Thanks a lot.
I am conducting operational verification of the sample application of X-CUBE-SAFEA1 by connecting NUCLEO-L476RG and X-NUCLEO-SAFEA1B.I have some questions regarding the operation of the sample application "STSAFEA1_WRAP_UNWRAP".My questions are as follows:I demonstrated the sample applcation of "STSAFEA1_WRAP_UNWRAP" with a logic analyzer observing the I2C communication. According to that, it seems that the encryption and decryption processes are performed on the NUCLEO-L476RG side. Is this correct behavior?Is it possible to perform encryption and decryption processes on the STSAFE-A110 side (and with secret keys stored in STSAFE-A110)? If so, how can this be implemented? DetailsBelow are the steps I have taken:1. Execution of the sample codeI created a project on STM32CubeIDE via STM32CubeMX and executed the sample application "STSAFEA1_WRAP_UNWRAP" from X-CUBE-SAFEA1. The UART output results appear to be functioning without errors. 2. Step execution with a debugger and obse
Hello,Thanks for all of the help so far. Another question, this one regarding SFI process for the STM32U5 series. In AN4992 section 3.3.1 for STM32L/U/W series, it describes a secure bootloader that is split into 2 parts, one of which is responsible for executing the SFI process. Are these secure bootloader parts pre-installed in system memory by ST as part of your manufacturing & provisioning process?If yes, is the code for this secure bootloader available to ST Micro customers for analysis?When we install our own SBSFU to be used for future OTA updates, does that overwrite and/or disable the SFI capability?
Dear ST Community,I am currently using the STM32F407G-DISCOVERY board for my project and would like to implement the SBSFU (Secure Boot and Secure Firmware Update) bootloader on this board. However, upon reviewing the X-CUBE-SBSFU package, I noticed that it supports only a limited number of specific boards (approximately 15), and the STM32F407G-DISCOVERY is not among them.As the package lacks direct support for this board, I am unable to use the SBSFU functionality out of the box. I would greatly appreciate it if you could provide the following:Documentation or Guidelines: Detailed instructions on how to port or adapt the SBSFU bootloader to a custom board, such as the STM32F407G-DISCOVERY.Possible Methods: Suggested approaches or workflows to bring up SBSFU on unsupported boards.Additional Resources: Links to relevant documentation, example projects, or tools that can assist in implementing SBSFU on custom hardware.Your guidance will help me better understand the process and successfu
ST Community highlights – April to June 2026
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.