Ask questions and find answers on STM32 security frameworks and tools, including cryptographic libraries, TrustZone, and the Secure Manager.
Most recent activity
Hello, I'm using the STM32H563 and performed a standart procedure to change the product state, perform provisioning and change the product state to closed, all through standart provision operation with the STM32CubeProgrammer for the first time working with this core.It worked, the product lost interface with the debug, I can't read it's flash memory through the software, but it's failing to perform the debug authentication and full regression of the processor to OPEN product state again.I tried running the discover command in STM32CubeProgrammer, tried with the regression.bat batch file of an example application (https://wiki.stmicroelectronics.cn/stm32mcu/wiki/Security:How_to_start_with_DA_access_on_STM32H573_and_H563-TrustZone_disabled_-_stm32mcu) and nothing is working.I'm using a STLINKV2 and tred all possible combination of configurations of it, updated the STLINK firmware with the STM32CubeProgrammer. The closest I got to performing the regression is in these screenshots and att
I can't run the exe file on my pc, due to internal policies.Could someone upload the whole directory structure and files in github?
Hello,I am trying to compile the TFM application, but when building the TFM Appli Secure project, it says it cannot find the file tfm_parse_manifest_list.exe and gives me errors because not all the .h files that should be generated by running the prebuild_s.sh script are being created.. Any help?
I'm using H753 which has hw crypto, and was hoping to improve the sbsfu execution time (e.g. time to validate FW header at start tup) by enabling hw crypto. However HAL_CRYP_MODULE_ENABLED doesn't do anything. I looked through the integration guide and starter doc for the sbsfu, the only place talking about hardware decryption is 7.2 in an5056, "implementing a hardware decryption" by "Select STM32 devices integrating cryptographic hardware IP", but no detail guide was provided.Is it possible to enable sbsfu to use hardware crypto acceleration? Or that will require a major customization effort in the SECore?
Hi,i am trying to develop a device which sends out bthome advertisements via ble (some sensor data).So far so good, this part is working, but now i would also like to use bthome encryption.https://bthome.io/encryption/So following this guide, i would need AES128 - CCM and MIC.What i did so far is enabling AES and set it to be CCM and added a key (using CubeMX).In the generated code i now have the hcrypt handle.What i did afterwards -> I collected all the described data to create the nonce: uint8_t nonce[13]; // MAC Address nonce[0] = mac_address[0]; nonce[1] = mac_address[1]; nonce[2] = mac_address[2]; nonce[3] = mac_address[3]; nonce[4] = mac_address[4]; nonce[5] = mac_address[5]; // add bt_home_device_info nonce[6] = bt_home_device_info; // add UUID nonce[7] = (uuid >> 8) & 0xff; nonce[8] = uuid & 0xff; // add counter nonce[9] = (counter >> 24) & 0xff; nonce[10] = (counter >> 16) & 0xff; nonce[11] = (counter >> 8) &
Hello st forum, I'm currently working on mcu STM32G0B1VCI6; the part of the code that I'm using is considering the setup of the crypto lib and the CRC engine. However, I noted that the CRC configuration is being changed automatically when some crypto functions are invoked. Example:Initialize CRC engine with specific configuration.Initialize crypto Lib by calling cmox_initializeCall cmox_ecdsa_verify to verify signature.Calculate some CRC of certain memory block. The result in step 4 is different than the expected (compared against an online tool) but if the CRC is calculated between step 2 and 3, the CRC matches. I wonder if crypto library forces a reset in the CRC registers for its own purposes.Is this a bug in the crypto lib or is expected? if it is expected how can I use the desired CRC configuration without impacting crypto lib?I hope you can help, regards.José Daniel
Hello,I am following the guide to generate SFI files. I am testing and have programmed the HSM. Is there any way to "restart" the HSM? Is there any way to start the guide over as if I hadn't done anything?I am particularly interested in obtaining information about the HSM to be able to run the tests an restart the HSM if necessary.The problem is that I have a limited number in the HSM counter (25) and I would like to know if it's an issue if it reaches 0 or not. Best regards,
Dear Team, I hope this message finds you well. I am reaching out to inquire about the possibility of debugging an application through USB connectivity following the installation of the Secure Manager. Specifically, I am interested in knowing if it is feasible to load and debug the application in USB mode after the Secure Manager has been set up.Thank you for your time and assistance.Best regards,P.Hitesh
hi i am implementing a TFM based project on stm32u585 microcontroller. i taken reference from the cubeU5 package to implement the TFM code stm32U585 SBSFU .in my application i need to use the ECDSA signing and verification using the PSA APIs available on the package. i implemented functionality of ECDSA signing and verification using the ECC key pair i generated in the code itself. The problem is i can able to sign and verify the same signature when am using secp256 curve and secp385 curve(while generating key pairs). but when using secp521 curve the signature verification fails. Can anybody helps me in this.this is my ECDSA test APIECC key pair generation (here in the sets_key_bits api if i use 256 and 384 the whole functinalty works fine but when using 521 its failing in the verification)import the public key for the verification @Jocelyn RICARD edit: when i disable the hardware accelerator in the crypto library the ECDSA verification with secp521 curve works fin
I hope this message finds you well. I am encountering an issue where I cannot access the RAM and Flash usage statistics within the Build Analyzer feature of CubeIDE version 1.15.1. Upon attempting to view these metrics, the fields appear empty, preventing me from effectively monitoring and optimizing my project's resource utilization.Could you kindly assist me in resolving this issue? Your guidance on how to properly access or troubleshoot these metrics would be greatly appreciated. I am eager to continue developing my project efficiently but am currently hindered by this limitation.Thank you in advance for your support. I look forward to your prompt response. Best Regards,Hitesh
Hi,I am doing feasibility on SBSFU bootloader on STM32H753ZI. Currently in our firmware we are planning to have a custom bootloader based on SBSFU for secure boot and update. But I came across SFI feature from ST to ensure protection at the manufacturing end.1. Is it possible to use SFI package if we are using SBSFU as bootloader? Because I found SFI uses RSS bootloader(system bootloader) whereas SBSU is loaded from flash.2. Is it mandatory to have an external flash if we want to use SFI, Can it work with just internal flash?I am relatively new to this area. Kindly provide support.
Hi,I have followed below youtube link for enabling debugging for TFM firmware successfully.https://www.youtube.com/watch?v=rlmQhfXyYCQ&list=PLnMKNibPkDnGd7J7fV7tr-4xIBwkNfD-- I enable single binary for both Appli_NonSecure and Appli_Secure by choosing below configuration. #define MCUBOOT_APP_IMAGE_NUMBER 1#define MCUBOOT_S_DATA_IMAGE_NUMBER 0#define MCUBOOT_NS_DATA_IMAGE_NUMBER 0#define MCUBOOT_IMAGE_NUMBER 1Since then I am not able to debug via ST-link debugger. I need support to resolve this.@Jocelyn RICARD
I can't get ECDH working for CURVE25519 using the STM32 HAL / crypto lib. This may be an issue with the somewhat confusing constants for this library. I can get the NIST curves working with ECDH. The trouble I have is it seems there are two cmox_ecc_impl_t constants: CMOX_ECC_CURVE25519 and CMOX_ECC_CURVE_ED25519. Here is some abbreviated test code: // inputs: size_t pubLen, uint8_t* secret, size_t secretLen // create randoms for local test key uint16_t randSize = pubLen; uint8_t randBuff[randSize]; // ... set randoms via HAL_RNG_GenerateRandomNumber ecc_key_t localKey; if ((result = cmox_eddsa_keyGen(&eccHandle, CMOX_ECC_CURVE_ED25519, randBuff, randSize, localKey.private, &localKey.privLen, localKey.public, &localKey.pubLen)) != CMOX_ECC_SUCCESS) { return result; } // create randoms for remote test key // ... set randoms via HAL_RNG_GenerateRandomNumber ecc_key_t remoteKey; if ((result = cmox_eddsa_keyGen(&eccHandle, CMOX_ECC_CURVE_ED25519, rand
Hello Team,As we approach the final stages of our project, we're exploring options for deploying the Secure Manager and Application efficiently. We're particularly interested in whether it's feasible to install these components via UART or alternative methods suitable for mass production environments.Understanding the process and requirements for such installations would greatly assist us in completing our project successfully.Could you kindly provide guidance on the procedures involved, any prerequisites, and potential challenges we might encounter?Your expertise and insights on this matter would be invaluable to us.Thank you for considering our request.Best regards,P.Hitesh
Hi @Jocelyn RICARD Greetingswe are working on the STM32u585 TFM Application and are facing issues when running the code. the issue is after dumping the code using the TFM_Update.sh script first time every operation is normal, but while running for the next time and checking the option byte configuration they have changed and hence am not able to run the script. The main changes observed are as follows as shown in the option byte screen as below:1. 2. 3. 4. Sometimes the change of option bytes will work after changing the value of boot0 pin.Then the work around is to manually update the values as per UM2851. could you please suggest how this change is happening after running the code and how can we solve this issue.Thanks and RegardsPhilip
Hello,I have a use-case with a soldered battery, which I can not power-cycle after programming, however I have to set option bytes to restrict Flash reading.I found online that going into STANDBY mode or rather, returning from STANDBY mode, would update the option bytes. However, the option bytes are not set. Here is the relevant code block: #if !defined(BOOTLOADER_DISABLE_AUTOLOCK) // Auto-enable RDP level 1 (JTAG readout protection) FLASH_OBProgramInitTypeDef option_bytes; HAL_FLASHEx_OBGetConfig(&option_bytes); if (option_bytes.RDPLevel != OB_RDP_LEVEL_1) { printf("Incorrect RDP level detected, auto locking\n"); if (HAL_FLASH_Unlock() != HAL_OK) { goto option_byte_panic; } if (HAL_FLASH_OB_Unlock() != HAL_OK) { goto option_byte_panic; } option_bytes = (FLASH_OBProgramInitTypeDef) { .OptionType = OPTIONBYTE_RDP, .RDPLevel = OB_RDP_LEVEL_1 }; if (HAL_FLASHEx_OBProgram(&option_bytes) != HAL_OK) { goto option_byte_pan
Hello everyone,I am working with the STM32H7B3 and after enabling the secure user memory, i am not able to connect with the debugger anymore:For testing if secure user memory works, i put a "secure_function" in a section at the end of my flash, then enabled the secure user memory for that section and called the function from the unsecure area (which should result to a bus fault). The questions are:1. What did i wrong?2. Why can i not connect to the board which the jlink debugger? I didn't change any option byte except the security OB.Also i don't thing that the program got stuck in the secure area, because the unsecure area should run first after reset (see code below). Console output: Here is the code i used to configure the secure user memory: void __attribute__((__section__(".secureareatest"))) secure_function(){ count++; } bool setSecureUserMemoryProtection(FLASH_OBProgramInitTypeDef& flash_option_bytes) { const uint32_t secure_area_start =
Hi, I just accidentally modified the PRODUCT_STATE to provisioning and not able to recover.So, I tried to do the OBKey Provisioning and use DA to regression back to Open State.I've created my OBKey:However, provisioning always failed.Is there any other settings need to be turned off for OBKey Provisioning?Or is there any other way to turn PRODUCT_STATE back to OPEN again?
I am worried about the data that i send through the STM32WL55JC if any outsider with the same board and using the same frequency in receiver mode ,can also get the data that i am sending through the transmitter using same frequency ,How do i secure my data .
Hi Good day, Trying to understand the CRYPTO module for MAC generation, particularly AES CBS MAC. Which algorithm mode i have to choose?, found AES CBC not AES CBC MAC.
Hi,I´m trying to implement a simple ECDH test by implementing the functions from the Cryptographic Library V4.2.0.There are two persons A and B generating a pair of private and public keys. The keys are generated by the cmox_ecdsa_keyGen(...) function.The curve is BrainpoolP256R1.When trying to calculate the shared secret with cmox_ecdh(...) the function returns with CMOX_ECC_ERR_INVALID_PUBKEY. I´m assuming that the generated public Key is not valid (it´s not placed in the elliptic curve).What could be the cause?Thank you!Here´s my code: void ECDH_test(void) { //Prepare Time Measurement #define CYCCNTENA 0x00000001 CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; DWT->CTRL |= CYCCNTENA; /***********************************************************************************************************/ //Variables cmox_ecc_handle_t Ecc_Ctx; uint8_t Working_Buffer[2048]; cmox_ecc_retval_t retval; size_t computed_size; //Choose Random 32 Byte Value for Person
Hi, how to do signature verification in stm32u575 with RSA-2048?
Hello everyone,i am trying to enable the secure user memory on the stm32h743 using the x-cube-sbsfu project and have the following problem:After activating the security bit, the value of the OPTSR_PRG flash register is not changing, so the security bit is not set and therefore i cannot configure the secure user memory.I use the function SFU_LL_SECU_SetProtectionSecUser from the sfu_low_level_security.c file for the configuration and before calling the function i also called HAL_FLASH_Unlock() and HAL_FLASH_OB_Unlock().Does anyone know what could be the problem? /** * @brief Apply Secure User Memory protection. * psFlashOptionBytes: pointer to the Option Bytes structure. * pbIsProtectionToBeApplied: Output parameter to be set as "TRUE" if * this OptByte has to be modified and immediately reloaded. * @retval SFU_ErrorStatus SFU_SUCCESS if successful, SFU_ERROR otherwise. */ SFU_ErrorStatus SFU_LL_SECU_SetProtectionSecUser(FLASH_OBProgramInitTypeDef *psFlashOptionByt
Hello. I'm trying to obtain CRC value from CRC peripheral. It's supposed to give me 8 bit number. Instead it gives me 32 bit number. What am I doing wrong? Below is the code and program outputs. /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2024 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" /* Private includes -------------------------------------
HiWhen I was returning from RDP level 1 to 0 the stm32cube programmer program crashed and now every time I try to access the microcontroller several different cases happen:1- Connect and instantly lose the connection giving the next error: Error: Data read failed2-Cannot connect to access port 0! If you are trying to connect to a device with TrustZone enabled, try connecting with HotPlug mode. If you are trying to connect to a device that supports debug authentication with a certificate or password, open your device using it.3- Detects the id 0x00 when it should be 0x482, Error: Unable to get core ID
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.