Ask questions and find answers on STM32 security frameworks and tools, including cryptographic libraries, TrustZone, and the Secure Manager.
Most recent activity
Hi everyone, I'm working on integrating the SBSFU (Secure Boot and Secure Firmware Update) into an existing project for a custom board using an STM32U585 microcontroller.At this stage of the project, I am trying to include the SBSFU_Boot (https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/B-U585I-IOT02A/Applications/SBSFU) to my firmware, in order to be able to create a more secure and upgradable environment. My goal is to successfully build and run the SBSFU_Boot bootloader from the ST example using my CMake toolchain, so it can eventually load my existing Secure/Non-Secure application.I have successfully configured CMake to compile the SBSFU_Boot project without any errors. However, after flashing the compiled binary to the microcontroller, the device fails to boot. The bootloader doesn't seem to execute at all.This issue appears to be related to migrating the build configuration from the provided CubeIDE project to my CMake environment, as the original ex
Hello,I have a DCMIPP example application in FSBL that runs fine on an STM32N6570 Disco when loading it with the Disco board's built-in ST-Link. It has a DCMIPP_HandleType Def structure with hdcmipp.Instance that needs to access secure peripheral memory at 0x58002000. It works fine on the Disco kit.I have very similar code on a custom board, using a J-Link debugger. Most of it runs, it communicates okay with the IMX355 image sensor over I2C. The ISP starts up okay. But it fails when the HAL_DCMIPP_CSI_Start() does a check of the hdcmipp.Instance and finds that all of the values are 0 instead of what's in the DCMIPP registers. It can't seem to read or write the DCMIPP registers.I run the same MX_DCMIPP_Init() function on both the dev kit and custom board before calling HAL_DCMIPP_CSI_Start(). The dev kit loads all the register values, but the custom board is stuck at all 0s.I'm only guessing that my problem is due to accessing the secure peripheral memory, but maybe it's something else
I'm trying to get the Debug Authentication provisioning to work. I managed to write it from within the application, but then I found the errata sheet(es0565-stm32h562xx563xx573xx-device-errata-stmicroelectronics.pdf) which states otherwise:"Chapter 2.2.35: Debug Authentication provisioning cannot be done from the application when TZEN is disabled" I tried to do the provisioning with RSSLib->DataProvisioning(), as mentioned in the errata sheet, but I end up getting a hardfault.I'm using the nucleo-h536zi-board, trustzone is disabled. RSSLIB_DataProvisioningConf_t a; a.pSource = sData; a.pDestination = (uint32_t *) (0x0FFD0100); a.Size = 0x60; a.DoEncryption = 0xCACA0AA0U; a.Crc = 0; uint32_t c = RSSLIB_PFUNC->NSC.DataProvisioning(&a);Since the CRC is not correct, I expect to get the CRC error instead of a hard fault. Is there something I need to set up before calling DataProvisioning? I tried to find an example, is there one somewhere?
Hi all,I’m working with the W5500 Ethernet module over SPI on an STM32 with Trust-zone enabled. The W5500 requires a clock source for proper operation, which I’m trying to provide using the MCO on the CS pin.The issue is that I’m not able to enable the Master Clock Output (MCO), neither in the secure project nor in the non-secure project using CubeMX. Because of this, I can’t feed the required clock to the W5500.Has anyone managed to enable MCO in a Trust-Zone setup, or know if there’s a specific way to configure it so that it works in the non-secure region?Thanks for any help!
Dear,I am writing to inquire about the inclusion of a validity period in the debug authentication certificates used with the STM32H7S3 microcontroller.My project requires that the debug access certificates I provision have a limited, defined lifespan to align with security policies. I am currently using the latest versions of STM32TrustedPackageCreator (v2.20.0) and PSA_ADAC (v0.2.0) to generate these certificates.I have reviewed the documentation for both tools and have not found a user-configurable option to specify a notAfter (as is available for X.509) or expiration date for the generated ADAC certificates.Could someone please clarify the following:Is it possible to generate ARM ADAC certificates with a defined validity period using any publicly available tools?If not, is there a different process, tool, or service that would allow me to create such certificates?Are the certificates generated by the public tools created with a fixed, pre-defined validity pe
Hi,We are using SBSFU and FreeRTOS in STM32H755xI. We are planning to use Zephyr RTOS in STM32H755xI. Can I use SBSFU bootloader in Zephyr RTOS?--Muthukrishnan
Hello Support Team,for testing purposes i am using the H533NucleoBoard. I can load my firmware into the MCU and the firmware is running as expected. I want use the final product in ProductionState: closed.The problem is, the firmware isn't running any longer whe changing the productionState to closed. But I am able to switch back to ProductionState: open via Regression.Following informations:Used Tools: Stm32CubeProgrammer V2.20.0STLink V3 FirmwareVersion: V3J16M8Following Settings:TZEN: C3 (disabled) (I don't want to use TrusZone enabled)BOOT_UBE: B4 (OEM-iRot UserFlash)NSBOOT_LOCK : C3SECBOOT_LOCK : 0Sequence:1. set product state: Provisioning2. start provisioning3. set product state: closedLogFile of Provisioning process:06:55:11:421 : reset ap 106:55:11:421 : Reset MCU06:55:11:422 : Reconnecting...06:55:11:422 : Disconnected06:55:11:422 : ST-LINK SN : 0019002A343351153736393406:55:11:423 : ST-LINK FW : V3J16M806:55:11:423 : Board : NUCLEO-H533RE06:55:11:423 : Voltage : 3.30V0
Hi everyone,I have a question regarding SFI Option Bytes for the STM32H753ZI (Nucleo-H753ZI).Question:Which option bytes should I pick, since there are a lot of different combinations available: 1. Generated by TrustedPackageCreator: FLASH_OPTSR_PRG,0x17DEBBF0 FLASH_PRAR_PRG1,0x0000000F FLASH_PRAR_PRG2,0x0000000F FLASH_SCAR_PRG1,0x81000200 FLASH_SCAR_PRG2,0x81000200 FLASH_WPSN_PRG1,0xFFFFFFFF FLASH_WPSN_PRG2,0xFFFFFFFF FLASH_BOOT7_PRG,0x08002400 RESERVED,0x24000810 2. STM32CubeExpansion_RSSe_V1.1.0\Option_Bytes_Template\STM32H7\OB_H742_H743_H753_H750_v3.1.0.csv: FLASH_OPTSR_PRG,0x17DEBBF0 FLASH_PRAR_PRG1,0x0000000F FLASH_PRAR_PRG2,0x0000000F FLASH_SCAR_PRG1,0x81000200 FLASH_SCAR_PRG2,0x81000200 FLASH_WPSN_PRG1,0xFFFFFFFF FLASH_WPSN_PRG2,0xFFFFFFFF FLASH_BOOT7_PRG,0x1FF00800 RESERVED,0x1FF00800 3. x-cube-sfi-v1-5-0\STM32CubeExpansion_SFI_v1.5.0\Projects\NUCLEO-H753ZI\Applications\SFI\OEM_SecureRoom\OptionBytes\ob.csv: FOPTSR_PRG,0x13DEAAF8 FPRAR_P
Dear STMicroelectronics Community members,I am currently evaluating STM32 microcontrollers for a project that requires strong cryptographic capabilities. Our goal is to implement hybrid encryption, meaning we need hardware support for both symmetric encryption (e.g., AES, DES/3DES) and asymmetric encryption (e.g., RSA, ECC, public key cryptography), along with hashing functions (SHA-1, SHA-2, SHA-3 if available).Specifically, I would like to request:A list of STM32 families and part numbers that include dedicated hardware accelerators for:Symmetric ciphers (AES, DES/TDES)Asymmetric ciphers (RSA, ECC, or other public key accelerators)Hash functions (SHA-1, SHA-224, SHA-256, SHA-3, etc.)Hardware Random Number Generator (TRNG)Clarification on which STM32 series provide a comprehensive cryptographic hardware suite suitable for hybrid encryption schemes (combining symmetric + asymmetric algorithms).Recommendations on the most suitable STM32
HiI am trying to perform a secure boot implementation in STM32F439ZIT6. The datasheet shows that, there is Hash, RNG, AECS and TDES. Can I perform secure boot functionality using only STM32F439ZIT6 without using any external chip and if so, are there any library files which contain functions to perform this secure boot operation and is there any application notes, example codes or videos I can refer to perform this functionality? Thanks and Regards@avbST
Hello,I am working with Nucleo-STM32U385RG to implement the Root of Trust (Secure Boot) feature, following the wiki guide: https://wiki.st.com/stm32mcu/wiki/Security:How_to_start_with_OEMiRoT_on_STM32U3My test environment is STM32Cube_FW_U3_V1.2.0.During step-by-step testing, I faced two issues that I need help with:.(1) OEMiRoT_Boot build error (postbuild.bat)When I build OEMiRoT_Boot with EWARM IAR v9.32 + STM32U3 patch, the build finishes but throws an error during the postbuild.bat step.The wiki doesn’t explain anything about postbuild in this step.Still, I got a binary file, so I could continue the flow.https://wiki.st.com/stm32mcu/wiki/Security:How_to_start_with_OEMiRoT_on_STM32U3#OEMiRoT_Boot_firmware_compilationFor comparison, I also tried with STM32H5 OEMiRoT_Boot build, but I encountered a very similar error: https://wiki.st.com/stm32mcu/wiki/Security:How_to_start_with_OEMiRoT_on_STM32H573_and_563%E2%80%93TrustZone_enabled#STM32CubeFW_provided_code_compilation 
Hello,I am trying to configure the secure memory in Secure Protection Bank 1 of options bytes section and for this I have followed the STM32 MOOC tutorial to understand the concept of using secure boot code. But I am facing issues as the base address for Bank 1 is expected be 0x08000000 as mentioned in STM32 G4 system memory protection document and also in tutorial whereas its showing as 0x00000000 Below is the screenshot from STMCube Programmer Option Byte settings from G474RE Board for your reference.I have also checked the similar settings with G071 board and I am able to get the base address as 0x08000000 as below and implement the secure boot code but unable to do in G474.Are there any other settings that I am missing out to configure in G474 to add the SEC_SIZE1 value?Can you please help me with this?Thanks
1.Does the STM32H743VIT6 microcontroller include a HASH peripheral that supports SHA-256 operations?I am planning to implement HMAC-SHA256 verification for my application, but I have not found clear documentation confirming the presence of a compatible HASH peripheral.2.If I implement HMAC-SHA256 purely through software, how much time will it take to compute the hash for 1MB of flash data?I would like to understand the performance implications of a software-based approach compared to using the hardware HASH peripheral.
I'm porting OEM ROT examples from STM32WBA65I-DK1 to STM32WBA63CUI7 and need guidance.Devices:- Target: STM32WBA63CUI7 (2MB flash, CSP17)- Source: STM32WBA65I-DK1 (2MB flash, UFBGA169)Questions:1. Device Support: Any known STM32WBA63xx definition gaps for OEM ROT?2. Package Differences: CSP17 vs UFBGA169 considerations for GPIO/clocks/security?3. Memory Layout: Any subtle differences despite identical 2MB dual-bank flash?4. Build Integration: Best way to add STM32WBA63xx to STM32CubeIDE projects?5. BSP: Need custom BSP or can adapt existing ones?Any insights or similar experiences appreciated!Thanks!
Hello everyone,I would like to update the STM32 remotely using ESP32. So the Idea is to transfer the signed image via Bluetooth and to store it firstly on the esp32, which will transfer it in the end via UART to the STM32.After that the secure boot on the stm32 must verify the image signature. I came across X-CUBE-SBSFU but I actually don't know how to use it in my case. Should I only use the Ymodem protocol ? Best regards
I'm trying to understand an issue I am having with chaining decryption, using the shared key out of the SAES and have distilled the problem to the following example:I am attempting to encrypt and decrypt large blocks of data (65536 bytes). I can encrypt and decrypt the entire block in one fell swoop with one call to Encrypt and one call to Decrypt. I can encrypt and decrypt the entire block in small chunks with repeated calls to Encrypt and Decrypt back to back (En, De, En, De, ...). However if I encrypt the entire block in chunks then decrypt the entire block in chunks (En, En, En, ... De, De De, ...), I get bad data as my decrypted text.I'm trying to understand what I am setting up incorrectly for the decrypted data to be bad. I'm using a STM32H7S78-DK board, although any STM32H7Sxxx could be used in this example. I am using a clean CRYP_SAES_SharedKey_Appli project. I have added the following code to the project. Any help on this problem would be greatly appreciated:uint8_t pla
Hello,I'm not sure if I understand the RDP regression mechanism described on STM32U0 reference manual (RM0503 rev4) correctly. My general understanding is that it's possible to go from RDP2 => RDP1 => RDP0 if the OEM keys are set - if they are not set (all 0's or all 1's) the effect of RDP2 is the same as on devices without RDP regression feature, so the debug port is fully closed and can't be opened anymore.My confusion comes from the following descriptions of the manual:RDP level 2 description on page 79 states that the CPU debug port is disabled under reset.The same description states:Once in level 2, it is no more possible to modify the read protection level.Note 1. on page 80:When the protection level 2 is active, the Debug port, the boot from RAM and the boot from system memory are disabled.Contrarily, OEM RDP lock mechanism description for OEM 1/2 on pages 81 & 82 states that it's possible to go from RDP2/1 to RDP0/1 and states that the keys must be written to the
Hi guys i am trying to use stm32cryptolib library's encryption function. the main problem i am facing when i am trying to call the cmox_initialize function it is giving the error cmox_init.c:(.text+0x1a): undefined reference to `cmox_ll_init'collect2.exe: error: ld returned 1 exit statusmake: *** [makefile:64: crypto.elf] Error 1"make -j8 all" terminated with exit code 2. Build might be incomplete.but it is strange although i have included the include file to path under which it's .h comes. The other err which i am facing that is this function written below is not returning CMOX_HASH_SUCCESScmox_mac_retval_t ret_val = cmox_mac_compute(CMOX_HMAC_SHA256_ALGO, // Algorithmmessage, sizeof(message)-1, // Message and its length(const uint8_t *)key, strlen(key), // Key and its lengthNULL, 0, // No custom datahmac_bin, sizeof(hmac_bin), // Output tag and expected size&tag_len // Output tag length pointer);
We are here trying to achieve the HMAC-SHA-125 generation.we are using the cryptolib-4.3.5 . the implementation is in PNG file( only the main and hmac computation is shown)we are not getting any compilation error but we are getting ERROR as program output . If we are commenting out the error checking if condition, we are getting something like :aee0ab2b6302b529b7873bac798718f3a17bce27a0c0906b3e299942b9262bff but the actual output should be like:b2793ffb929310a28134164a5ef650bdeb422fb34233f493fe323a60fb.
Friends, hello, I encountered a problem with starting DWT with PRODUСT STATE = 72;I measure the time between pulses (white beam of the logic analyzer) by the EXTI5 interrupt input (falling edge of the signal), TIME_LONG_SENS = DWT->CYCCNT / (SystemCoreClock / 1000000); and then reset the counter DWT->CYCCNT = 0U; I measured the number of pulses on the generator and the number of interrupts on the input, they are equal. Then after a certain delay I control the microcontroller output to send a pulse (red and yellow beams of the logic analyzer).The problem is that after zeroing DWT in the PRODUСT STATE = 72 state,One output pulse is skipped.it does not always start and upon arrival of the next interrupt, the DWT->CYCCNT value is zero, and accordingly, the measured time is also zero.If I set PRODUСT STATE = ED, then this problem does not occur and the same code works correctly.Please tell me what my problem is and how to solve it?
This is a follow up to this post:https://community.st.com/t5/stm32-mcus-wireless/conflict-betwenn-pka-and-ble-after-pairing/m-p/76599?search-action-id=65799734948&search-result-uid=76599So if I understand correctly , After CPU2 BLE stack finished working with the PKA, it turns it off, so to enable it we should : // Re-enable PKA if disabled if ((PKA->CR & PKA_CR_EN) == 0) { PKA->CR |= PKA_CR_EN; } My question is how to Lock it or check its not currently Locked? I want to prevent any issues or races with BLE stack?
According to Wikipedia The MODBUS uses the CRC-16-ANSI also known as CRC-16-IBM. The normal hexadecimal algebraic polynomial being 8005 and reversed A001Initial value: 65,535.Example of frame in hexadecimal: 01 04 02 FF FF B8 80(CRC-16-ANSI calculation for the 5 bytes from 01 to FF gives 80B8 which is transmitted least significant byte first).I found some code that does the CRC16 with lookup tables, and it provides the same answer. So I believe the Wiki example is correct. Reading the RM0394 Reference manual it appears it is a pretty simple peripheral. Only a few registers to set up. CRC->DR is the data register.You write to this register and it holds the result. the CRC->IDR is not clear what it is used for. Looks like 8-bit memory. The CRC->INIT has a reset value of FFFFFFFF which is the sme as what I need. The Only register that is not clear is the CRC->CR register. Bit 0 loads the CRC->INIT register value into the CRC->D
Hi,I have a STM32u585 where SFI worked on first attempt. Then I did a factory reset , post that I am not able to get SFi working again at all. Is there a residual / stale state I need to clear to be able to do SFI again?We do not have any OEM Keys set.I did a mass chip erase, factory reset and power cycled before trying again. Verified option bytes look good (TZEN=0, RDP=0). I have attached logs of the failure. Any help appreciated!
Hi All,I am following the UM2262 document. I will add a screenshot. I enabled the ENABLE_IMAGE_STATE_HANDLING flag to enable rollback, but after updating UserApp.bin, the device continues to reset. I will add a debug log screenshot (it’s not jumping into the application). Please help me with any references for the rollback feature using the SBSFU package version 2.6.x. Document image 1:Debug image 2: Regards,Raju
Hi,I have SBSFU working with my HW, which has a STM32U585, with some (minor) modifications to the B-U585I-IOT02A example. I also have an application that I need to run with the secure bootloader (as the nonsecure app), developed by a wider team (lets call this our "user" app). This was developed to date without trustzone being enabled. I can get the user app to begin to boot with the secure bootloader (so signing, addressing, startup, etc. are all OK). However, the user app runs out of RAM before doing anything useful, so I need to assign more RAM to the nonsecure app. As far as I can see the U5 SBSFU example configures/assigns SRAM1 (192KB) to the nonsecure app, and SRAM2 (64KB) and part of SRAM3 (first 32KB) to the secure app. This leaves the remainder of SRAM3 (480KB) and SRAM4 (16KB) unassigned/unused. A couple of questions:Our secure app doesn't require much RAM (does very little other than configuring the trustzone controller and MPU and booting the nonsecure
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.