Ask questions and find answers on STM32 security frameworks and tools, including cryptographic libraries, TrustZone, and the Secure Manager.
Most recent activity
Hello all,I am working on a bare-metal implementation of the PKA engine using the STM32WBA55CG. I have managed to properly initialize both the RNG and the PKA engines, but I cannot seem to load the operands on the RAM. I am trying to implement the modular addition, following the datasheet (https://www.st.com/resource/en/reference_manual/rm0493-multiprotocol-wireless-bluetooth-lowenergy-and-ieee802154-stm32wba5xxx-armbased-32bit-mcus-stmicroelectronics.pdf page 863). I am using Rust as programming language. I attach the code. The problem is that whenever trying to write the data, using core::ptr::write_volatile, the code just stops and nothing is done. The outputs I have are: #![no_std] #![no_main] use stm32wba::stm32wba55::{self, RAMCFG}; use {defmt_rtt as _, panic_probe as _}; use cortex_m_rt::entry; use cortex_m::asm; use defmt::info; // PKA RAM locations - these are already offsets from PKA base address const PKA_RAM_OFFSET: u32 = 0x400; const OPERAND_LEN
Hello,after being busy with some other stuff, we are finally back to face problems with secure bootloader integration.What we learned so far (our learnt points could be wrong and corrections would be greatly appreciated):ST provides a very nice CubeMX-based ecosystem, which is, however, totally incompatible with ST's either SBSFU or TFM examples: there are different folder structures, different initializers, no clear integration between the three whatsaver.Debugging either TFM or SBSFU is complex and time-consuming task: every time you make even single statement changed in your code, you have to pass through complete process of: Recompiling all three (four in case of local loader) projects: customer non-secure, TFM secure, and BOOTloader itself, with signing etc.Upload all three to the FLASH by using relevant scripts and CubeProgrammer.Starting with bootloader and only then use some breakpoints in custom non-secure code. SW/HW resets, watchdogs etc. further complicate the pr
Hello ST,We are developing device and we want to provide free FW updates if some bugs occurre. Updates will be flashed via DFU - usb communication. Currently we are using STM32F411CEU6.Can you recommend best options for protecting the FW from being copied to a non-original board? Is it possible? Or the only option will be to use your new MCUs with firmware encryption feature? Can you suggest pin-pin replacement for F411? Thank youBest regards, Martin
Hello Community,i have followed the documentation on how to enable RDP-like product state flash protection in STM32H5 microcontrollers.https://community.st.com/t5/stm32-mcus/how-to-enable-rdp-like-product-state-flash-protection-in-stm32h5/ta-p/708082 In my custom hardware i have an external SPI flash. The issue i have is that after regression, i am not able to read the content of the external flash (i get an error saying Data read failed ). There is no issue on reading the internal flash though. Following are the commands i use-c port=SWD freq=4000 UR -el "K:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\ExternalLoader\STM32H5_FLASHLOADER.stldr"-e all-d "C:\Firmware\Test.hex" -v-ob PRODUCT_STATE=0x17--scriptdisconnect-c port=swd mode=hotplug reset=swrst-sdp C:\Firmware\Security\DA_ConfigWithPassword.obk-ob PRODUCT_STATE=0x72I have used the default DA_ConfigWithPassword.xml provided in the cubemx directoriesAnyone knows what could be the issue here?A
Hello,I will use the STM32WL33CCV6 as a wM-Bus gateway and the STM32WBA50KG for BLE 5.4 communications.We will encrypt these links with AES key.1) For STM32WL33CCV6 and wM-Bus, AES-128-CBC and eventually CMAC authentification will be used. It will be static or dynamic symmetric keys.--> Is it possible to store the keys in the STM32WL33CCV6 MCU ? we want to be secure, especially to respond to the RED 2. --> If yes, is it possible to store several keys ?--> If yes, in the case of dynamic key use, is it possible to update the keys ? 2) For STM32WBA50KG and BLE, AES-128 or 256 bits will be used.--> To respond to the RED 2 AES128 is sufficient or AES-256 is needed ?--> Compared to the STM32WL33CCV6, I think it's possible to store the key in the MCU, it seems to be a dedicated secure key storage, can you confirm ? Best Regards,
Hello,I am trying to use the UART peripheral in the secure zone via interrupts in SBSFU for the STM32U575 microcontroller, but I am not receiving any data. I have used the same code for the non-secure region, and it correctly receives the first value. However, after triggering the interrupt again, I get a hard fault in the UART_Start_Receive_IT function. The code works perfectly without TrustZone enabled. I have configured the UART interrupt handler and ensured proper initialization, but I suspect there may be something missing for UART interrupts to work properly in the secure zone. Is there a specific setting or configuration required to enable UART interrupts in the secure zone of SBSFU?Thanks in advance,Istillaga
Using STM32WB55, for the SBSFU 2 image bootloader ST provide a linker script for the user application. This works, but the user application itself can only be updated by uploading a new application from within the application using YMODEM, or exiting the application and going into the STM_OTA bootloader. In the STM32WB55 example Heartrate_Ota, a linker script is provided that makes a wireless application bootloadable, but in this case there is no security in the bootloader system. I'm trying to understand what the linker script for the user application should look like in the case where you want to use SBSFU in 2 image mode, and you wish to have BLE running in the user application. I am finding that if you simply use the 2 image linker script provided, BLE works fine in the bootloader, but does not work in the user application.
Hello everyone, Security is a key requirement in my current project, and while researching security for embedded systems I came across STM32 TrustZone and Trusted Firmware‑M (TF‑M). I’m working with an STM32L5 series MCU (which supports both TrustZone and TF‑M) and have reviewed the “Getting Started with STM32CubeL5 TF‑M Application” document (UM2671) as well as the TF‑M SBSFU example provided by ST. However, I have several questions as I try to customize and integrate these solutions into my project: Customizing the TF‑M Example:– The official TF‑M example (SBSFU-based) doesn’t include an IOC file. How can I customize or adapt this example for my project without an IOC file?– In other words, what’s the recommended approach to configure peripherals and other settings manually in the absence of STM32CubeMX’s IOC project file? Creating a New Project with TF‑M as an SDK:– If I start a new project from scratch, can I integrate TF‑M as an SDK or library?– What configurations (e.g., comp
Hello dear friends,this is my first post and I need your help with an issue I have. I designed some devices based on STM32C031C6. I use an I2C command to jump to bootloader and I upload the new firmware via I2C also from a microcomputer using the stm32flash software.The problem comes when I switch to RDP L1. Then, stm32flash can't upload the new firmware. As far I understood, before the upload a mass erase should be done, which is not possible. I can change the RDP level from stm32flash using -k and -j parameters, but this is possible only when I enter bootloader using the jumper configuration. If I enter bootloader from the software via the I2C command, -k and -j parameters result on a NACK from the device.- How can I complete the upload process via I2C, while my devices are secured with RDP L1?- Is the issue software related?- Do I need to switch RDP levels, before the upload? If yes, is a power circle also required? Here is the code I use for the bootloader jump:void JumpToBoot
Hello, I've got STM32H53 MCU and trying to use hardware CCM accelerator as alternative CCM for mbedtls library.I've took HAL implementation from the repository STM32Cube_FW_H7_V1.11.2/Projects/STM32H743I-EVAL/Applications/mbedTLS/Crypto_Selftest/Src/ccm_alt.c and it's not working as well as mbedtls software implementation.I'll try to describe that behavior by the examples below.Encryption by mbedtls_ccm_encrypt_and_tag():size_t length = 62size_t add_len = 35size_t iv_len = 13size_t tag_len = 8Output buffer matched, output tag unmatched to mbedtld software encryptionsize_t length = 112size_t add_len = 36size_t iv_len = 13size_t tag_len = 8Output buffer matched, output tag matched to mbedtld software encryptionsize_t length = 119size_t add_len = 42size_t iv_len = 13size_t tag_len = 8Output buffer matched, output tag unmatched to mbedtld software encryptionsize_t length = 0size_t add_len = 36size_t iv_len = 13size_t tag_len = 8Output buffer matched, output tag mat
Hello,I am new to the STM32 development environment and real-time programming. I have the STM32H573I-DK development board and have followed the workshop provided by ST, available on the wiki:https://wiki.stmicroelectronics.cn/stm32mcu/wiki/Security:How_to_start_with_STM32CubeMX_Secure_Manager_on_STM32H57I am using STM32Cube_H5_V1.4.0. However, the default RTC clock configuration does not work. During RTC initialization, I am forced to configure it with the LSE source, otherwise, the program gets stuck when executing the SystemClock_Config() function.After this modification, the program eventually works, and timestamps are correctly displayed on the serial terminal. However, I need to integrate FreeRTOS into the non-secure part of my application. When I add the X-CUBE-FREERTOS package (version 1.3.0), generate, and compile the project, I encounter the following errors: Secure_manager/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM33/non_secure/port.c:1047: undefin
I am using X-CUBE-MATTER v1.1.1. I understand that it is possible to use the DAC and PAI provided by CommScope using the project STM_provisioning. Please tell me more about STM_provisioning. Also, please tell me how to create STM_provisioning in lighting-App-SBSFU-WB5MM-DK (using the DAC and PAI provided by CommScope in commissioning). There doesn't seem to be much information in the README.md or Wiki.
Hi,I am Working on SBSFU. I have Flashed the STM32H753zi example code after flashing i am not able to flash from programmer. even after changing the option bytes RDP level 0 is set.I have Connect another working board of stm32h753zi board i compared the parameter with flash able baord and non-flash able board.only one thing is observed1.not flash able board PCROP is set to :(prot_area_start1 0x00)2.flash able baord PCROP is set to :(prot_area_start1 0xFF) I have tried using STMCubeProgarmmer not able modify prot_area_start1 0x00 to prot_area_start1 0xff Facing error i have attached the Screenshot below GUI and CLI both3.Image 1 stm32Cubeprogrammer GUI:4.Image 2stm32cubeprogrammer CLI: Regards,Prakash R
Hello.If i set the product state to CLOSED (0x72) without TZ-enabled (TZEN: 0xC3),i can't access the device and the OBK-Keystore from outside.But if i write a user program, i can read the whole OBK-Keystore at:FLASH_OBK_BASE_S + 0x0100;So perhaps it is possible to get access to the device with this information. Is there a easy way to protect a read access to the OBK-Key, without using the TZ ?
Hi, I am working on OEMiROT bootloader for STM32H523. I have copied big parts of the ST OEMiROT example project from H533 example as this is the closest MCU to H523 from the flash memory layout perspectives. However, it is taking ridiculously too long time to refactor the security parts of the project as the H533 does have more hardware security peripherals than H523. I have cloned the STM MCUBoot and the ST Mbedtls repos in my project. I would love to know if there is an OEMiROT project example(s) for H523 and if you have any recommendation on how to process this faster as it has been taking forever to refactor and recompile the H533 example on H523 MCU. Cheers,Hani
Hi, There is a lot of differing documentation w.r.t the use of mbedTLS for STM32U5 MUC. Can someone share an "Application Note" or any documentation which explains the integration of mbedTLS library in the project. PS: The relevant configuration files to get started with.
I have implemented AES encryption / decryption on a STM32WB55 using keys stored in FUS. However, I'm running into a problem when I try to encrypt or decrypt using a non-FUS key. I get a hardfault when the key is written to the registers. Which I assume is because the FUS user key is still loaded. AN5185 defines the command FUS_UNLOAD_USR_KEY but there is no corresponding implementation in shci.h/shci.c. I implemented my own version of SHCI_C2_FUS_UnLoadUsrKey using SHCI_C2_FUS_LoadUsrKey as an example. But CPU2 is saying that is an unknown command.What is the process to unload a key that is stored in FUS and / or use the CRYP peripheral with a non-FUS key after previously loading a key into it from FUS?
We have a project where we're using a U5A5 MCU with trustzone enabled and we're currently trying to figure out how to flash without having to use the SAM card. I downloaded the example from ST and am trying to run through the B-U585I-IOT02A TFM example application on my NUCLEO-U5A5ZJ-Q development board. Running unmodified, I am able to build all three projects (appli, loader, boot) and the regression.sh run without errors, the TFM_Update.sh script runs without errors, but when I connect to the terminal, I get the following repeating pattern. I've already tried pressing the reset button as well as removing and putting back the IDD jumper. Any help would be appreciated!
I am implementing encryption and decryption using AES-GCM mode on the STM32 NUCLEO-U5A5ZJ-Q. I have successfully encrypted and decrypted the string "Hello", but I am having issues with tag authentication.I am using the function HAL_CRYPEx_AESGCM_GenerateAuthTAG to obtain the tag after the encyption process.However, I cannot find a function to verify the tag. I have two questions:Do I need to implement the tag verification myself?If I need to implement it myself, is it correct to call HAL_CRYPEx_AESGCM_GenerateAuthTAG after both the encryption and decryption processes and then compare the tags? I obtained the tags from both the encryption and decryption processes, but different values were returned. Below is a portion of the implemented source code. #define AES_KEY_SIZE 16 #define AES_IV_SIZE 12 #define AES_TAG_SIZE 16 CRYP_HandleTypeDef hcryp; uint8_t aesKey[AES_KEY_SIZE] = {0x11, 0x11, 0x22, 0x22, 0x33, 0x33, 0x44, 0x44, 0x55, 0x55, 0x66, 0x66, 0x7
Hello community,I need to use the AES-CMAC functionality of the STM32L562QE.The datasheet says that it is supported :But it seems that the reference manual doesn't say anything about CMAC functionality.Is there really a way to use the AES coprocessor to compute AES-CMAC, or did I miss something ?Thank you in advance,Adrian
Hi ,I can find AES DPA in TFM demo application, but can't find TDES DPA implementation in TFM.Please advise how to implement TDES DPA.
My H5 DK board is in TZ-CLOSED state (after --sfi-flash), I am unable to put it in "Level 1/2/3 Intrusive Debug" state no matter what combinations of keys and certificates to use (including key_1_root.pem and cert_root.b64). Only Full regression works. Any suggestions? Thanks! 17:16:50 : Start Debug Authentication Sequence17:16:50 : SDMOpen : 602 : open : SDM API v1.017:16:50 : SDMOpen : 603 : open : SDM Library version v1.1.017:16:50 : open_comms : 495 : open : Asserting target reset17:16:50 : open_comms : 499 : open : Writing magic number17:16:50 : open_comms : 509 : open : De-asserting target reset17:16:50 : open_comms : 561 : open : Communication with the target established successfully17:16:50 : discovery: target ID.......................:0x48417:16:50 : discovery: SoC ID..........................:0x00000000_35353537_3332510A_003A002B17:16:50 : discovery: SDA version.....................:2.4.017:16:50 : discovery: Vendor ID.......................:STMicroelectronics17:16
Hello everyone,Now I'm developing an user application compatible with SBSFU on STM32CubeIDE.SBSFU itself is pretty nice, but I feel the development architecture and environment are a little bit old, like not supporting CubeMX.Fortunatelly, I succeeded to work my user application, that is developed on Visual Studio Code (with CubeMX and STM32 VSCode Extension), with SBSFU.However, it's hard challenge for me to more update like below, because I'm beginenr for embedded system.call some functions located in SE interface region from the user application developped with the above environmentchange the communication protocol from YMODEM to other ones in SBSFU (this SBSFU means the STM32 project of bootloader, not whole package)I appreciate if the official update of SBSFU will be coming to support the moden development environment kinds of CubeMX and Visual Studio Code. Within a few years ago, there're several users who has similar requirements of this matter. Solved: X-Cube-SbSfu -
Hi,I ported the SBSFU project to the LoRaWAN_AT_Slave routine, and tested DFU normally and it worked fine, but when I used the wrong file to upgrade, such as readme.txt, the upgrade process ran for a while, and then stopped, showed " Fw header authentication error" and "No valid FW found in the active slots nor new FW to be installed". As a result, the firmware of my application cannot run normally, and I must re-DFU the normal firmware before I can restore it. Is this normal?
Hi,I ported example projects from en.x-cube-safea1\project\NUCLEO-L476RG for MbedTLS cryptolib for use on my B-U585I-IOT02A Discovery Kit. The STSAFE-A110 is powered correctly and NRESET is pulled high. It never errors on writes to the device, but all reads that execute the StSafeA_Receive function in stsafea_service.c return STSAFEA_COMMUNICATION_ERROR. In fact, it's very specifically always happening here (code snippet below) where after calling StSafeA_ReceiveBytes and getting STSAFE_BUS_OK, it is masking the header value with the inverse of STSAFEA_CMD_HEADER_RMACEN which always turns STSAFE_BUS_OK (0x00) to 0x01 which is STSAFEA_COMMUNICATION_ERROR. Any idea what I could be doing so that I can get past this?Thanks!if (status_code != STSAFEA_BUFFER_LENGTH_EXCEEDED){if (status_code == (StSafeA_ResponseCode_t)STSAFEA_BUS_OK){status_code = (StSafeA_ResponseCode_t)(uint8_t)((uint8_t)pTLV_Buffer->Header &~(uint8_t)STSAFEA_CMD_HEADER_RMACEN); <---- ***
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.