Ask questions and find answers on STM32 security frameworks and tools, including cryptographic libraries, TrustZone, and the Secure Manager.
Most recent activity
Hii Sir,Recently I have got Nucleo-H563ZI nucleo board and i was trying to do programming for blinking led present on the board with the trust zone activated, but i am unable to get how to do it.The process i follow is;1) Created new stm32 project -> Give the name of the project -> selected with TrustZone -> Finish. As the onboard LED was already defined in the .ioc file. Therefore generated the project with the default configuration, under main folder, two more folder were generated secure and non-secure. in nonsecure folder -> Core -> Src -> main.c in this main.c file searched for while loop and added toggleing of led code in it and build the code. As there was confusion which code to be uploaded first i tried to upload the nonsecure folder but the led was not blinking (only the led was on ) during this when I press the reset button the led was off. second time, I build the secure folder code and flash it in the microcontroller toggleing was working but t
Hello all,I have been working on a bare metal Rust implementation of the PKA engine in the STM32WBA55CG microcontroller. So far, I managed to properly initialize the PKA engine, and run both modular addition and subtraction by writing and reading the PKA RAM memory. However, when trying to run modular multiplication and exponentiation, the operation simply never ends (PROCENDF never clears). I am not sure why could this be, since I am just modifying the mode and the in/out memory offsets to which I write in the RAM. Below I show the corresponding code.The PKA RAM memory can be found in page 82 of rm0493 (https://www.st.com/resource/en/reference_manual/rm0493-multiprotocol-wireless-bluetooth-le-and-ieee802154-stm32wba5xxx-armbased-32bit-mcus-stmicroelectronics.pdf) #![no_std] #![no_main] use stm32wba::stm32wba55::{self}; use {defmt_rtt as _, panic_probe as _}; use cortex_m_rt::entry; use cortex_m::asm; use defmt::info; use core::{ mem::size_of, ptr::{read_volatile, w
Hello,We are using an STM32H573 with the Secure Manager provided by ST running in the secure environment. In the non-secure environment, we are calling PSA functions. These calls work before ThreadX is launched but fail afterward.According to the page Introduction_to_THREADX#STM32_integration, when TrustZone is enabled, I need to use a secure stack for each thread calling functions from the secure environment. To implement secure stacks, the functions defined in tx_thread_secure_stack.c should be added to the secure environment.The example STM32Cube_FW_H5_V1.4.0/Projects/NUCLEO-H563ZI/Applications/ThreadX/Tx_SecureLEDToggle_TrustZone illustrates this but without using the Secure Manager.However, I need to use the Secure Manager. Can you provide some guidance ?Are the functions from the file tx_thread_secure_stack.c included in the Secure Manager ? If so, how can I call them ?Should I create a secure module with the SMDK for this ?Thank you in advance for your
Greetings,I would like to know, in summary, what are the key main differences between RDP (ReadOut Protection) and PcROP (Proprietary Code Readout Protection), which one is safer and use cases.Thank you!
Hi,I am working on the SBSFU default code, which handles swapping content from the download slot to the active slot. However, I need to skip the swapping process and after Decryption download slot boot directly from the download slot.Could you please guide me on how to boot directly from the download slot?please find the attached flowchart for reference.Regards,RajaI have made changes in the SFU_BOOT_SM_ExecuteUserFw state and after application is not launching after changesstatic void SFU_BOOT_SM_ExecuteUserFw(void){SFU_ErrorStatus e_ret_status = SFU_ERROR;SE_StatusTypeDef e_se_status = SE_KO;uint32_t i; TRACE("\r\n= [SBOOT] STATE: EXECUTE USER FIRMWARE"); /* Reload Watchdog */(void) SFU_LL_SECU_IWDG_Refresh(); /* Verify if authentication and integrity controls performed at SFU_STATE_VERIFY_USER_FW_SIGNATURE */FLOW_CONTROL_CHECK(uFlowCryptoValue, FLOW_CTRL_INTEGRITY);for (i = 0U; i < SFU_NB_MAX_ACTIVE_IMAGE; i++){/* Slot configured ? */if(SlotStartAd
Hi ST team,We are using STM32H573VI controller for our product development, here we are facing an issue to develop JTAG locking mechanism, As we gone through reference manual of STM32H5 controller, we observed that in FLASH_OPTSR_PRG register contains the PRODUCT STATE, in which at first we made PRODUCT STATE to 0x17 as provisioning state later we made PRODUCT STATE to 0x5C as locking state. after implementing these we are not able to lock the JTAG. Please share any reference code to lock the JTAG or apart from this we need to configure any other FLASH OB register to make JTAG to be locked.Kindly let us know as early as possible.
Hi,I am evaluating/learning the SBSFU application example on STM32WBA55CG. I have disabled the MCUBOOT_HW_ROLLBACK_PROT and generated the signed confirmed image sbsfu_app_init.bin using the imgtool.exe without the security counter TLV using the below command. imgtool.exe sign -k root-rsa-2048.pem -S 229376 -e little -H 0x400 --pad-header --align 8 --overwrite-only -v 1.0.0 --confirm --pad sbsfu_app_init.bin The only change I made to the above command is to remove the "-s auto" and +0 from the version to ensure TLV for the security counter isn't added. However, when I run the application, the image validation fails within the bootutil_tlv_iter_begin as shown below i.e if (info.it_magic == IMAGE_TLV_PROT_INFO_MAGIC) {// fails with info.it_magic = 0x6907 if (hdr->ih_protect_tlv_size != info.it_tlv_tot) { return -1; } if (LOAD_IMAGE_DATA(hdr, fap, off_ + info.it_tlv_tot, &info, sizeof(info))) { return -1; } } else if (hdr->ih_pr
How can I generate the sfu_se_mpu.s file for the STM32H753ZI and STM32H733 controllers in SBSFU?
I’ve successfully compiled the SBSFU (Secure Boot Secure Firmware Update) code for the STM32H753ZI and updated the firmware. Now, I would like to use it with the STM32H733VGT6 MCU.Previously, I was using the STM32H753ZI controller, which did not utilize the IOC configuration file. I need guidance on how to migrate and adapt the IOC configuration specifically for the STM32H733VGT6 MCU.I’ve already referred to the AN5056 and UM2606 documents, but in these documents there is not mention any instructions on how to configure the IOC file for this type of migration.Could anyone provide guidance or relevant documentation for integrating the STM32H733VGT6 controller?
Hello,I am having some trouble understanding what bootloader (if any) is installed by ST from the factory for the STM32U5x and what AES key sizes that bootloader supports for secure firmware update. UM2851 only lists AES-CTR-128 (I interpret 128 to be the key size) but mcuboot docs lists support for 256-bit keys.Ultimately, I need to be able to encrypt my software using a 256-bit AES key. Is this possible with STM32U5A5 and the ST provided tooling? If so, is there documentation describing how to achieve this configuration? Thank you
STM32H743 - Does RDP protection gives 128 bit flash protection?How to configure for 128 bit.We want to implement read and write protection on the internal flash of the MCU/MPU to avoid unauthorized access through debug ports.
I am using STM32L452RE for an application.I want to implement firmware signing feature on the board so only authenticated firmware is allowed by bootloader to flash on the board. Can i conclude that mbedtls library is popular, but it cannot be used on the board since there is no hardware accelerator?I wonder that shouldn't be the case. However, I saw this example library where data signing is implemented. I feel something can be done on similar lines. Please guide on how to implement this. https://github.com/STMicroelectronics/STM32CubeL4/tree/master/Projects/NUCLEO-L452RE/Examples/CRYP/CRYP_AESModes
Good afternoon,we are facing issue with AES GCM Tag generated with STM32U585.In particular we compare the results generated by the microcontroller with the ones generated by an application developed with C#.This is the code running on the microcontrollerKey size is 256 Bit set to all 0 just to speed operations. Tag size is 128 bit. I know that the IV vector must have the last byte set as 2 an I dit it as requested. uint32_t pKeyAES[8] = {0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000}; uint32_t pInitVectAES[4] = {0x00000000,0x00000000,0x00000000,0x00000002}; __ALIGN_BEGIN static const uint32_t HeaderAES[4] __ALIGN_END = { 0x24825602,0xbd12a984,0xe0092d3e,0x448eda5f}; Plaintext is a simple 48 bytes buffer (so a multiple of 16).The EncryptedText is identical to the one generated by the application: good.On the other hand the generated Tag is always different....maybe we are doing something wrong....could
Can recognize the chip, but can not burn and read the flash problem. In this case, is the chip broken or the chip locked? There is also a case that the chip can be identified as burning, but it cannot run the normal working program
In my project, I intend to use an external serial flash to hold UI assets as recommended by TouchGFX.I have followed this: https://community.st.com/t5/stm32-mcus/how-to-implement-and-use-your-own-external-flash-loader-an/ta-p/597752 but I only get flash erase errors from the STM32CubeProgrammer.The main issue that I see is that this project also needs to have the secure flash feature active, which is where I believe that the problem lies.Does anyone know if external flash loaders works with Secure Flash enabled? If so is there a white paper or document describing how to make both work?Thank you.
We are planning to use an external flash memory connected via QuadSPI to the OCTOSPI peripheral of a STM32H735 (at a later stage that would be STM32H733).This will be used to run firmware and store downloaded firmware updates with SBSFU. For that we will need the OTFDEC peripheral to ensure date is encrypted for storage.What I need to know is whether the Quad SPI interface of OCTOSPI will be able to work with OTFDEC in memory mapped mode? The memory also does not support HyperFlash.It is my understanding (from AN5050 and AN5281) that OTFDEC and OCTOSPI are independent peripherals in operation but where OTFDEC comes in between OCTOSPI and the AXI bus so it should be possible.
Good Morning,I am working on the Secure Boot using STM32U5 with this repository : https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/B-U585I-IOT02A/Applications/SBSFUI am trying to add a kind of "Dev. Mode" which authorise the boot even if the Application's flash is corrupted.Are there any restriction from the SBSFU_Boot code or ROM code that prevents this feature ?Moreover, do you have any links to the SBSFU_Boot.bin sources, especially the main.c or this part is private and can't be shared ?Best Regards,Loïc
Hello there,I am practicing with the STM32H573I-DK demo board, STiROT demo project and the chain of certificate feature.I have built a chain of certificates as described in https://wiki.stmicroelectronics.cn/stm32mcu/wiki/Security:How_to_start_with_STiRoT_on_STM32H573.It seems that I cannot execute a regression a regression or other action by supplying the INTERMEDIATE key and certificate. For Instance, Full regression works with ROOT or LEAF credentials, but not the INTERMEDIATE.Am I doing something wrong ? or is it that intermediate certificates are only meant to generate leaf certificates, and cannot be used to re-open a device.Thanks for your feedback.Christian
Hi, I have locked out my MCU. I generated a Debug Authentication file with certificate (DA_Config.obk) and provisioned that into the MCU. However, I think I have regenerated a private key without regenerating a certificate. I am no longer able to do a regression on the MCU for DA authentication. I have tried multiple of certificates and regenerated certificates based on the root private key I used for generating the .obk file but nothing works. Also I don't quite understand the difference between the root, intermediate and leaf keys/certificates pairs. Which ones is used in regression? Any help would be appreciated. Thanks in advance :)
Hello ST Community,I’m working on a project using STiROT with TrustZone on an STM32H533, based on the example STiROT_Appli_TrustZone provided in the STM32Cube_FW_H5_V1.5.0 firmware package for the STM32H573. I adapted this example to the H533 and generated the project using CubeMX.CubeMX successfully created the ROT_Provisioning folder with all necessary scripts (postbuild.bay, XML files, etc.), and I’m using Keil uVision5 for building the project.However, I’m facing two key issues:Provisioning and Postbuild Issues:When running the provisioning.bat script, I get this error:"Error: appli_enc_sign.hex does not exist use TPC to generate it."Checking the log file (ob_flash_programming.log), this suggests the postbuild process isn’t properly generating the encrypted and signed image.The postbuild.bat script also reports:"Imgtool :: Input file not found"The binary is being generated in this directory: "C:\ProjectRoot\Binary\appli_s.bin"But my project is located here: "C:Proj
Hi, I have managed to extract the OEMiROT project from H533 into H523 and compiled it successfully using STM32CRYPTO library since H523 does only have limited cryptography accelerator. I have modified the flash_layout.h to match my application (which is only using the non-secure image with no data image). However, the OEMiROT bootloader firmware itself is configured with secure and non-secure parts. I have been updating the postbuild.sh script to match my project structure. I am at the stage or running AppliCfg.exe and it error out on the flash layout with the following error[ERR] The script was probably invoked manually with having certain macros nested in flash_layouts.h.Please revisit the flash_layout.h file and hardcode values for the (NON-)SECURE_IMAGE_OFFSET and (NON-)SECURE_IMAGE_MAX_SIZE macrosI checked these macros and they are matching the ones in map.properties. I also tested with MCUBOOT_APP_IMAGE_NUMBER 1 and 2 with the same resultI attached the following fi
Hi allI'm working on a STM32WB55 nucleo boardI'm designing a simple Signing procedureAt beginning I've try that every thing ok by using a hard codded key and now I want to switch on a key kept secure in FUS zoneI've load 2 256 bits AES keys into FUS user Key secure zone first time with a custom app that will be loaded in prod to set all default keyssecond time I've try by cube programmerI've based my procedure on CKS example- call HAL_CRYP_DeInit() to clear all AES regs and context- setup handle.init structure : I'm initializing for a 32 bytes buffer input and AES CBC mode- call HAL_CRYP_Init() and keeping AES key to NULL (to avoid HAL_CRYP_Encrypt() call overwrite AES KEY registers- call SHCI_C2_FUS_LoadUsrKey() with the good key index- call HAL_CRYP_Encrypt() - finaly unload the key etc ... if I use 1 or 2 as index SHCI_C2_FUS_LoadUsrKey() is responding SHCI_Successif I use another index not previously set with a key it's answering SHCI_FUS_CMD_NOT_SUPPORTEDit makes me feel
Hello All,, I am using STSAFE-A110 with stm32f429zit6 for secure boot, I want sample code / library for the same. Also my another query is will I have to sign the firmware using openssl externally. can anyone provide me complete step to finish the secure boot. Thanks in advance!!!!!
Hey guys, how are you?It's been a long time that i'm facing a issue with STM32WB CPU2, most of the times i just fix it without really knowing the cause of it. Basically what happens is after power-up CPU2 simply won't initialize on the first try. I have a loop on my main application waiting for CPU2 to boot. Since it doesn't boot, my WDT kicks, microcontroller gets reseted and then in this second try CPU2 initialize properly. I debugged CPU2 fault register and accused a hard-fault in CPU2, that i'm not very sure what can be.The weirder of all of this is that small changes on my firmware compiled binary stop this problem. Last time this occurred, (after a ton of researching and some trial and error) i had to add a static char array of 4 bytes. This changed the .bin size and the problem simply disappeared. If i added a static variable that didn't change the .bin size (due to binary padding during compilation), the problem still happened. I compared the generated binaries files in both of
Hello all,I am working on a bare-metal implementation of the PKA engine using the STM32WBA55CG. I have managed to properly initialize both the RNG and the PKA engines, but I cannot seem to load the operands on the RAM. I am trying to implement the modular addition, following the datasheet (https://www.st.com/resource/en/reference_manual/rm0493-multiprotocol-wireless-bluetooth-lowenergy-and-ieee802154-stm32wba5xxx-armbased-32bit-mcus-stmicroelectronics.pdf page 863). I am using Rust as programming language. I attach the code. The problem is that whenever trying to write the data, using core::ptr::write_volatile, the code just stops and nothing is done. The outputs I have are: #![no_std] #![no_main] use stm32wba::stm32wba55::{self, RAMCFG}; use {defmt_rtt as _, panic_probe as _}; use cortex_m_rt::entry; use cortex_m::asm; use defmt::info; // PKA RAM locations - these are already offsets from PKA base address const PKA_RAM_OFFSET: u32 = 0x400; const OPERAND_LEN
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.