Ask questions and find answers on STM32 security frameworks and tools, including cryptographic libraries, TrustZone, and the Secure Manager.
Most recent activity
I am working on STM32U575 to write and read from Secure flash. I referred STM32Cube_FW_U5_V1.4.0\Projects\NUCLEO-U575ZI-Q\Examples\FLASH\FLASH_EraseProgram_TrustZone\but I was facing following issueCan you please help me resolving it. Do we have an document/link explaining read/write access to secure flash and memory map for the same.Regards,Shafi
Hello,I am working with SBSFU on a STM32U575 microcontroller and have written a function to check the cause of the system reset by reading the flags from the RCC registers using __HAL_RCC_GET_FLAG. However, the issue is that none of the RCC register flags are ever equal to 1, so I am unable to determine the reset cause properly. What exactly needs to be modified to be able to read those registers?
I need to perform SFI on an STM32U599 MCU, so following the wiki article "SFI Step-by-step on STM32 boards" I prepared the firmware and programmed the HSM V2 smartcard.I'm sending the commandSTM32_Programmer_CLI -vb 1 -c port=SWD mode=HOTPLUG -sfi xxx.sfi hsm=1 slot=1Command execution seems ok, but the final message:Reconnecting...Reconnected !Error: Database: There's no active configuration for this device. All the 8 configurations are disabled!What's the problem? Most of all, I found that now the TrustZone of the CPU is enabled, while it was not set in the option bytes file used to prepare the SFI.Other option bytes differnet from the settings in my option bytes file are nSWBOOT0 and nBOOT0As a note: if I use the GUI to program the SFI I have to specify an RSSe file, while using the CLI seems like this file is not required. Im sure I'm missing some information... TrustZone has to be set to perform SFI on the STM32U5?
Hi,I am trying to replace mbedTLS library with Wolfcrypt library for crypto operations in SECoreBin project of SBSFU. I was able to replace SHA256 related APIs. But the bootloader is crashing when I try to initialize wolfssl ECC key object under SE_CRYPTO_Authenticate_Metadata(SE_FwRawHeaderTypeDef *pxSE_Metadata) i.e.ecc_key ecc;wc_ecc_init(&ecc);I have tested same set of APIs with a test project. Any idea what could be the reason for the crash in SECore. Also I am not sure how to debug the SECoreBin project with SBSFU. Pls note: I am using stm32h753ZI nucleo-144 board and IAR build setup.
Ok, well I'm going to answer my own question, Yes.This stems from an earlier conversation about doing CRC15 or CRC-15-CAN, where I had postulated that it probably could, and I then subsequently proof-of-concepted that idea, and then started pondering other uses.https://community.st.com/s/question/0D53W00001bIU55SAG/can-the-stm32-crc-peripheral-be-made-to-work-with-the-crc15can-polynomialThe hardware implementation provides for 7, 8, 16 and 32-bit modes of operation, but for byte-wise and left-shifting, we can use the high-order portion of the register to carry the residual and apply the polynomial. We have to shift the initial values and polynomial in to the left most portion of the selected word size, and the right most, least significant side is zero'd, and finally when you recover the computed value, realign that into the expected bit width. For checking a CRC, you typically run the value through itself, and it drops to zero, as it perfectly divides into the polynomial.CRC-24Q (Qual
Hi @Jocelyn RICARD GreetingsWe have a query from our support team"known vulnerability in the STM32U5 series related to the JTAG lock when using RDP (Readout Protection) Level 2." Is it advisable to proceed with this implementation, or should we consider alternative solutions?Reference:STM32 JTAG lock vulnerability with RDP Level 2:SECGlitcher (Part 1) - Reproducible Voltage Glitching on STM32 Microcontrollers - SEC Consult (sec-consult.com) How can this vulnerability resolved or any other suggestion in this regardThanks againPhilip
Working on setting RDP (read out protection) on STM32H750. We are using an external loader to be able to read from/write to external flash. The internal flash only contains a bootloader.1. Setting RDP to Level 1 doesn't prevent reading external flash. Is there a way to enable protection for external flash?2. Setting to Level 1 and then reverting to Level 0 deletes the internal flash (bootloader). Is there a way to extend this functionality to external flash?
Hello, My project is based on the STM32H753 chip.I Using the STM32CubeProgrammer and try to set the RDP level from 0 to 1, I get the error "Error: Expected value for Option Byte "RDP": 0xBB, found: 0xAA".I only enable the Secure Protection.How can I solve this issue?Any assistance on these issues would be greatly appreciated. Thanks,HAHA6
Hi ST Team, Currently i am using STM32H523RCT6 mcu for one of my project. In this i want to set the read out protection of level 1. Currently i am using below sequence to set the read out protection of level 1 protection.. // Unlock the flash option bytes HAL_FLASH_Unlock(); // Set the read out protection level to Level 1 // RDP Level 1 is indicated by the value 0x01 uint32_t option_bytes = 0x01; // RDP Level 1 HAL_FLASH_OB_Unlock(); // Program the option byte HAL_FLASHEx_OBProgram(&option_bytes); // Start the option byte change //HAL_FLASH_OB_Launch(); // Lock the option bytes HAL_FLASH_OB_Lock(); // Lock the flash memory HAL_FLASH_Lock(); HAL_FLASH_OB_Launch(); but this is
I am using STM32U585 and I stumbled upon the following problem:If a device is configured with TrustZone enabled (TZEN=1) there is different behavior in the following situations:1. SPI is configured without DMA and CPU is running non-secure code in privileged mode in that case the CPU is able to read/write to SRAM1 (from IRQ handler)2. SPI is configured using GPDMA and CPU is running non-secure code in privileged mode however in this case the GPDMA is not able to read/write to SRAM1Reading the documentation I would expect that SRAM1 when TrustZone is enabled allows only secure / privileged access, but how does then the first described situation work at all, how does CPU have access to SRAM1 at all when it is running non-secure code?
Hello,I am using SBSFU on the STM32U5 microcontroller, and I have implemented a function to determine the cause of the system reset by reading the RCC register flags. However, every time I enter the function, it always returns an 'unknown reset' value.I have used the following function:unsigned char SYS_Reset_Cause(void) { unsigned int reset_cause; reset_cause=UKW_RESET; if (__HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST) == 1) { reset_cause = SFT_RESET; } else if (__HAL_RCC_GET_FLAG(RCC_FLAG_BORRST) == 1) { reset_cause = PWO_RESET; } else if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) == 1) { reset_cause = WDG_RESET; } else if (__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST) == 1) { reset_cause = HRD_RESET; } else if(__HAL_PWR_GET_FLAG(PWR_FLAG_SBF) != 0) { reset_cause = ALR_RESET; } __HAL_RCC_CLEAR_RESET_FLAGS(); return reset_cause; }
Hi,I am working with SBSFU on a STM32U575 microcontroller, and I want to use the __attribute__((section(‘.ram2’))) to place a variable in the secure SRAM2 memory section so that the variable can write to it. However, the secure SRAM2 memory is reset every time the microcontroller is rebooted. I would like to know if it is possible to retain the data in secure SRAM2 permanently, and if so, would the linker script need to be modified to accommodate the use of this attribute?
EDITED:Resolved, but leaving here for the next person who stumbles into this issue.I'm using the STM32G030K6 and encountered two issues:Errata 2.2.3 - which correctly describes a serious issue when using readout protection level 1: if nBOOT_SEL is not set in the option bits, the uC will often fail to boot and even a hard reset will not recover, only a power cycle. The errata correctly describes a workaround: set nBOOT_SEL in the option bits (removes the option to force entry to the bootloader by tying the BOOT0 pin high).Access to OTP memory is not protected by readout protection level 1.This is expected behavior since SystemMemory is not protected by RDP level 1, but it is unfortunate given that OTP is the perfect place to store device-specific persistent data like serial numbers, encryption keys, etc. This is particularly true on devices with limited flash where allocating a separate sector may be painful. Perhaps in a future version of the component, ST will consider protectin
Hello to all,I was wondering if there was a way to implement a secure update via USB stick using X-CUBE-SBSFU software.Moreover, the application software would be installed on external flash, custom bootloader immutable in internal flash.Maybe installing the new application with my custom bootloader and then letting secure boot do all the security verifications after triggering a system reset?Sorry if it sounds a silly question but I am quite new to this complex topic.Thanks!
Hi,I'm using F4 series board (STM32F423ZHT6). also I'm using F4 and scripts say L series - are they compatable?STM32CubeProgrammer version: STM32CubeProgrammer 2.14.0 - This is support SBSFUX-CUBE-SBSFU version: 2.6.2I follow the https://www.youtube.com/playlist?list=PLnMKNibPkDnGd7J7fV7tr-4xIBwkNfD-- video. Can you please help me? Regards,Meena
Hi,I'm using STM32F423ZHT6 MCU board. I want to implement the FOTA as well as Scure Boot on my EVAL board. But I don't have much knowledge about Secure Boot. So, I refer https://www.st.com/en/embedded-software/x-cube-sbsfu.html and AN5056. The SBSFU package have some STM32F413- Discovery board example. How to write a crypto in MCU board?. Is there example code is available. Then how to check if my scure boot is sucessfully add to my MCU? Regards,Mee
I'm struggling with entering RDP level 1 using the ST Cubemx code examples. I am stuck with OPTVERR bit set and never being successful in getting FLASH_OPTR RDP bits set to 0xBB AND written into flash so that it boots using 0xBB and not 0xAA. (I can write 0xBB into the register, but 0xBB does not reach flash.) The programmatic sequence seems straightforward, but I can't get the low level/HAL libraries to do what the examples claim they do.From a practical standpoint, all I really want is a binary image I can use to program parts (and be able to read back so I can verify Flash contents. My assumption is that a binary image at RDP level 1 will not allow read verification of the programmed data so to ensure the initial image is 'readable so the device programmer can verify it', I'm trying to enter RDP level 1 programmatically (so my binary image is initially readable but immediately sets RDP 1 when it runs the first time.)If there is another way to generate a
Hi, I followed all the steps from the UM2851 documentation about TF-M application. At point 10.2 I ran the regression.sh script, with the below output: regression script started Regression to RDP 0, enable tz ------------------------------------------------------------------- STM32CubeProgrammer v2.17.0 ------------------------------------------------------------------- ST-LINK SN : 003B00243232510239353236 ST-LINK FW : V3J15M6 Board : B-U585I-IOT02A Voltage : 3.30V SWD freq : 8000 KHz Connect mode: Hot Plug Reset mode : Software reset Device ID : 0x482 Revision ID : Rev X Device name : STM32U575/STM32U585 Flash size : 2 MBytes (default) Device type : MCU Device CPU : Cortex-M33 BL Version : 0x0 Debug in Low Power mode enabled UPLOADING OPTION BYTES DATA ... Bank : 0x00 Address : 0x40022040 Size : 36 Bytes ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 100%▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 100% Bank : 0x01 Address :
Hi,I am implementing the sbsfu encryption functionality on the stm32u575 micros which do not contain hardware accelerator. For this I have decided to use x-cube cryptolib to be able to encrypt and decrypt messages. I have tested the example aes_cbc_encryptdecrypt on the u575zi-q motherboard and it works perfectly. Now I am trying to implement the same example on a u575 micro with sbsfu, but when encrypting, it does not produce the expected ciphertext values for the default text. Any help?
Hello all,I'm trying to build B-L4S5I-IOT01A, 2 Images KMS project and I'm encountering the build issue related with missing function definition for KMS_LL_Finalize(). Build fails during linkage phase.Is that issue related with the wrong version of KMS package provided with SBSFU 2.6.2? PS. Same issue applies for B-L475E-IOT01A project.
Hello,I've been working on Provisioning my STM32H563 product and after 3 weeks of not touching the project, I am unable to perform Full Regression or Debug Authentication on my password-provisioned Nucleo Board. I tried using the generated bash scripts from CubeIDE/MX (which are using STM32_Programmer_CLI) and also STM32CubeProgrammer GUI.I remember before the vacation, I could open and close the Board at will. I always used the same password(.bin).Provisioning always happened using the generated provisioning.sh script.Here is the Output of STM32CubeProgrammer (I found it has more info than dbg_auth.sh), after trying Discovery and Full Regression:------------------------------------------------------------------17:21:34 : Start Debug Authentication Sequence17:21:34 : SDMOpen : 609 : open : SDM API v1.017:21:34 : SDMOpen : 610 : open : SDM Library version v1.1.017:21:34 : open_comms : 501 : open : Asserting target reset17:21:34 : open_comms : 505 : open : Writing magic number17:21:34 :
Hello everyone,I am experiencing an issue with my stm32H735 microcontroller after enabling RDP level 1. The program that was working perfectly (blinking led) under RDP level 0 no longer executes after I changed the protection level to 1.What I have Tried: I activated RDP level 1 using 3 different methods, and the issue remains the same each time:1 - using STM32_Programmer_CLI with the following command: STM32_Programmer_CLI.exe -c port=COM7 br=115200 -rdu STM32_Programmer_CLI.exe -c port=COM7 br=115200 -e all -w test.hex -ob RDP=0xBB -v 2 - Using the STM32CubeProgrammer GUI to set RDP level 1 after programming.3 - through the program by adding this code: FLASH_OBProgramInitTypeDef RDP_init; HAL_FLASH_OB_Unlock(); HAL_FLASH_Unlock(); RDP_init.OptionType = OPTIONBYTE_RDP; RDP_init.RDPLevel = OB_RDP_LEVEL_1; HAL_FLASHEx_OBProgram(&RDP_init); HAL_FLASH_OB_Launch(); In all cases, the programming and verification are succesful, and RDP level 1 is activated wit
Hi, I have accidentally set the option byte PRODUCT_STATE=0x17 and the device is locked and shows the following when I do DA discover.This is the log related to the error message.12:09:28 : Start Debug Authentication Sequence12:09:28 : SDMOpen : 609 : open : SDM API v1.012:09:28 : SDMOpen : 610 : open : SDM Library version v1.1.012:09:28 : open_comms : 501 : open : Asserting target reset12:09:28 : open_comms &
In STM32H573-DK Board,explain in detail for the protection mechanism built on PCH for side channel attacks.
Hi everyone, I develop a asimmetric public/private key crypto scheme and then with simmetric derived ley establish a comms with HOST REMOTE <-> [LOCAL HOST/STSAFE]. I generate with ephimeral slot with:ret_code = (int32_t)StSafeA_GenerateKeyPair(handle, STSAFEA_KEY_SLOT_EPHEMERAL, 0xFFFF, 1, (STSAFEA_PRVKEY_MODOPER_AUTHFLAG_CMD_RESP_SIGNEN | STSAFEA_PRVKEY_MODOPER_AUTHFLAG_MSG_DGST_SIGNEN | STSAFEA_PRVKEY_MODOPER_AUTHFLAG_KEY_ESTABLISHEN), STSAFEA_NIST_P_256, STSAFEA_XYRS_ECDSA_SHA256_LENGTH, &pointreprensentationid, &pub_cx, &pub_cy, STSAFEA_MAC_NONE); And then generate a PEM wich will be sended to REMOT HOST, in the next step receive PEM from the other extreme and extract XY ECDAS pair. How should i do if i want to set up a derived key and share it with the REMOTE HOST?. I cant find de Derive Key command in MW of STM CUBE MX pack, only find de EstablishKey command for SPL02 profile.
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.