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
Following the ST sample : STM32CubeH5\Projects\NUCLEO-H563ZII regenerated OEMiRoT_Config.obk with the STM32TrustedPackageCreator.then, rebuild the OEMiRot application and the applications OEMiROT_Appli_TrustZone_Secure & OEMiROT_Appli_TrustZone_NonSecureI ran the script : \ROT_Provisioning\OEMiROT\provisioning.batusing the 'PROVISIONED' choice.The script returns No error. But When I check the PRODUCT_STATE with STM32CubeProgrammer, the state came back to OPEN instead of PROVISIONED.But, I had to use the DA to connect to the device with the STM32CubeProgrammer. So, OBK files seems to be applied.I has already checked that the PROVISIONING state has been correct before the OBK provisioning sequence.So it's the action "set state PROVISIONED" that fails (or maybe an issue with the OBK files ???, but no way to check if they are OK).Someone has already meet this issue ? How to fix it ?
Post edited by a ST moderator to be inline with the community rules especially on the code sharing. In next time please use </> button to paste your code. Hi I am struggling getting context save restore working correctly, when operating the HASH hardware block using polling mode.Basicly the flow is like this: /* --- STEP 1: Start hashing first chunk --- */ HAL_HASHEx_SHA256_Start(&hhash, input1,strlen((char*)input1), digest,HAL_MAX_DELAY); /* --- STEP 2: Save context --- */ HAL_HASH_ContextSaving(&hhash, context); /* --- STEP 3: Restore context --- */ HAL_HASH_ContextRestoring(&hhash, context); /* --- STEP 4: Continue hashing --- */ HAL_HASHEx_SHA256_Accumulate(&hhash, input2, strlen((char*)input2)); /* --- STEP 5: Finalize hash --- */ status = HAL_HASHEx_SHA256_Finish(&hhash, digest, HAL_MAX_DELAY); However when calling HAL_HASH_ContextSaving the DINIS is not equal to 1 and CSRx registers return zeros as stated in the reference manualHow do it
I got an error when downloading the .sfi file to STM32H753II using the STM32Programmer_CLI, my HSM version is V2AE.The error message is as follows:What its mean?V2AE cannot support STM32H753,and must use HSM_V1?or H753 cannot support SFI ?I’m a new use about SFI.Looking forward to your reply.
Hi,I am using SBSFU v2.8 with an STM32H750. I have successfully booted my firmware without any protections. I have also enabled protections and succeeded all tests in the test suite provided in the example code in sfu_test.c.However, when I attempt to boot my firmware with any protections enabled at all, I get the following, followed by a reset.This is happening at the first control flow check at line 1092 in sfu_boot.c.In my research, I found this post. I replicated it and included app_sfu.h in sfu_boot.h. It works now.I would like some clarification on this whole situation. Is this a bug? or is my build system just not including app_sfu.h appropriately ?Thanks!
Hello, I am working with an STM32 B-U585I development kit. The board has been previously used, and some protection-related configurations have been modified. I am now trying to perform new tests on the device, but I believe I am unable to bypass the current protection settings. I would appreciate your assistance on this matter. A TFM application was previously installed on the board. When connecting via STM32CubeProgrammer, I observe the following: 1. Connection settings: I connect with the following configuration: Boot0 = 1 Port: SWD Mode: HotPlug Reset Mode: Hardware 2. STLinkUpgrade tool: When opened, the ST-LINK is identified as: Type: STM32Debug+VCP 3. STM32CubeProgrammer observations: RDP = 0xDC (Level 1, read protection of memories) TrustZone = 1 OEM1LOCK = 1 OEM2LOCK = 0 I do have the required password to unlock RDP, and I am able to successfully unlock the RDP protection. My development environment: STM32CubeIDE v1.19.0 To verify firmware download capability, I created
Hi everyone,I’m currently working with STM32 Secure Boot and Secure Firmware Update (SBSFU) and integrating it with my custom application. I’m trying to design the project in a modular and scalable way for long-term use, and I would really appreciate some guidance from those who have worked with SBSFU in production. Current ScenarioMCU: STM32 (Cortex-M series)Bootloader: SBSFUApplication: Custom firmware using HAL, middleware, and CubeMX-generated codeDevelopment tool: STM32CubeIDE Challenges I’m Facing1. Shared Drivers & MiddlewareBoth my bootloader and application require:HAL DriversSome middleware components What is the best way to manage duplication vs sharing?Should bootloader and application maintain completely separate copies of Drivers/Middleware?Is there any recommended way to keep them in sync without tight coupling? 2. Impact of .ioc ChangesI use CubeMX via .ioc for peripheral configuration.If I:Add a new peripheralModify clock or pin configurationHow
Hi Team,I have successfully integrated and run SBSFU with my custom application, and it is working as expected.Currently, I am transferring the .sfb file .via USB to the DWL_SLOT. Once the transfer is complete, I trigger a reset using NVIC_SystemReset(), and the process works fine.I have a few questions regarding the .sfb header. It contains fields such as:FW Tag (SHA-256)Header SignatureFirmware Size (FwSize), etc.My questions are:Using FW Tag (SHA-256) for validationIs it possible to use the FW Tag (SHA-256) to validate the received image in the DWL_SLOT before performing the reset?If yes, could you please guide me on the correct process to implement this?Current CRC-based approachAt present, I am calculating a CRC for the .sfb file after it is generated by the Python script. I then transfer both:The .sfb fileA separate CRC fileOn the firmware side, I recompute the CRC from the received data and compare it with the provided value. If it matches, I proceed with
HiI've been trying to understand what level of support is available for the H573 security features in Zephyr RTOS with mcuboot but either can't find any information or no one replies to my comments.I have a Zephyr sysbuild build working where mcuboot starts, validates the singed application in slot0 and proceeds tp boot from slot0.What I can't find or confirm is if that security features of the STM32H573 are being used or not. There doesn't seem to be any configuration relating to enabling or disabling the features.Are the security features enabled in Zephyr for the H573?I'm using the latest 4.2 version of Zephyr.CheersDave
Dear Community, dear STMicro, I'm trying to encrypt data on an STM32WL55JC device using the STM32CubeExpansion_Crypto_V4.5.0 library and then using Python on the PC to decrypt it again.I've taken the example code for RSA encryption from the librarySTM32CubeExpansion_Crypto_V4.5.0/Projects/NUCLEO-WL55JC/Applications/RSA/PKCS1v2.2_EncryptDecryptand adapted it.I've created an RSA 2048 bit key on my PC using this code:private_key = rsa.generate_private_key( public_exponent=65537, key_size=2048) pem = public_key.public_numbers() public_exponent = ["0x%02s" % e[i:i+2] for i in range(0, len(e), 2)] n = "%X" % pem.n n = "0" + n if len(n) % 2 == 1 else n modulus = ["0x%02s" % n[i:i+2] for i in range(0, len(n), 2)] f = open("pub.c", "w") f.write("public_exponent[] = {%s}\n" % ", ".join("%s" % s for s in public_exponent)) f.write("modulus[] = {%s}" % ", ".join("%s" % s for s in modulus)) f.close() From this code I get something like thispublic_exponent[] = {0x01, 0x00, 0x01} modulus[]
I am trying to integrate Crypto lib to NUCLEOF303RE Board, Any guide or any suggestions would help
Hi all,I'm trying to replay the demo from this video https://www.youtube.com/watch?v=Kn6JHVcY7hA The provisioning and debug authentication works fine, but the application hangs.I never passes the MX_ICACHE_Init() function. And sometimes in the MPU init or config function. The project is standard generated code, I'm using STM32H573I-DK but empty chip project like in the video.Project settings : Select STM32H573IIKxQ Click yes on enabling ICACHE and MPU Enable trustzone Secure project only Generate DA folder Bootpath : STiRot + Secure Application (offset 0, offset 0x100000, size 0x100000) PI9 as output and PC13 as input Generate project Add loader.h and loader.c and add blinky like in the video The project was imported in STM32CubeIDE 2.1.1 and build fine.I've used provisioning.bat to provision my board to CLOSED. LD1 on the board turns on but doesn't blink.After connecting to the board with Debug Authentication it seems to hang in MX_ICACHE_Init -> if (HAL_ICAC
Hi All!I'm trying to wrap my head around STM32H573 with trustzone, STiRoT etc in STM32CubeMX and I'm missing some information on the firmware sizes.The STM32H573 has 2MB flash, secure part is from 0x0C00_0000 to 0x0C1F_FFFF. When I select STiRoT + Secure partition and open OBkey settings I want to use maximum firmware size, which is 1MB in my understanding (download area must be same size as application area). So I set firmware offset to zero, firmware download area offset to 0x0010_0000 and firmware area size also to 0x0010_0000. When I generate obkey it gives me firmware slots 0 with address 0x0C00_0000 with size 0x10_0000 and slot 1 with address 0x0C10_0000 with size 0x10_0000. But the mapping says Start address 0x0C00_0400 and End address 0xC0F_FFFF which is different from the configured address/size.If tried going to Tools -> Memory Management but that gives a different image again!That gives a size of 123kB and address range 0x0C00_0400 - 0x0C01_EFFF, which appears t
I got an error when downloading the .sfi file to STM32H753II using the STM32Programmer_CLI, my HSM version is V2AE.The error message is as follows: What its mean?V2AE cannot support STM32H753,and must use HSM_V1?or H753 cannot support SFI ?I’m a new use about SFI.Looking forward to your reply.
Hello All,I have a certain STM32H7 that I can't erase sector 0 using STM32CubeProgrammer.I think it is because PROT_AREA_START1 and PROT_AREA_END1 are not correct. I am trying to get back to default values of PROT_AREA_START1 =0xFF (0x0800ff00)PROT_AREA_END1 = 0x00 (0x080000ff) to disable the protection.However I cant Actually change the option bytes through the programmer. I get:an error: "Expected Value for option byteP: "PROT_AREA_START!: 0xFF, fount 0x00"RDP is level 0 (AA)I am using ST-link. Thanks for any help,Trevor
Hi EveryoneRequesting clarification on one topic:Does STM32U585 have support for PQC algorithm with any software library that has been validated on the same controller, as there is a requirement for PCI PTS 7, that the device should support PQC Algorithm and we need an evidence to show the same for the same controller. On searching XCube-PQC Library supported devices mentions STM32H563ZI only.Requesting confirmation in this regardThanks and RegardsPhilip
Hello ST team,We are working with the STM32WL5MOC6HTR module for a LoRaWAN end-device design.We understand that the STM32WL5MOC6HS variant includes an STSAFE-A110 secure element, but our custom module (MOC6HTR) does not include STSAFE.Our question is about securely storing LoRaWAN keys such as:AppKeyNwkSKeyAppSKey We are exploring options like:Using the LoRaWAN Crypto middleware (Middlewares/Third_Party/LoRaWAN/Crypto) with the internal AES peripheral,Leveraging SBSFU (Secure Boot and Secure Firmware Update) for Flash protection (RDP/PCROP),Or possibly using KMS-MW (Key Management Services Middleware). Could you please confirm:What is the recommended approach for securely storing LoRaWAN keys in the STM32WL5MOC6HTR, where STSAFE is not present?Can KMS-MW or SBSFU be used on this device to provide a secure key storage area or API abstraction similar to a secure element?Are there reference examples or application notes for integrating LoRaWAN key storage with SBSFU or KMS on ST
Hello.I'm having trouble transfer the UserApp to SBSFU. Here's the description of the issue.I am working on SBSFU on STM32H753-Eval, So i altered the given sample for my UART to map to ST-LINK VCP. I am able to see logs post this changes. Later I Dissabled all security stuffs with below macro and fully erase the board (by setting RDP level 1->0 ).I'm using the 2-Image example code, All security feature were disabled by#define SECBOOT_DISABLE_SECURITY_IPS in app_sfu.h. I loaded SBSFU.elf onto the board and transferred the UserApp.sfb via YMODEM. However the program went into a infinite reset loop. It is rebooting every time i send UserApp.sfb. I tried Increasing the Download Timeout from 3000 to 10000 from this macro, same issue /* Teraterm YMODEM */ /* #define SFU_COM_YMODEM_DOWNLOAD_TIMEOUT ((uint32_t)3000U) */ #define SFU_COM_YMODEM_DOWNLOAD_TIMEOUT ((uint32_t)10000U) /* IIs there any specific step i need to follow ?... kindly guide me here.&nb
Left commented out SFU_NO_SWAP and defined ENABLE_IMAGE_STATE_HANDLING in app_sfu.h, but when trying to build SECoreBin and SBSFU errors appear:/Middlewares/ST/STM32_Secure_Engine/Core/se_fwimg.h:47:61: error: unknown type name 'SE_FwStateTypeDef'Is there something I am missing? I selected AES-GCM crypto schemeI have followed https://www.st.com/resource/en/application_note/an5056-integration-guide-for-the-xcubesbsfu-stm32cube-expansion-package-stmicroelectronics.pdf (Chapter 8.5)
Hello everyone,I'm working with the STM32L562E-DK board and the STM32Cube_FW_L5_V1.5.0 firmware. I want to integrate my own code (which reads a sensor MPU6050 via I2C) into the STM32CubeL5 TFM (Trusted Firmware-M) application, running it in the Non Secure environment. The base project I'm using is TFM_Appli, which comes in the package, and I've added my source code to the NonSecure section.I created a separate project in STM32CubeMX using the board's I2C1, which utilizes pins PB6 (SCL) and PB7 (SDA). I then generated the code and copied the I2C communication initialization code into the "main.c" file of my "TFM_Appli_NonSecure" project. Specifically:/* This is before "int main (void)"-----------------------*/ I2C_HandleTypeDef hi2c1;/*------------- I'm calling these function from "int main(void)" ------------*/ static void MX_GPIO_Init(void) { /* USER CODE BEGIN MX_GPIO_Init_1 */ /* USER CODE END MX_GPIO_Init_1 */ /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOB_CLK_ENABLE(); __H
Hello,I am using STM32H750 and X-Cube-Crypto lib. I am working on a secure boot and want to calculate the app Hash value to check integrity. The library works fine for STM32L5 Mcu (Already tested) but not with STM32H750. I verified that I am using the correct lib libSTM32Cryptographic_CM7.a.The issue I get is a Hardfault triggered by a function in the lib. When I investigated more, I found that The Mcu tries to load data from a Peripheral Register not mapped for STM32H750 MCU.What do yo think could be the issue? Thanks,Ayoub
Hi, I am working with the SBSFU_Boot on the STM32U5A9 chip. After the SBSFU_Loader has written the update image into internal memory, a reset happens in order for the SBSFU_Boot to write the image to be booted. When performing the update, it ends up in a process where it has to do some encryption. The SAES engine is initialized successfully, and then AES_Encrypt is called. This keeps on failing because a read error is reported in the SAES->SR reports a read error upon enabling the SAES peripheral. It should be noted that the initialization and encryption sequence is strictly followed per instructions in RM0456 Rev 6 sections 50.4.4 (Initialization of SAES) and 50.4.8 (ECB/CBC encryption sequence) respectively. What am I missing?
Hello,I am following the blog "Implementing Debug Authentication on STM32H5 using CLI tools" (https://community.st.com/t5/stm32-mcus/implementing-debug-authentication-on-stm32h5-using-cli-tools/ta-p/622308) to provision my STM32H533RE based custom board on which i have configured secure word only(All the peripherals configured as secure) and i have disabled Non Secure Project from "Project Manage" tab of STM32CubeMX, and I am now stuck with the device in CLOSED state with no way to regress.Environment:Board: NUCLEO-H533RE (STM32H533RET6)STM32CubeProgrammer: v2.22.0STM32CubeH5 Firmware: v1.6.0ST-LINK FW: V2J47S7SFSP Version: v1.2.0OS: WindowsWhat I did (step by step):Step 1 — Flashed secure firmware (succeeded with mode=UR):STM32_Programmer_CLI.exe -c port=SWD mode=UR -e all -d C:\H5\Binary\Sec_FP_Sensor_v1_2_Secure.elf -vResult: :white_heavy_check_mark: Download verified successfullyStep 2 — Set product sta
Hi,I am setting up SBSFU on our STM32H750. I want to test the RDP and WRP security protections.Steps taken so far:I have enabled WRP and RDP Level 1 by setting the option bytes through cubeprogrammer and enabling SFU_WRP_PROTECT_ENABLE & SFU_RDP_PROTECT_ENABLE in app_sfu.hI have enabled SFU_TEST_PROTECTION in app_sfu.h Note:There are several test cases in sfu_test.c that I am using. The tests in questions are attached below:TEST_ERASE_FLASH is failing. Output:I am not sure why this would be. Does anyone have any advice?
When we provision the Secure Manager on the STM32H5 and there is no non-secure application available (yet), then the Secure-Manager-Demo-Application currently starts flashing all LEDs on the STM32H573I-DK.Now we wonder how this would affect our project-specific hardware if the provisioned Secure Manager configures some ports and starts toggling PF1, PF4, PI8 and PI9.So, what peripheral does the Secure Manager configure/use? And how are they configured?Is it possible to suppress/remove this Secure-Manager-Demo-App (SMAK_Appli)? => no port configuration, no LED togglingbr, Oliver
Hi,I have a question regarding STiRoT provisioning on the STM32H573.As I understand, during the Secure Boot provisioning process, the public key hash is injected into the OBKeys area of the device to establish the root of trust. However, I would like to clarify where the original public key itself is stored and how it is handled during runtime verification.Based on our current design, we are planning the following approach:The firmware image is signed using our own external HSM, not STM32HSM.The corresponding public key hash is provisioned into the device OBKeys during manufacturing.At boot time, STiRoT checks that the public key contained in the firmware image matches the provisioned public key hash, and then uses that public key to verify the firmware signature.From this perspective, our understanding is that the device does not store the full public key in its internal non-volatile memory (e.g., OBKeys or other secure areas), but instead relies on the provisioned public key hash in
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.