TODAY | STM32 Summit 2026
Ask questions and find answers on STM32 security frameworks and tools, including cryptographic libraries, TrustZone, and the Secure Manager.
Most recent activity
Hello ST Community,I am working with an STM32U5 based board and facing serious issue related to RDP Level 2 and debug access. I am attempting to recover the device using STM32 Programmer CLI and Cube Programmer but it is not responding as expected even after a successful RDP2 password unlock.$ STM32_Programmer_CLI.exe -c port=swd mode=UR -unlockrdp2 0x18BBDDEF 0x19CCBBEF-------------------------------------------------------------------STM32CubeProgrammer v2.19.0-------------------------------------------------------------------ST-LINK SN : 003200253133510636303739ST-LINK FW : V3J15M7B5S1Board : STLINK-V3SETVoltage : 3.54VError: Unable to get core IDError: No STM32 target found! If your product embeds Debug Authentication, please perform a discovery using Debug AuthenticationError: Unable to get core IDST-LINK SN : 003200253133510636303739ST-LINK FW : V3J15M7B5S1Board : STLINK-V3SETVoltage : 3.54VUnlock RDP2 password successfully doneError: ST-LINK error (DEV_TARGET_NOT_HALTED)&n
Moved from this thread.Any method to implement X-CUBE-CRYPTOLIB in a project ?
I am working through this course but am stuck because the new 2.0.0 version of SM no longer provides the batch files like provisioning_auto.bat that are referenced in the course and I am unsure how to continue.Also posted this on the course page at https://community.st.com/t5/stm32-online-courses/stm32h5-secure-manager-course/bc-p/817896/highlight/true#M24 but putting it here, too, for better visibility. Any help is appreciated.Thanks,Chris
We attempted to change the product state to "Closed" on STM32H523, and this operation was successful. We can perform a full regression to the "Open" state. However, we are experiencing unexpected behaviour during the provisioning stage. The code in the microcontroller was not executing, and the Keil debugger was unable to connect with an error message "Could not Stop Cortex-M device". A reset did not resolve the issue, indicating that the code could not run. After switching the microcontroller to the "Closed" product state, the code ran properly again.We likely need to modify specific settings in the options byte to enable the code to run during the provisioning state. We would appreciate assistance in resolving this issue, as we would like to change the product state and write the .obk file directly from the firmware.
Hi, I am working on the STM32H533RE microcontroller and implementing AES-CCM encryption using a NIST test vector for validation. While the encrypted output matches the expected result, the authentication tag generated is incorrect. I have shared the relevant code and configuration above for reference.CRYP_HandleTypeDef hcryp; uint32_t pKeyAES[4] = {0x40414243,0x44454647,0x48494A4B,0x4C4D4E4F}; __ALIGN_BEGIN static const uint8_t HeaderAES[16] __ALIGN_END = { 0x00, 0x08, // Length = 8 bytes 0x00, 0x01, 0x02, 0x03, // AAD 0x04, 0x05, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, // Padding 0x00, 0x00 }; __ALIGN_BEGIN static const uint32_t B0AES[4] __ALIGN_END = { 0x4f101112,0x13141516,0x00000000,0x00000004}; uint8_t sampledata[4] = {0x20, 0x21, 0x22, 0x23}; uint8_t sampleoutputdata[8]; uint32_t sampletagdata[8]; // 4 bytes static void MX_AES_Init(void) { /* USER CODE BEGIN AES_Init 0 */ /* USER CODE END AES_Init 0 */ /* USER CODE BEGIN AES_Init 1 */ /* USER CODE END AES_
Hello! I would have an app that is divided between a secure part and a non secure part. The memory definition is as following in the secure linker script: /* Memories definition */ MEMORY { RAM (xrw) : ORIGIN = 0x30000000, LENGTH = 320K FLASH (rx) : ORIGIN = 0x0C000000, LENGTH = 64K FLASH_NSC (rx) : ORIGIN = 0x0C010000, LENGTH = 8K } The first 9 sectors (0-8) are of the secure part.When attempting to erase sector 9 (the 10th) sector from the Secure application part using:'HAL_FLASHEx_Erase' I get a HAL_FLASH_ERROR_ECCD error. I require this for software update, I am trying to do the following on the INACTIVE bank:1) Delete the secure sectors and update with a new secure app2) Delete the non-secure sectors and update with a new non-secure app From my knowledge the secure part should be able to erase the non-secure part without any problems.
Greetings,I want to implement encryption in STM32F205RG. I came to know that there is no Hardware support, so is there any STM32 crypto library for STM32F205RG ? I want to implement AES encryption and decryption function. Thanks for support.
I am still very new to embedded programming. I am trying to walk through the SBSFU example application for the B-U585I-IOT02A from STM32CubeU5. The board I am using is STM32U5A9J-DK. I tailored some of the build settings in STM32CubeIDE for STM32U5A9J-DK according to the README. In order to get things to work, for the configuration, I had to disable Anti-Tamper (since with it enabled, the main menu would not display). I have a few questions:Besides the build settings, are there any hardware related code changes that I need to tweak in order to get the example running correctly? The two boards seem to have similar hardware layout for user button and led6 (but I wasn't sure if there were any hardware specific changes that I needed to make).When running the application and selecting option 1 (Test Protections) from the main menu in Tera Term, I get that Data Secure Start and End has been DENIED as well as some other reading of flash bytes. Is this the expected result? I've attached the te
For context , i was trying to testout OMEiRoT and DA ,i successfully managed to lock , and regress using the password method and i tried to replicate the STiRot method shown in the STiRot handson video to try the OMEiRoT example project in the nucleoH563 projects but some where along the way my dumb ass missed some information and when i flashed the project , the previous application is running howwever the DA got turned on and i got locked out and i have tried all the key and certificate combo but couldnt connect to the board, if there by chance any way i can recover this nucleo board , its my second bricked nucleo and i really hope i can some how manage to regress it and sadly as i was just testing LED blinking i havnt implemented any bootloader ,and i would appreciate any links to a good example for adding bootloader before i try to continue my learning journey any further so i have atleast one more way to recover the device if anything goes wr
Hi,I'm using an STM32H563VG (1MB Flash version) on a custom board. I have a STLINK-V3MINIE connected and I'm using STM32CubeProgrammer.When I'm doing a full chip erase, the content of the flash memory is not altered, everything is still there when I read it back. It works nicely on the 563ZI on the Nucleo dev kit.This happens both with Trustzone enabled and disabled.Since there is not really a dependency here to the custom board (except providing 3.3V power), is this a known bug?Product state is ED (open), TrustZone disabled (C3) Anyone using the 1MB version? Also in the option bytes, I do not understand the defaults for SECWM1 and SECWM2 addresses, the default to e.g. 7f. In my understanding, that is the sector number for the 2MB Version and it should be 0x3F on the 1MB Version. The address shown for SECWM2_END for sector 0x7f is 0x0817e000 which is outside of the actual address range of the second flash bank. BestCornelius
I am testing this with a set of STM32F573 boards, the example taken straight from CubeMX example selector for the STM32H573I-DK board without any changes. I am running it until after the call to HAL_CRYPEx_WrapKey() and before the call to HAL_CRYPEx_UnwrapKey(): /* USER CODE BEGIN 2 */ /* User key AESKey256 encryption*/ if (HAL_CRYPEx_WrapKey(&hcryp, AESKey256, Encryptedkey, TIMEOUT_VALUE) != HAL_OK) { /* Processing Error */ Error_Handler(); } /* we could not compare results, key is not known and unique for each device */ /* User key AESKey256 decryption*/ if (HAL_CRYPEx_UnwrapKey(&hcryp, Encryptedkey, TIMEOUT_VALUE) != HAL_OK) { /* Processing Error */ Error_Handler(); }Where it says "we could not compare results, key is not known and unique for each device".However, I am comparing results because I am expecting Encryptedkey[] to be different for each chip. But it is always the same!When the chip has TrustZone disabled, it is (in hex):CB3E195F 345C0D8C FAEF2E
Good day!I have custom board with cpu stm32l562. I am prepared all data and global license. CPU prepared by script file from package STM32CubeExpansion_SFI_v1.5.0 L5.This operation is OK.But after if start programm by Cube Programmer ( v 2.19 ) - i have error all times.I am add log with this errors...Help me, please. 12:25:13 : SFI parsing file started ...12:25:13 : SFI header information :12:25:13 : SFI protocol version : 212:25:13 : SFI total number of areas : 412:25:13 : SFI image version : 012:25:13 : SFI Areas information :12:25:13 : Parsing Area 1/4 :12:25:13 : Area type : F12:25:13 : Area size : 8056012:25:13 : Area destination address : 0x804000012:25:13 : Parsing Area 2/4 :12:25:13 : Area type : F12:25:13 : Area size : 6566412:25:13 : Area destination address : 0xC00000012:25:13 : Parsing Area 3/4 :12:25:13 : Area type : F12:25:13 : Area size : 12812:25:13 : Area destination address : 0xC03E00012:25:13 : Parsing Area 4/4 :12:25:13 : Area type : C12:25:13 : Area
STM32H730, an invalid tag is generated for payloads that are not a multiple of 4, as described in Re: STM32U545 AES GCM Tag mismatch - STMicroelectronics Community.AES-CCM: no issues, everything works.AES-GCM:The HAL already handles required padding on its own.Encryption and tag generation - workDecryption - worksTag generation after decryption - invalidTried with and without AD. Tried to provide AD and/or Ciphertext as a multiple of 4 and 16 bytes (as suggested by other posts; however, the H7 HAL already handles padding). The resulting tag after decoding is invalid for a ciphertext of a length that is not a multiple of 4.Everything works when the ciphertext is a multiple of 4 bytes (but not when manually padded to such with 0-oes at the end). The ciphertext of 15 bytes won't generate a correct tag, but it works when it is 12 or 16 bytes.Standard HAL functions are used: HAL_CRYP_Encrypt, HAL_CRYP_Decrypt, HAL_CRYPEx_AESGCM_GenerateAuthTAG, and HAL_CRYP_SetConfig.What am I doi
In the past I've used F401 and the following code works flawlesslyHAL_FLASH_Unlock(); HAL_ICACHE_Disable(); uint64_t myWord = 0x00000001; HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, 0x080C0000, myWord); HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_SET); HAL_FLASH_Lock(); HAL_ICACHE_Enable();Now, after switching to U385, i only get grief, with any Write command exiting in HardFault_Handler(). My research points to Option Bytes - Write Protection being enabled but the GUI in STM32CubeProgrammer is very confusing for U385, and it seems that I may have permanently locked the MCU? I cannot tick back the UNLOCK_1A _1B _2A and _2B flags. How can one unlock the Flash fully in U3?
Hello everyone, I'm learning about MCUboot. Currently I have tried searching for information online but still don't have an overview. So I hope everyone shares their experiences about MCUboot (things to learn here) and give me some programs to better understand it. Thank you very much.
Hello, I have been modifying the OEMUROT_Boot application and associated build scripts in ROT provisioning to complement our custom firmware project. (See my previous post on this topic for details). This is for the STM32N6, using the DK discovery kit.I have gotten to the point where the builds all seem to work, I program the external memory on the DK board with the bootloader and my custom firmware, and attempt to launch.The OEMUROT_Boot traces do show up in Tera Term:[INF] TAMPER Activated [INF] Starting bootloader OEMuROT 00000001 [INF] Primary image: magic=bad, swap_type=0x3, copy_done=0x2, image_ok=0x2 [INF] Scratch: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3 [INF] Boot source: none [INF] Swap type: perm [INF] 1, 7e, cf, 18, ef, 4e , 89 ,a7, [INF] f7, ac, f6, 5a, 4f, 91 , ac ,d5, [INF] Image version 0 : 01000000 [INF] Counter 0 get 0x0 [INF] verify counter 0 0 0 [INF] counter 0 : ok [INF] verify sig key id 0 [INF] checking public key 46 5b [INF] verifying signatu
I know this matter is dense and niche, so ill try to articulate my process in a digestible manner and add some memes.I Recently downloaded sbsfu-v2-7-0 (legacy) package.After some YMODEM bug fixes, i have a working example SBSFU for only one ACTIVE SLOT and single Download SLOT. STM32CubeExpansion_SBSFU_V2.7.0\Projects\NUCLEO-G474RE\Applications\2_Images The codebase readme says it supports more Download SLOTS, Great!, this way we could have two different UserApp downloaded, in order to activate more SLOTs : (app_sfu.h) /* Multi-images configuration : - Max : 3 Active images and 3 Download area - Not necessary same configuration between SFU_NB_MAX_ACTIVE_IMAGE and SFU_NB_MAX_DWL_AREA - Active slot identified with SFU magic (1,2,3) information from header - Do not forget to add keys for each image in SE_Corebin/Binary folder - Master slot : image started in priority if valid - FW image valid all feature authorized from master slot */ #define SFU_NB_MAX_AC
Hello together, i have an application running with TZEN, unfortunately the readings of the internal temperature sensor calibration values are always zero.Is there a secure address where the values are stored ?Or any chance to get the values out in TZEN mode ?As @Jocelyn RICARD knows i had to enable the trust zone to do the embeddeed provisioning Kind regardsMartin
Hello,I'm a developper from the CEA using STM32H573 and I am characterizing the chip boot time in various configurations. With STiRot activated (250 MHz and a 128 Kb image) I found 31 ms which is twice as much as the boot time indicated in the documentation (16 ms ; AN6007 - Table 5. Boot time performance).I would like to know how the STiRoT boot time values from the documentation were obtained, to see if I am missing something here.Thank you in advance,Best regards
I am working on B-L4S5I-IOT1A board, and trying to connect the STSAFE A110 chip, with the reference of L476RGTx LQFP64 board's examples provided by stm. and getting below error's 1. pairing .. STSAFE-A1xx initialized successfully Pairing demonstration:1. Check host keys presence through STSAFE-A1x0 2. Key - Pair generation... Key pair generation demonstration:1. Generate key pair through STSAFE-A's private key slot 1=> Use StSafeA_GenerateKeyPair API2. Signature verification result (0 means success): 1 Will you please provide me the proper examples related to my board also the IOC file for settings, See i have attached zip files of pairing and key pair generationexample setup for my board, check once and resolve the issues...
I am trying to figure out if we can both use secure boot (with Trustzone) and dual bank at the same time. I see in AN0007 that "SWAP_BANK activation by option byte is not supported by STiRoT." Is there some other way to swap banks without using the option byte, or does STiROT effectively make dual bank unusable?
Hello,I generated code using STM32CubeMX for the STM32N657x0 MCU. I selected only the secure region and added a simple UART operation for testing purposes. In CubeMX, I selected only the Application (not the FSBL or External Memory Loader ), and generated the project for Keil.Now, my question is:Can I directly load the code into the board using Keil, or is it mandatory to use the FSBL or an external memory loader?I noticed that all official STM32N6 examples include an FSBL. I haven't seen an example that runs with just the application alone. So I would like to confirm this with you to ensure I don't risk damaging or misconfiguring the board.For reference i attached the .ioc file .Thank you again for your support.
Hi, I would like to know where to write the code either in secure or non-secure folder. What is the exact purpose of this folders. I want to encrypt a CAN message and send it. I have done without enabling trust zones previously. But now I enabled the trust zone and would like to write CAN drivers, encryption key change etc. I am using NUCLEO-H533RE boards for development. Please let me know. There are examples problems but did not actually had these two folders. Thanks in advance.
Hello,I am having some trouble attempting to use the OEMuRoT tools/scripts to sign and encrypt my custom application built with CMake/Ninja. Application was generated using CubeMX and CMake project type was selected. Windows 11, STM32CubeProgrammer v2.19.0, though I am using Git Bash to run the scripts as I notice that e.g. there is a postbuild.sh but no postbuild.bat. I am using the -DK Discovery Kit eval board.I copied C:\Users\myuser\STM32Cube\Repository\STM32Cube_FW_N6_V1.1.1\Projects\STM32N6570-DK\Applications\ROT\OEMuROT_Appli\STM32CubeIDE\postbuild.sh into my application folder.I modified env.sh so that the oemurot_appli_path_project uses a relative path to my application folder: oemurot_boot_path_project=Applications/ROT/OEMuROT_Boot oemurot_appli_path_project=../../../../../../_hmnhwi/customer/my_customer/this_project/workspace/my_applicationThen I modified the postbuild.sh script in my application so that the path to the provisioning directory is correct, with relat
Hello,I am using an STM32U585 (evaluation board B-U585I-IOT02A), and I would like to enable debugging via Debug Authentication while the device is in RDP Level 1 and with TrustZone (TZEN) activated.I have looked for documentation or examples but have not found any resources specifically covering this configuration.Do you have any references or guides that explain the necessary steps (e.g., STM32_Programmer_CLI commands) to set up Debug Authentication in this context?Thank you in advance for your help.Best regards,Paul Goulpié
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.