Ask questions and find answers on STM32 security frameworks and tools, including cryptographic libraries, TrustZone, and the Secure Manager.
Most recent activity
Hello all, We are working on STM32 Secure bootloader for STM32H7B3RIT6 MCU. For this we taken reference code from X-CUBE-SBSFU STM32H7B3I-DK .As of now we have successfully migrated the SBSFU & SECORE code for STM32H7B3I-DK to Our MCU.We have prepared our Test app that blinks led and it works fine with secure boot. However without main application code it is not working. We have taken the reference of linker file of Application (Image User app) by X-CUBE-SBSFU. On our main application we can jump to the main function and execute the code up to the HAL_InitTick(TICK_INT_PRIORITY) call within HAL_Init, the execution stops immediately after this line. I suspect that access to a system register might be getting locked, which is causing the issue. Here i am attaching our main application linker file for the reference.On based of this Doc "section 8.1 from Integration guide for the X-CUBE-SBSFU" we have also tired by updating VTOR.We required the some informa
Hi,I try to use the SBSFU in a project with a STM32F722 and so far it works to flash an initial firmware. Now what I would like to do is to update the firmware and for that, since I can only use one image because of the limited flash size, I corrupt the flash from the application level and trigger then a restart.After the restart, I can see the following:It seems to erase the flash, but when I then have a look at the flash, everything is 0x0000 instead of 0xFFFF and I cannot update the flash anymore. Also the SVC_NVIC_SystemReset(); does only restart the application and not the bootloader, and I really don't want to restart a damaged application. What I further would like to achieve is to boost the startup behaviour of the bootloader and this can be achieved according the referenece manual by stop checking the flash for corruption, but then I could not really use the method from above to destroy the firmware image, right?What I would like to do with the SBSFU is the following:I destroy
Hi, I have enabled the HASH, RNG, and PKA. I also enabled the Global Trust Zone Controller and configured the PKA as privilege access. However, the generated code from STM32CubeMX does produce an error due to undefined GTZC_CFGR3_PKA_Pos which is missing from stm32h523xx.h Is that an error? I have to mention that when I first created the project, I haven't check Trust Zone option under the project. But I later enabled the GTZC.Kind Regards,Hani
Hello everyone,i am trying the secure user memory on the stm32h7b3 using the examples provided by ST. In want to enable secure user memory for a 230KB area starting from the begin of the flash: 0x08000000. The function RSS_API->resetAndInitializeSecureAreas(1, aSecureAreas) triggers a reset but the secure user memory is to enabled. Here is my code: typedef struct { uint32_t sizeInBytes; /*!< pass 0 for an empty secure area */ uint32_t startAddress; /*!< pass NULL for an empty secure area */ uint32_t removeDuringBankErase; /*!< if 0, keep area during bank/mass erase. else area will be removed */ } RSS_SecureArea_t; typedef struct { /** * This service is used to exit from secure user software and jump to user main application. * There is no system reset triggered by this service */ void (*exitSecureArea)(uint32_t vectors); /** * This service sets Secure user area boundaries. * This service can be used only when a secure area is set for the f
Hi,I'm currently exploring the solutions to develop a bootloader on a STM32U535. I'm looking into the MCUBoot based examples provided by ST : SBSFU projects.After some investigations, I noticed that the SBSFU_Boot memory footprint was ~80ko and the SBSFU_Loader one was 24ko. For MCUs with limited flash size like STM32U535xB, this leaves almost no space for the application.Is there a way to reduce MCUboot size ? For instance, by disabling non essential modules ?Or maybe am I doing something wrong and memory footprint should be lower ?Pierre
Hello,I generated an SFI image for STM32U585 based on my application. here is the details:Firmware information:SFI image details:However, when I try to install this image, it fails with the error:15:12:04:987 : PROGRAMMING OPTION BYTES AREA ... 15:12:05:267 : Database: Config 11 is active. 15:12:05:267 : Warning: Option Byte: TZEN, value: 0x1, was not modified. 15:12:05:267 : Warning: Option Byte: nBoot0, value: 0x0, was not modified. 15:12:05:267 : Warning: Option Byte: nSWBoot0, value: 0x0, was not modified. 15:12:05:267 : Warning: Option Bytes are unchanged, Data won't be downloaded 15:12:05:267 : Time elapsed during option Bytes configuration: 00:00:00.280 15:12:05:275 : Programming via Debugger! 15:12:05:331 : Programming via Debugger! 15:12:05:399 : Programming via Debugger! 15:12:05:467 : Programming via Debugger! 15:12:05:536 : Execute RSS get version P
I am new to SBSFU. I picked the NUCLEO-H753ZI project to try on a board with STM32H743. Everything seems to be running fine but ONLY when the SWAP_BANK is unchecked at startup. When it is checked before flashing, the board doesn't run as it was programmed at BANK2. We unchecked the SWAP_BANK as part of the boot sequence of the SBSFU which means it expects code to be at BANK1. I also noticed that the PCROP and WRP is unchecked for bank2. Please any idea if this is mainly an issue with STM32H743? If yes any idea how to resolve it?
Hi,I'm currently developing a custom application which provisions and regresses an STM32H563, using the NUCLEO-H563ZI board for development.The CubeProgrammer CLI commands I'm executing are based on the bash scripts generated by CubeMX. Since I started playing around with those, somewhere the MCU got into a state which I can't get it out of.Starting a Debug Session with a fully working Binary (tested on my 2nd Nucleo Board) results in an immediate HardFault. Breakpoint at Reset_Handler not even triggered. BFARValid == 1, BFAR = 0x2009fff0, contents of 0x2009fff0 unreadable.In CubeProgrammer GUI, I can Halt the CPU immediately after resetting, showing a PC of 0x80034E0 (reset handler address), and when stepping one more time, PC = 0xEFFFFFFE.When Downloading a Binary through the GUI, I get a warning "The Core is locked up". Full Connect&Download Output:Spoiler (Highlight to read)09:15:21 : Disconnected from device.09:15:22 : UR connection mode is defined with the HWrst reset mode09:
Hi!I'm succesfully using SBSFU 2.6.2 on a STM32G474 with SECBOOT_ECCDSA_WITHOUT_ENCRYPT_SHA256.Now in another project I wanted to use the same SBSFU configuration on a STM32G0B0 but as this MCU is much less performant I switched to SECBOOT_AES128_GCM_AES128_GCM_AES128_GCM to get faster startup and installation times. But during testing now we happily found out before releasing that with this configuration the installation process does not resume if it is interrupted e.g. by a power-loss. I tried with and without swap-area and also with and without user-validation. Using SECBOOT_ECCDSA_WITHOUT_ENCRYPT_SHA256 works as expected. It fails during startup and does not resume the update. As the application is already partially updated it then fails to verify and deletes the image, which is the worst case as any update is then impossible (except loader in SBSFU, which requires wired connection).I figured out that somehow during CheckTrailerMagic() the "magic" is all 0xFF which is not allowed.
Hi, I planned of implementing this library in a new STM32G4 application. I have no RTOS, and I need to make cryptographic functions calls from both main loop and interrupts. So, instead of wasting time in building a thread-safe scheduling mechanism that's perhaps not necessary, it would be very helpful knowing in advance what cryptolib functions are already reentrant... if not the entire library. Another doubts is regarding HAL's: Cryptolib examples are all based on HAL's, but I only use the LL library. I tried some cryptolib functions adapting the CRC module initialization to LL's and they seem working fine. However getting an explicit confirmation that the entire x-cube-cryptolib is actually NOT based on HAL's would speed its implementation up. Thanks!
Hi,I'm trying to get a bit of an understanding of how the HSM is used in real world environments. The documentation I've found so far suggests that once the maximum number of installs for a card has been reached, the card is essentially dead and a new card would be needed for additional installs. This leaves me with a number of questions:1) If we were using an STM32HSM-V2AE card which supports 25 licenses, is it possible to limit the number of initial installations to fewer than 25 licenses if we only want an initial batch of 5 STM32 microcontrollers programmed?2) With the same STM32HSM-V2AE (assuming the answer to Q1 is 'yes'), could we initially configure it for 5 installations, send that out to the 3rd party to perform the installations, get the card back and then configure it for the remaining 20 installations and send it back to the 3rd party to perform the additional 20 installations?2b) If question 2 is 'yes', can the additional licenses be for the SFI of a different
Hi, I have successfully managed to test the 1 image example of SBSFU on the STM32WB55. I wanted to try the 2 image example, but have found that the SBSFU application seems to get stuck in a boot loop, and does not advertise BLE. I have tried tying PA.0 high or low, but this dosent seem to do anything.
Hi,I have downloaded the STSW-SAFEA1-MW software. Error occurs when extracting the zip file. Please help. Thanks.
Hi All,stm32h734 system memory bootloader does it supports CAN secure bootloader regards,Prakash
Hello, These are the scripts available for the L4 series, Can the same scripts be used for H7 series MCUs. If not, are there any specific scripts/commands needs to be followed. Regards,Devank J
In the case of a root of trust with two boot stages (STiRoT + OEMuRoT), I'm looking to update the OEMuRoT or the firmware. From STM32CubeProgrammer I can do this via the bootloader. However, when I use the ST-LINK probe and try to program the new firmware (the encrypted and signed hex that worked in the case of the bootloader) I get the following error: ‘failed to download firmware’.I am in PRODUCT_STATE = OPEN the logs indicate that the flash cannot be programmed Is it possible to update encrypted and signed firmware using the ST-LINK probe?
Hi there.I'm struggling with the implementation of continuous SPI data transfer in Transmit only master mode with DMA in circular mode and enabled CRC calculation.In any other configuration I've tried (DMA normal mode or SPI transfer with MCU polling) is CRC correctly added after data except after each data frame (5 bits) except circular mode.In this case is CRC never generated and on physical SPI layer there is continuously transferring only data packet.I can see that DMA transfer in circular mode is running correctly as data packet corresponds to continuously changing source data.SPI clockrate = 50 MHzSPI frame length = 5 bitsSPI CRC length = 5 bitsSPI inter data idleness = 1 bitDMA mode = cicular modeSPI communication with DMA in circular mode (configuration snippets below applied)SPI communication with DMA in normal mode {CRC is added) STM presentation to the STM32H7 SPI says that combination of DMA circular mode and CRC should be possible LINK Thanks in advance for any
I've read the X-CUBE-SBSFU Secure Boot and Secure Firmware documents and it doesn't explain if these are tools, with GUI, or just an API, which should really be explained at the start.If you know all about it I am sure these documents are just great, but for those entering the topic, its too much details and not enough simple overview at the start.Ideally, Cube Programmer would have the option to output an encrypted .elf file that could be sent to our clients to program their devices. Yes, that simple, like a zip utility, with a text key.So my question to those that have trodden this weary road, or any STM employee that cares to help us poor devs, what is the easiest solution ideally without have to write code either for the Windows PC or our H743 MCUs.
Hi support team and developper community. Happy new year to all. I have a project including Secure Manager and a Non-Secure application on a STM32H573 platform. My non-secure app is modeled after the SMAK_Appli app provided within STM32Cube. I used HAL_FLASH API to bring flash storage capability to it. My application data is stored in a code-free sector at the top of the non-secure flash area, but I could not find any way to notify the Secure Manager about it. Not even in CubeMX. As you would expect, my data persists after reset or power cycle, but it gets erased upon an update of the NS app. I am aware of the possibility for the Secure Manager to provision data for the sake of the NS application, but this does not fit the bill: my application needs to update the persistent data. So, in a nutshell, how can I implement a persistent storage which survives firmware upgrades ? Thanks in advance for your support. CRE
I'm curious what is the best way to debug a User Application when using SBSFU on a STM32.Of course the security mechanisms in SBSFU/SECore must be disabled to allow debugging at all and basically just downloading the UserApplication and debug it with e.g. CubeIDE works as the programmer manipulates the PC to start in the application. But the problem is once the application resets (e.g. SW-Reset) it reboots over the Secure Boot and deletes the application as it was not installed correctly via the SFU. This becomes very tricky in case of debugging something that happens on startup!?I know that flashing the FW via SFU and then only attaching the Debugger is a working option but it becomes plumby if doing repeated code-changes to the application.Is there any other suggested way to do that?
Hello, I have a problem with a STM32H725, the Option byte RDP is locked to the value BB.In fact, I try to change other option bytes and it always fail with this error: " Error: Option Byte Programming failed Or modified by application after OB_LAUNCH".So maybe for may case the problem is not only for the RDP but for all option bytes.I also try with this command without success: STM32_Programmer_CLI.exe -c port=SWD mode=UR freq=4000 -rdu -hardrst My setup:STM32CubeProgrammer V2.18.0 (updated today)STlink-V2 (V2J45S7) and STlink-V3 (V3J15M7B5S1)The problem may occurs with other MCU in the production, they are protected with RDP = 0xBB but if new release of firmware is ready, we have to flash them again. The operation is impossible if RDP stay at 0xBB value.How can I do to change the option byte ?Thanks to help me !
I get a stm32l562e-dk board, when I use the following figure setting to connect to the board and modify nSWBOOT0 bit to 0(TZEN=1). I found that I can not connect to the board using "Hot plug" or "Normal" mode.whether I FOREVER lost the device? In addition, I also make a "mass erase" operation using stm32cubeprogammer when TZEN=0.If no lost the device, how to restore connection to the board and adjust the setting in option byte?BTW, I get the following connection prompt when connecting to PC usb port.
Hello,I’m working on a project using the STM32WLxx MCU and need guidance on implementing asymmetric cryptography (encryption, decryption, and key management). The MCU supports AES for symmetric encryption, but I’m looking for a solution for asymmetric cryptography.Additionally, how can I ensure the private key remains secure? If this is not feasible on the MCU, are there external crypto chips that support direct asymmetric encryption and key generation?Thanks in advance for any advice!Best regards,Anubrata.
Hi,I am working on SBSFU with stm32L476 Nucleo Board I am following the steps of Tutorial Security Part6 - STM32 security ecosystem - 02 Building the SBSFUI have Download Stm32CubeExpansion_SBFU_V2.6 but which is the highlighted directory are missing please provide URL to download. BR,Raj
Where can I make the Encryption Option "Disable"?
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.