Ask questions and find answers on STM32 security frameworks and tools, including cryptographic libraries, TrustZone, and the Secure Manager.
Most recent activity
Hi,I don't do any change to the script file, please advise how to let the script work normally.Rgds,QiZhangD:\>cd D:\WSL_DIR\STM32Cube_FW_L5_V1.4.0\Projects\STM32L562E-DK\Applications\TFM\TFM_SBSFU_Boot\STM32CubeIDED:\WSL_DIR\STM32Cube_FW_L5_V1.4.0\Projects\STM32L562E-DK\Applications\TFM\TFM_SBSFU_Boot\STM32CubeIDE>bash regression.shregression script startedRegression to RDP 0, enable tzregression.sh: line 16: $'STM32_Programmer_CLI\r': command not foundregression.sh: line 59: syntax error: unexpected end of fileD:\WSL_DIR\STM32Cube_FW_L5_V1.4.0\Projects\STM32L562E-DK\Applications\TFM\TFM_SBSFU_Boot\STM32CubeIDE>
I am trying to build Alexa build in device on X-CUBE-VS4A runs on the 32F769IDISCOVERY board.I have registered this as a new product under my Amazon account and need return URL example (http://stvs4a/grant_me) details Which I can enter under Amazon security profile to get the token. Security profile is not allowing http://stvs4a/grant_me to be saved reports error One or more of the Allowed Return URLs is invalid.
I am developing some products based on STM32F407/STM32F429. What I am trying to do is to protect my firmware that:simply dump the code from one chip's flash (to hex file) will not work in another chipmoderate reverse engineering should not be that easy to hack the codeAnd what I am trying to do is use mbedtls as a crypto library and encrypt part of my code then store it in some flash sector. Then each time when I boot, decrypt the code into SRAM2 and point the function to that region.It is a good idea to do that? and I have tried to copy the function from flash 0x0800xxxx to SRAM2 (0x2001C000) and made a function pointer to that region. but call the function caused HardFault exception.
Hello,I am designing a firmware for an IoT that needs to be able to be updated securely. I decided to use the X-CUBE-SBSFU package. From a crypto point of view, the requirements are that:The firmware update needs to be confidentialThe firmware update needs to be authenticatedTherefore, I decided to use the SECBOOT_ECCDSA_WITH_AES128_CBC_SHA256 crypto scheme.So I will need to store on the IoT :One symetric key for AES128 (key 1)One public key for ECCDSA ((key 2)According to the UM2262 user manual, those keys are stored in the secure enclave. This means that :If I activate RDP lvl 2, those keys are immutable and can never be updatedIf I activate RDP lvl 1, I can mass erase the flash and reflash a bootlader with new keys so I need physical access to the device for the updateQuestion 1: Are those 2 statements correct ?Another possible scenario that I see is that:I use the Key Management System MiddlewareI modify the SBSFU so that the keys are stored in the section of th
I use STM32H7xx_DFP in last version 2.8.0 and in Keil uVision. There is shown some wrong addresses on the CRC registries. So I repaired it in svd file and generate new SFR file for STM32H753. If you need repair CRC view, I can send the sfr file to the email.
Hello,with a new never programmed stm32g031 chip I get different values for PCROP if the same chip is read with ST-LINK or with bootloader+UART.The CubeProgrammer version is 2.7.0Which is the reason for that?Thank you
We are working on one of the project there is a requirements to develop small adaptor card to support new external module with I2C interface (Current Host module support only SPI interface).We are looking for low cost basic Microcontroller from ST for SPI to I2C conversion as mentioned below;Microcontroller shall have secure boot –>Secure Element (Secure memory + first stage bootloader) Integrity of the Application FW shall be checked before boot. Microcontroller shall be upgradable with an encrypted firmware image (Second stage bootloader) through SPI.Integrity of the upgradable Image shall be checked .
I am trying to build the 3 components that comprise the "2 Images" variant of the SBSFU v2.5 package. This requires building the following components: 2_Images_SECoreBin - 2_Images_SBSFU - 2_Images_UserApp The SBSFU package does not, however, come with .cproject files for STM32CUBE-IDE which is my target IDE. How can I import and compile this package and its components with the CUDE-IDE? Thanks
Hello all,I have developed a code for stm32f103, which works fine.During code execution, some device configuration data is Read & written into flash (works fine).But when i enable read out protection, the code doesn't work.My understanding is that when read out protection is enabled, code is not able to read/write data from flash, in result it doesn't initialize the configuration parameter of device.i tried to enable to the read out protection by both ways.......from st-link utility tool or......by writing in code itself./***************code for read out protection****************/uint8_t ReadProtectionConfig(uint8_t ProtectionLevel){ uint8_t status = 0; FLASH_OBProgramInitTypeDef OB_Init; HAL_FLASH_Unlock(); HAL_FLASH_OB_Unlock(); OB_Init.OptionType = OPTIONBYTE_RDP; if (ProtectionLevel == 0) { OB_Init.RDPLevel = OB_RDP_LEVEL_0; } else if (ProtectionLevel == 1) { OB_Init.RDPLevel = OB_RDP_LEVEL_1; } &nb
16:11:04 **** Build of configuration Debug for project 16174prog07_2_Images_SECoreBin ****make all "../../prebuild.sh" "../.."../../prebuild.sh: cd: line 12: can't cd to C:/Users/michael/STM32CubeIDE/Integ/Docs: No such file or directoryprepareimage with windows executeableC:/Users/michael/STM32CubeIDE/Integ/Docs & Source Code June 2021/16174prog07/source/externals/alc-iot/middlewares/third_party/STM32_Secure_Engine/Utilities/KeysAndImages/win/prepareimage/prepareimage.exe conf ../../../Inc/se_crypto_config.h../../prebuild.sh: line 1: C:/Users/michael/STM32CubeIDE/Integ/Docs: not foundselectedbash: SECBOOT_AES128_GCM_AES128_GCM_AES128_GCM: unknown operandbash: SECBOOT_ECCDSA_WITH_AES128_CBC_SHA256: unknown operandbash: SECBOOT_ECCDSA_WITHOUT_ENCRYPT_SHA256: unknown operandrecopy postbuild.sh script with .sh scriptcat: can't open '../../.sh': No such file or directorycat ../../.sh : failedmake[1]: *** [makefile:93: pre-build] Error 1make: *** [makefile:61: all] Error 2"make all
I'm currently investigating SBSFU options for STM32 and it seems like the base package incorporates authentication of the firmware based on on digital signatures (ECDSA, edDSA etc.) but does not incorporate firmware encryption. I have an additional requirement to encrypt the firmware prior to flashing it to the device and then decrypting and authenticating the app image prior to execution. Is this possible through the base SBSFU package or does it require a custom extension/implementation? Thanks!
Hello Dear Friends! I use STM32F439 MCU and it has AES encryption peripheral. I tried to encrypt data in the format of uint32_t and it encrypted data and I tested it successfully on online tools. However, I wanted to encrypt data in the format of char which will be transferred by tcp/ip protocol. Then, when I recived this encrypted data in the format of hex it did not recive in true format. On the other hand, when I decrypt the encrypted data I got data that I sent at first. Therefore, it decrypts data correctly. But there is something wrong in the step of encryption of data. I searched for endianless topic for this problem on google but I could not solve it. Is there anyone who will help me? From now on, thanks for helps!The related part of codes are avaiable as shown below; char spi_mydata[16]; uint32_t spi_encrypted_data[16];static err_t tcp_rmii_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err){ int i; int len;&nbs
I was looking over the example projects that come with CryptoLib v4.0 in the package en.STM32CubeExpansion_Crypto_v4.0.1 for examples related to X.509 certificate handling and was not able to find anything in that regard. I wanted to confirm whether or not CryptoLib supports X.509 certificates? It does not seem to do so. What is the recommended option for incorporating X.509 functions on STM32? Thanks!
I couldn't find any clear explanation for the term loader on an5056 and um2262.Maybe it is so obvious for others but unfortunately not for me:\ So here is my questions regarding loader and appreciate you helping me understand it well.What is the loader on SBSFU projects? does it refer to the ymodem protocol or the uart?What does a standalone loader mean? when do we need it?Why use ymodem for transferring firmware? Is there any alternative or even better protocol?In my project, I need to update the device with an android phone through the USB-CDC. I should change the uart to usb-cdc. The android app needs to download the .sfb file from a server and send it to the MCU to upgrade it by ymodem protocol, Am I right?
Hi, I want to port SBSFU to my project which was written for the STM32F756VGT microcontroller by Keil.So I have some questions regarding this situation.At first, I took the `STM32F769I-Discovery` example of SBSFU as a base project that I need to make my changes to `2_Images_SBSFU` and `2_Images_SECoreBin` projects and also replace my project with `2_Images_UserApp` and also make some changes to it too.so here I am, I want to change the addresses in mapping_fwimg.h.Should I take the SWAP part as large as 256KB? -as it is the largest sector of flash-I can't use a lower size than 256KB for the SWAP, right?If it is so, how should I set the slot sizes? On page 14 of an5056, it says it should be multiple of swap size. so does it mean that I should use sector5 for slot0-256KB- and sector6 for slot1-256KB-?
What .c file has the code for the YMODEM portion of the SBSFU pictured below ?I have found the string "File> Transfer> YMODEM> Send" a few times, but when I changed the string to test if I found the correct area, nothing changes in the picture above. Another tip as to why I don't think I've found the correct code location, is when I have changed the string "File> Transfer> YMODEM> Send" to say "File> Transfer> YMODEM> Send TEST" If I open the SBSFU.elf file the string is unchanged as shown below.
Is there a way to support X09 certs for Secure Boot and Secure Firmware Authentication (SBSFU) features on STM32 MCU's? All the examples I've seen on this use bare public keys rather than certificates. Thanks!
Hi, I am implementing ECDSA signing functionality based on some sample code in the package en.STM32CubeExpansion_Crypto_v4.0.1. I am getting the following linker error. What am I missing? Thanks! c:\st\stm32cubeide_1.6.1\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe: ../STM32_Cryptographic\Lib\libSTM32Cryptographic_CM0_CM0PLUS.a(cmox_init.c.o): in function `cmox_initialize':cmox_init.c:(.text+0x1a): undefined reference to `cmox_ll_init'
I'm trying to add a authentication mechanism with a symmetric key stored in the system memory but I'm not sure if it's the right way and i also don't know how to store this key in the system memory.I read about SBSFU but not sure about it.Kindly advise me on how could i do it please.Thanks in advance.
If not, what is the TPC used for?
I'm using YMODEM in TeraTerm to transfer my internal and external firmware and my goal is to make this a single file. I have already combined the two files into a .bin and when I transfer them via YMODEM, the transfer stops once it reaches the end of what would have been the first file, it it wasn't combined. I'm also doing this with SBSFU, which may complicate things. One potentially easier part of the troubleshooting problem I'm having is that when TeraTerm is transferring the files with YMODEM, I can't see any status other then a progress bar. Is there another program or some way to see all the messages going back and forth? Maybe see the actual error messages happening or any printf statements I have the code send, while a transfer is taking place?
MCU : STM32F415I enable readout protection successfully (customer requirement). Then in case of a new software update, I jump to the UART bootloader from my code. However, when in the bootloader I need to disable RDP. When I send RDP disable command and the device erases all firmware (as expected), disable RDP and exists bootloader.The question is is it possible to prevent the MCU from resetting or exiting bootloader
Hello everyoneSo I've managed to adapt and build my custom user app. Flashed it into the device.But it fails on startup somewhere between gpio and timers initializations in main().Console shows the following text:= [TEST] write 8 bytes @ Isolated code start add 08000200flash error code: 0 ===> KO!!!!! What this may mean?edit: in debugger is saysBreak at address "0x8009b98" with no debug information available, or outside of program code.The MCU is STM32G070IDE is CubeIDE
Hello guys,I've implemented SBSFU along side with an USB standalone loader for my project using a STM32WB. My question is, should i implement hardware semaphores and shci_notification for CPU2 during flash erasing and writing operations on my USB external loader? I don't use BLE in this loader, but the user app will and the microcontroller CPU2 will have a running ble stack. I'm not sure how the "reset" of CPU2 works, if my userapp call for "NVIC_SYSTEM_RESET()", will CPU2 reset aswell? After reset, will CPU2 only start when my application call appe_init() or will it start automatically? I'm considering that because if CPU2 reset when microcontroller get a software reset and only runs after the call of appe_init(), i wouldn't need any hardware semaphores in my external loader, since CPU2 would be halted, right? So, should or shouldn't implement hardware semaphores and shci_notification in my USB loader?
Obviously Read Protection Level 2 is the most secure in protecting IP on the G series MCUs, but in the worst case scenario it could involve unsoldering and replacing the IC. Do you use Level 2 or is Level 1 secure enough for most scenarios ?
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.