Ask questions and find answers on STM32 security frameworks and tools, including cryptographic libraries, TrustZone, and the Secure Manager.
Most recent activity
It seems to be a recurring challenge in the community posts of getting firmware MPU configuration to work with SBSFU. We also had the problem of application firmware hanging when running it with SBSFU. A solution of clearing floating point unit flags was found from a post here: https://community.st.com/t5/stm32-mcus-security/ethernet-init-fail-with-sbsfu-bootloader/td-p/211911/page/2: // Clear Floating point Unit flags { register uint32_t fpscr_val = 0; fpscr_val = __get_FPSCR(); fpscr_val &= (uint32_t)~0x8F; // Clear all exception flags __set_FPSCR(fpscr_val); } My question is: Why are the exception flags set after running SBSFU and should I be concerned by that?
How to exit safe mode when the security position of the chip is 1 and the protection area of the flash of the new chip is from 0x080000000 to 0x082020000, but the content in the flash is erased,Thank you.
Can the internal TRNG peripheral of the STM32U5MCU be accessed on the STM32U575I-EV eval board?
Hi all,In our project we have enabled the ENABLE_IMAGE_STATE_HANDLING flag and download an image via YMODEM transfer to our NUCLEO-L476RG. However, when we try to validate the image by calling SE_APP_ValidateFw(), our STM reboots and does a rollback.All of this only happens when not defining SECBOOT_DISABLE_SECURITY_IPS in NUCLEO-L476RG/Applications/2_Images/2_Images_SBSFU/SBSFU/App/app_sfu.h (see attachment for our app_sfu.h file) So when security features are enabled. However, we found out that the security feature that triggers this reset is SFU_MPU_USERAPP_ACTIVATION: when we disable this one, everything works as expected and no rollback happens (i.e., no reset).Is this expected behavior of the SFU_MPU_USERAPP_ACTIVATION security feature? Is it incompatible with ENABLE_IMAGE_STATE_HANDLING mode/SE_APP_ValidateFw call?Kind regards,ac_gd
Hello all,I've encountered an issue while porting 2_Images_KMS B-L4S5I-IOT01 project onto STM32F756ZGTxx.My build fails while compiling nvms_low_level.c file:Source of the issue is FLASH driver for STM32F7, which is different from STM32L4. Do you have maybe some quick fix for it or does it require a bit more tweaking?
I am trying to follow the getting started guide (UM2262) for the SBSFU using our own hardware. I have got as far getting to the main "secure boot and secure firmware update" screen in Tera Term, however when trying to send the .sfb file, I get the following error - "File not correctly received". The only information I can find is in the user manual with the following description for the error- "During a local download procedure, the download operation did not complete successfully (Ymodem protocol issue)." I have checked the Tera Term settings, and they are set as per the getting started guide.I realise that I need the STSAFE - A-110 device connected via I2C, which I have not done yet - could that be the cause?Any ideas would be appreciated, thanks
hello:as mentions on title,my target board is NUCLEO-C031C6. and I change the read protection level of flash from 0 to 1(0xAA to 0xBB) by STM32CubeProgrammer.after that, the target board can not be connect any more.(keil c/ cubeMX/ cubeProgrammer/ ST-Link Utility...)the error message is as below: I have read related issues on forums and tried some methods from forum, ...like change [reset mode], [mode], or hold reset button and release followed by click [connect]...!however that doesn't seem to be helpful for my situation.any other advice will be very appreciate,thanks~
Hi,I am trying to integrate custom user application with SBSFU bootloader for p-nucleo-WB55 and I was wondering in case anyone saw the following issue.When I try to use the Secure Engine functions for validation in my user application, the program gets stuck and watchdog resets after timeout sometimes. Here is the call stack flow when I come across this issue:Reset_Handler() at startup_stm32wb55xx_cm4.s:52 0x8000640 <signal handler called>() at 0xffffffe9 memcmp() at 0x80027b4 SE_IMG_GetActiveFwState() at se_fwimg.c:354 0x8001d5e SE_CallGateService() at se_callgate.c:1,213 0x80017b6 SE_CallGate() at se_callgate.c:319 0x80002d0 SE_APP_GetActiveFwState() at se_interface_application.c:185 0x8003978 I don't see this issue consistently so I am a bit lost on where the issue could be. Highly appreciate you taking the time to read this. Thanks.
Hi,The STM32U5 has a password feature to restrict RDP regression from level 1 to level 0. However it seems that STM32CubeProgrammer CLI is unable to activate this via the USB interface of the built-in bootloader. If I do it via STLink then it works fine.The command I send is: .\STM32_Programmer_CLI.exe -c port=USB1 -lockRDP1 0x12345678 0xDEADBEEF Which results in a "Error: Cannot lock RDP level 1." message.When I do the same with SWD/JTAG interface with the CLI tool then it works fine.Here is the verbose output. Note cube programmer v2.15.0 and device is current at RDP level 0. Device name : STM32U575/STM32U585 sending an abort request setting the address pointer to address: 0x0bfa07a0 receiving packet nbr: 0 sending an abort request UpLoading data Flash size : 2 MBytes Device type : MCU Revision ID : -- Device CPU : Cortex-M33 sending an abort request setting the address pointer to address: 0x08000000 Error: Cannot lock RDP level 1. I can't see anything in th
Hello Everyone,We are currently working with STM32U585 microcontroller for one of our IoT project.In this project we are planning to implement secure boot.In this regard we want some clarification on the below points,1. After doing secure firmware install(SFI) & setting the RDP to level 2, if the JTAG is compromised is it possible to load any hex file without following SFI process as RDP regression would have taken place and the microcontroller flash would have been mass erased and RDP level = 0 which gives full access to the controller.2. How does the immutable boot loader in RSS checks the integrity of the software bootloader loaded in the flash?3. Is it possible to add custom key checks to the immutable bootloader in the RSS section?4. Is it possible to load custom bootloader or modify the immutable bootloader in the RSS section?Thanks in Advance.Surya S
Hello supportTeam,@Bubbles @Fred Part No: STM32U585ZITEnvironment: STMIDEDetails: TFM / SBSFU We used the ST-provided SBSFU solution for firmware upgrade purpose.As per our needs, SBSFU/TFM-Boot and SBSFU/TFM-Loader successfully jump to own created application[ThredX OS based].Below are the steps I used when integrating my own application with SBSFU.1. Create Project Name: Application [Enable TrustZone with Thread-X OS In STM32U585ZIT6Q controller]2. Copy the SBSFU_Appli\STM32CubeIDE\NonSecure\STM32U585AIIX_FLASH.ld and Added in own application non secure folder[output.ld - added prebuild file in secure project properties]3. Copy the SBSFU_Appli\STM32CubeIDE\Secure\STM32U585AIIX_FLASH.ld and Added in own application secure folder[output.ld - added prebuild file in non-secure project properties]4. Copy SBSFU_Appli\STM32CubeIDE\Postbuild.sh and Added in own application project repository5. Update NS address in own application secure-> main.c "#defin
We're trying to provision Secure Manager on our H573ZI-based engineering prototype boards.We've only successfully provision only one out of three and the successful one took several tries.We're using the same provision.bat/provision_auto.bat (from SMAK) that works on the H573II DK board almost all the time.In the failed cases we getWarning: Option Byte: SECBOOT_LOCK, value: 0xC3, was not modified. Warning: Option Bytes are unchanged, Data won't be downloaded Time elapsed during option Bytes configuration: 00:00:00.003 Warning: Option Byte: SECBOOTADD, value: 0xC0000, was not modified. Warning: Option Byte: SECWM1_END, value: 0x7F, was not modified. Warning: Option Byte: SECWM1_STRT, value: 0x0, was not modified. Warning: Option Byte: SECWM2_END, value: 0x7F, was not modified. Warning: Option Byte: SECWM2_STRT, value: 0x0, was not modified. Warning: Option Byte: SRAM1_3_RST, value: 0x1, was not modified. Warning: Option Byte: SRAM2_ECC, value: 0x0, was not modified. Warning: Option Byte
Hi @STea GreetingsWith Respect to my previous post of RSASSA-PS i had added another query again posting as a separate threadQuery - In the TF-M Appli folder(from the ST provided package of TFM Example with TFM SBSFU) - how can i access a secure service from the non secure area because it does not have a non-secure callable function(nsc.c)(in a normal program with TZEN enabled there will be a nsc.c file in the secure code which can be accessed from the non secure code using entry functions - my understanding here is the basic concepts.). With respect to the above understanding can you please suggest a look out of how can i implement an adc(in the secure zone of the TF-M Appli) and call the voltage value from the channel in the non secure code of the appli.Please suggest how can i implement this requirement. awaiting your guidance in this regardThanks and RegardsPhilip
Hello, I would like to start working on SBSFU. I have B-L4S5I-IOT01 board which has STSAFE device I'm interested on.What I have read so far and particularly UM2262 document indicate I have to:- build SECoreBin- build SBSFU- build UserAppI have opened the project of the X-CUBE-SBSFU package in "STM32CubeExpansion_SBSFU_V2.6.2/Projects/B-L4S5I-IOT01A/Applications/2_Images_STSAFE" with STM32CubeIDE and trying to follow this procedure.First of all I would like to indicate it fails on Windows but I don't understand the reason and I have not investigated. I moved on ubuntu. Here We have all the *.sh files missing execution right so initially building fails for this reason. Add +x to all *.sh files looks good.Now I'm building the SECoreBin firmware and I get the following error: 23:19:06 **** Build of configuration Debug for project B-L4S5I-IOT01_2_Images_SECoreBin ****make all "../prebuild.sh" "../"prepareimage with python scriptpython /home/ubuntu/st/STM32CubeExpansion_SBSFU
Hello TeamWe are using ST's T-FM environment for STM32U585 MCU. We have observed one strange behaviour while using the non secure callable function in the non secure code. The problem is such that till the call to "TX_PORT_SPECIFIC_PRE_INITIALIZATION"(in the Azure RTOS init function) I am able to execute a function declared in the secure_nsc.c(secure gateway), but if I try to call this function after TX_PORT_SPECIFIC_PRE_INITIALIZATION, I am getting hardfault_error(). The hardware fault analysis shows the following results:Please help us out in the possible causes and solution for the issue(in the non secure code)Flow of the APIs:MX_ThreadX_Init()tx_kernel_enter()_tx_initialize_kernel_enter()TX_PORT_SPECIFIC_PRE_INITIALIZATION
Hi @ST Community Thanks for the support I'm working on the Package provided by ST, TF-M Application and Bootloader(TF-M Application and TF-M Bootloader) and have tested the working with the automatic script provided with the package(TFM_update.sh)(Reference Manual UM2851).1. I wanted to know how can i do a step by step debug for the entire application(application + bootloader) or only the application. Please support me with any steps that are applicable to enable the same.2. Can you please support on the sequence of the steps to manually run the total TF-M Application without using the script.3. Could you please provide some sequence of steps to use the PSA Crypto API for crypto operations(i am going through the references provided in UM2851 and UM2852)Thanks for the support
ST undoubtedly put lots of effort in building a complete and coherent solution supporting secure firmware install (SFI), even done by contract manufacturer (CM) independent from the original equipment manufacturer (OEM). See AN5054 and AN4992.However, how can I use this solution, or even part of it, to allow the end user to update STM32U5 firmware once a new version becomes available, preferably using firmware image downloaded from my website and stored on USB pendrive? I imagine that such image could be generated based on the actual device "license" provided (uploaded) by the end user, but it is not a must.Are there any examples, application notes, or presentations available on this subject?Reading firmware file from the pendrive is not a problem, but what needs to happen next is.Please advise.
hello everyone , how can i protect code in stm32f103 with the ability to upgrade code in future ? i am using stmcube programmer ide and stlink programmer
Greetings. I ran into a problem, I can’t figure out how to become a polynomial if I use not 32 binary mode but in 8 bit mode. MCU STM32F072x8/xBif I use a 32-bit setting, I get the correct data and can process it on a PC, but with 8 bits it doesn’t work.. uint32_t crc32(uint8_t *data, uint16_t size){ uint32_t crc = 0; SET_BIT(CRC->CR, CRC_CR_RESET); // RESET bit for (int i = 0; i < size; i ++){ CRC->DR = * (data + i); } crc = CRC->DR; return crc; }
Hi,I am replacing Standalone Loader(Ymodem serial) and porting BLE_OTA in SBSFU as mention in AN5056 section 8.4 How to replace the standalone loader with a BLE OTA loader i am successfully ported and run BLE OTA but as wireless stack not started it not enable BLE.So i am started wireless stack by command line$ sudo ./STM32_Programmer_CLI -c port=usb1 -startwirelessstacknow it's able to detect device and i am perform firmware upgrade userapp.sfb through OTA.it downloaded but not decrypt, verify and run. i am suspecting FUS is not ideal and that why SHCI_C2_FUS_LoadUsrKey not working. whenever i am making FUS in ideal state using following command $ sudo ./STM32_Programmer_CLI -c port=usb1 -fusgetstateand then after restart the board in normal mode it can decrypt data form slot 1,verify it and store it in slot 0(active slot) and application is running.Here my question is why we manually start wireless stack and also why there no any check for fus get status and if it's not ideal why ima
I see the listing of all variants of STM32F405 & STM32F407 shows secure boot as one of the security functions. But I haven't been able to find any documentation for the same.It would be helpful if someone can point me to the relevant documentation.
Hi everyone,I'm currently trying to switch to the Secure World within ThreadX using a NSC function (I use an empty function for debugging, but the problem does persist also if I do anything there).Problem:If i call my NSC function in the NonSecure main.c before the MX_ThreadX_Init() it works fine.If i call it after it in some application, it does not work.More precise, i get an HardFault with the STKERR, BFARVALID, PRECISERR, bit set in the BFSR register. see here for more infos about the registers . Also the stackpointer sp is at the end of the secure RAM (Increasing the RAM does not help, it then still is at the end) After debugging a while, I found after what instruction/function my error occurs. In _tx_initialize_kernel_enter() in the file tx_initialize_kernel_enter.c the function _tx_thread_secure_stack_initialize() gets executed by the macro TX_PORT_SPECIFIC_PRE_INITIALIZATION. Before that call, the NSC function works, after it I go straig
Hi It stated in PM0059 page 16: The value of an option is automatically modified by first erasing the user configuration sector and then programming all the option bytes with the values contained in the FLASH_OPTCR register.I want to know : What's the user configuration sector? Can you help to point to the right ones in the following table?
HI I have attached the result of the " Public Key Certificate " that I received from the SMAK application code. As a result, we are getting an Elliptic Curve Cryptography (ECC) type certificate. But as per UDAI Specification Ver 2.0 - 2022 , We need RSA 2048 Type certificate. Kindly support
Does Secure Manager actually use USART1 when it comes up or is the initial serial output from the default app installed when I provision Secure Manager (SM)?This output, I mean================= General Infos ==========================Flash Layout configuration index: <0x0>Secure Manager Version: <1.0.0>STuRoT Version: <1.0.0>==========================================================I saw in ROT_Provisioning/SM/Config/SM_Config_General.xml that had elements to change USART and associated GPIOs.If so, is changing SM_Config_General.xml and re-create the obk enough to change it?Or, is the SM hardcoded to USART1?Also does the SM, release or stop using the USART, to allow the non-secure app to use the USART?We have engineering H573-based boards, in which USART1 was already allocated to another function.So, would like SM to not use USART1, and if needed, use another USART allocated (temporarily) to a serial console
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.