Ask questions and find answers on STM32 security frameworks and tools, including cryptographic libraries, TrustZone, and the Secure Manager.
Most recent activity
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é
How can it be, that the CMOX library implements `append` functions for hashes (like cmox_hash_append) but the equivalent for verification or signing of ECC algorithms does not exist?How should we check the signature of a 10 MB update package on a device which just has 512 kB RAM?We are using EDDSA, which already includes SHA-512 hashing. One workaround would be to sign the hash of the binary file, but that goes against the idea of EDDSA.
Hi, I am working on NUCLEO-H533RE board. I am checking all the configurations before start of my work. As attached below, The datasheets says that PKA is supported when i opened .ioc file, It is visible as greyout. I am not able to activate it. Even i configured the clock configurations for the board. I am not able to find documentation regarding H533RE. mostly it was written about H563 or H573 series. Could you please also help me out regarding the documents.
Hi, I would like to work with the security features of STM32H533RE microcontroller. For that,1.Do I need to enable anything or install any libraries files in order to work with it.2. If there is any example projects available?3. The path for Installation and documents .Please help me out.
Hello,I would like to replace ECC public key in SE_Key_region_ROM region from my application in runtime. My device has no protection enabled (RDP, PCROP, WRP). I am able to read and write in the region via CubeProgrammer.I dumped the 256 bytes of SE_Key_region_ROM but I am unable to identify the public key associated to the ECC private key ECCKEY1.txt. How can I retrieve and identify the public key based on the default private key provided by STM (SE_Key_region_ROM region starts at address 0x08000400) ?This is my use case :I have a device is running with default SBSFU configuration (ECCKEY1.txt and OEM_KEY_COMPANY1_key_AES_CBC.bin used to sign and encrypt the firmware). My device supports firmware update OTA by cellular.I would like to test this procedure :- Sign a firmware with a new ECC private key and update the device with this firmware.- After download and before rebooting, the first firmware would copy the ECC public key to SE_Key_region_ROM- After reboot, the
Hello TeamI'm facing below error in STM32CubeIDE while compiling the source code in "Release" mode:"Unable to Generate Command Line in STM32CubeIDE" And it's getting stuck at below point:# Each subdirectory must supply rules for building sources it contributesSrc/%.o Src/%.su Src/%.cyclo: ../Src/%.c Src/subdir.mk$(error unable to generate command line)Issue snap as below: Further I disabled the "Cyclomatic complexity" setting as well to resolve this issue, but not get any success: So could you please support in this case.- regards
Hello,We want to use the STM Crypto Library " X-CUBE-CRYPTOLIB" for a project at our company. Since we will only be using a portion of it, the question arises whether it is possible to customize the static ".a" file ourselves (to make it smaller) or to provide a customized one from STM. The reason is that the memory on the microcontroller is very limited, so saving a few kilobytes would be very helpful.We look forward to your feedback.Kind regards,Rojeda
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.