Ask questions and find answers on STM32 security frameworks and tools, including cryptographic libraries, TrustZone, and the Secure Manager.
Most recent activity
..
Hi,I would like to move my project to STM32 from another MCU.There are some requirements that I have to comply with and I would like to know if STM32 is a good idea or not.I need to be able to flash the firmware using USB without an USB to UART converter and have a secure way of flashing the firmware (like secure bootloader).Also, the MCU should send some data to a PC, but it is binary data and I want the communication to be as fast as possible and reliable. I was using UART to USB before and the highest bit-rate that I could go up to was 115200. Anything more than that had the potential to send wrong bytes. So I would like the data transfer to be done using the same USB as for firmware update.Also, how is the SDK for it? I have never used it before and I am not sure how all the environment works.Regards,Gabriel
Hi everyone,I was trying to protect my code by read out protection. But before uploading program, mistaken changed the read out protection to level 2 using of stm32 utility software. Now, I don't able to connect my board to st-link.After search for this issue, i find that it is irreversible process means i can't program again.Anyone has any idea?
For our application, we require more than 2 bytes to identify the fw version. However, the current SBSFU has only 2 bytes fw version in the header. What is the easiest way to add a few more bytes for fw version? Thanks!
Does anyone know something about it or similar cases?Is there some registers in HSE clock that can affect the RDP registers?Is it possible to be a bug in CubeMX?Or the problem is in my hardware?Thank you.
I'm implementing in my firmware on STM32H7 the change of RDP Level. In RDP Level 1, I can still connect through ST USB bootloader by setting signal BOOT0 (as expected). However when I connect to STM32CubeProgrammer, it asks if I want to disable RDP: it's not possible to access the chip memory without doing a regression to Level 0. I don't understand why: the ref manual says that in RDP 1, the STM32 bootloader from system memory is limited to a few commands but actually it can also modify the option byte to do a regression to level 0 so it is not perfectly clear.
Hi, I'm developing a project which is already quite advanced, and without any change that I have awareness, the microprocessor is protected. 1) What could have produced this change unexpectedly? untill now, I've worked a lot with STM32F103 microprocessors and never it had never happened. 2) How I can disable it? I've tried change it with ST-LINK Utility > Target > Option Bytes, but always appear "Could not set Option bytes! Please reset the target and retry". I've tried to reset the target, but it don't do any change. I don't understand why ST software cannot change the ST Microcontrollers if the software seems that has this tool to disable the Level 1 Read Out Protection. Thanks in advance
Hello all,I am working on a cryptography project based on STM32F407VGT micro controller, in which I need to generate random data using inbuilt RNG peripheral. I dump this random data to my Ubuntu 16.04 host machine using USB in CDC mode and using libusb 1.0.9. My buffer size is 16KB which I sent 64 times per 1MB. When I ran the statistical test suite on the 1MB generated data file, it gives a result of repeated sequence of bit stream around the last 64 KB of file. My window/slice size for statistical test is 1KB. Now my question is whether or not I am initialising and using the RNG in the correct way.I have attached my main.c here.According to App note AN4230, the RNG on the STM32 is a TRNG (and not PRNG). But is it possible that the RNG is giving repetitive data? I suspect so because it mentions an LFSR and LFSRs have a finite bit sequence period.
Dear everybody,I have a STM32L432KC chip.Firstly, I flash code and set RDP level 1 and PCROP_RDP flag to 1. => everything works fine.Then, i want to reflash code, so I changed RDP level 0 to 1 -> Chip mass erase and flash code again. But chip seems not working anymore although code was flash successfully.Anybody knows problems? please help me.As I guess, reason is probably PCROP areas was reset so code can not execute.Do my guess is right ? if right, how to restore PCROP area ?
Hello All,We have designed a custom board with STM32F777IITx MCU on it, where i am using ST Micro's CubeMX with Atollic True Studio for developing the code.Now I am also using a USB host peripheral and reading data from USB device now this data read from USB needs to checked for CRC.I tried to build a basic code using ST Micro's CubeMX and Atollic True Studio which would calculate CRC of an array, However when build the Code i am getting the given below warnings and also if i ignore these warnings my code gets stuck after it executes "HAL_CRC_Calculate" api. de-referencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] de-referencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] de-referencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]The given above warnings also come when in blank code generated using Cube MX.Also i referred the example code "CRC_Example" from the "STM32Cube_FW_F7_V1.9.0" Firmware pack
Hello,I'm trying to get LwIP working on a STM32F769I-DISC1 board but with the SBSFU bootloader.I started out with a basic project, generated with CubeMx, that sends UDP packets every 500ms (no operating system, just LwIP Raw API). This works, the board gets an IP address and I receive the data.I then changed the linker script and project settings to work with the X-Cube-SBSFU bootloader which builds and starts up but will not get an IP address. It just keeps waiting for an address.The changes I made to run with the bootloader are as follows:Changed STM32F769NIHx_FLASH.ld as attached (STM32F769NIHx_FLASH_bootloaded.ld)added includes to gcc settings in AC6 Systems WorkbenchMiddlewares/ST/STM32_Secure_Engine/Core2_Images_lwip/2_Images_SECoreBin/Inc2_Images_lwip/2_Images_SBSFU/SBSFU/App2_Images_lwip/Linker_Common/SW4STM32changed linker to gcc -z max-page-size=8add to linker libraries (-l) :se_interface_app.oadd to Library search path (-L) the path where se_interface_app.o can be foundadd t
Hi all!,In the case of a commercial device, who need periodic firmaware updates, is there a way to protect those updates in order to avoid for being copied and cloned?Someone can point me to a read about it?
Porting NUCLEO-H753ZI/Applications/1_Image to STM32H753.This is running on STM32H753I-EVAL2 board.The bootload can be done in 2 steps (download SBSFU.bin, then download UserApp.bin) or in 1 step (download SBSFU_UserApp.bin). The behavior is the same: bootload starts, detects userapp, tries to jump to userapp at 0x08020400. Then the system restarts...= [SBOOT] SFU_BOOT_CheckApplySecurityProtections= [SBOOT] System Security Check successfully passed. Starting...=========================================== (C) COPYRIGHT 2017 STMicroelectronics == Secure Boot and Secure Firmware Update ============================================ [SBOOT] SECURE ENGINE INITIALIZATION SUCCESSFUL= [SBOOT] STATE: CHECK STATUS ON RESET INFO: Last execution status before Reboot was: Verifying Fw Image status. &
Hi, I am coding on the NUCLEO H753ZI board with the pack for embedded cryptography (x-cube-cryptolib-3.1.2). While this folder provides example with hardcoded keys, it does not provide an example with keys imported from a file. Typically, I would like to generate elliptic curve keys using openSSL (they would be written in a .pem file) and then to import them in my code to create an instance of ECpoint_stt for the public key or an instance of ECCprivKey_stt for the private key. Is there any method from the STM library that allows me to do so ? The documentation for x-cube-cryptolib-3.1.2 did not seem to point out such method but it seems strange to me that it does not exist as .pem files is one of the classical ways to store keys.
Hello togetherI use the following library to create random numbers:- LibraryThe sample project runs on my NUCLEO-144 H743ZI. The problem is that the same byte array (RandomString) is generated at every time. ****************************************************************************** * @file RAND/RandBytesGen/Src/main.c * @author MCD Application Team * @version V3.1.1 * @date 20-April-2018 * @brief Main program body ******************************************************************************/* Entropy String. Uniformly distributed random bit string 1*/ uint8_t entropy_data[32] = { 0x9d, 0x20, 0x1a, 0x18, 0x9b, 0x6d, 0x1a, 0xa7, 0x0e, 0x79, 0x57, 0x6f, 0x36, 0xb6, 0xaa, 0x88, 0x55, 0xfd, 0x4a, 0x7f, 0x97, 0xe9, 0x71, 0x69, 0xb6, 0x60, 0x88, 0x78, 0xe1, 0x9c, 0x8b, 0xa5 }; /* Nonce. Non repeating sequence, such as a timestamp */ uint8_t nonce[] = {0xFE, 0xA9, 0x96, 0xD4, 0x62, 0xC5}; /* Personalization String */ uint8_t personalization_String[] = {0x1E, 0x6C, 0x7B, 0x82, 0
In the code below I have AES GCM correctly decrypting data using the Cryptolib. I am trying to decrypt the same data using the HAL_CRYP_AES_XXXX functions and it isn't working.Key is 32 bytes. iv is 12 bytes. header data (aad) is 3 bytes. message data (dc) is 20 bytes.I have seen that the data must be a multiple of 16 bytes. Do I simply pad with zeros and report size as 32 bytes in my case? Does the iv need to be padded? Or the header? Does the data, key, aad, or iv need to be byte swapped somehow?Is the CrypHandle.Init.DataType = CRYP_DATATYPE_8B correct?I've tried lots of different combinations and haven't hit on one that seems to work.Suggestions?Thank you.uint8_t key[]= "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; uint8_t iv[] = {0x04, 0xbc, 0xca, 0xab, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00}; uint8_t aad[] = {0x42, 0x24, 0x02}; uint8_t tag[] = {0xee, 0x20, 0xac, 0xfb, 0x41, 0x9c, 0x86, 0xc9, 0x9a, 0x87, 0x57, 0x5a, 0x97, 0x78, 0x52, 0xda}; uint8_t dc[] = {0x66, 0x9
Hello All,We have designed a Custom Board with STM32F777 MCU chip and are using Atollic Truestudio with ST Micro's CubeMX for development.I have implemented a USB boot loader for the same hardware which is working fine with the Custom Board.Now i want to implement CRC check in the Boot loader.My application code which is to be loaded using boot loader is generated using atolic so is there any method/Tool/ setting available from which CRC is generated and attached to the end of the application binary file.Also if there is any method/Tool/ setting please let me Know in detail what is that method so that i can implement it in my BootloaderThanks and regards Utkarsh
Hi,I requested a download access to X-CUBE-SBSFU firmware about two weeks ago but I didn't get a reply yet. Is there something else I should do ?
Main is entered,(for testing I enable the GPIO and turn on an LED to validate that cpu execution has entered main() --- then I set up the PLL, and GPIO - then test if the MCU has option byte set for Level 1 - if not I set it.I reset the device and it appears to be non-functioning.After reset - main() is never entered because the LED is not turned on.So - what can happen to the CPU such that after the option byte is changed (from AA 55 to 11 EE) - thereby have the MCU enter level 1 flash security that it appears to lock up?The MCU hardware has BOOT1 pin tied to ground so the boot process is supposed to boot to the user program in flash memory.I did find something in the user's manual about "Empty Check" which detects that flash at location 0x08000 0000 is 0xffff ffff - it assumes the flash is totally erased and causes the boot process to jump to the internal ST bootloader. If this WAS happening, it would present the same behavior I am having but I don't understand how the MCU would have
Hi,Upgrading to version 2.2.0 i get this error using the option " --mergesbsfu" (Add a binary header and a sbsfu segment to an elf file):arm-none-eabi-gcc -o "STM32F769I-Discovery_AWS.elf" @"objects.list" -mcpu=cortex-m7 -T"../STM32F769NIHx_FLASH.ld" --specs=nosys.specs -Wl,-Map="STM32F769I-Discovery_AWS.map" -Wl,--gc-sections -static -L../../../../../BootLoader_OSC/2_Images_SBSFU/SW4STM32/STM32F769I_Discovery_2_Images_SBSFU/Debug -Xlinker -L../../../../../BootLoader_OSC/Linker_Common/SW4STM32 --specs=nano.specs -mfpu=fpv5-d16 -mfloat-abi=hard -mthumb -u _printf_float -Wl,--start-group -lc -lm -Wl,--end-group Finished building target: STM32F769I-Discovery_AWS.elf arm-none-eabi-size STM32F769I-Discovery_AWS.elf text data bss dec hex filename 248680 13240 242064 503984 7b0b0 STM32F769I-Discovery_AWS.elf Finished building: default.size.stdout arm-none-eabi-objdump -h -S STM32F769I-Discovery_AWS.elf > "STM32F769I-Discovery_AWS.list" Finished building: STM32F769I-Disc
I am using multiple MCUs: STM32F733, STM32L433, STM32L443.In STM32CubeExpansion_Crypto_V3.1.0 I am using the software AES CTR encryption (Inc/AES/CTR/aes_ctr.h). I use AES_CTR_Encrypt_Init / AES_CTR_Encrypt_Append / AES_CTR_Encrypt_Finish methods. This works fine, though I would like to use the hardware AES for the MCU having it (F733, L443).I did not find a CTR related file in the STM32_Crypto_AccHw folder or some AccHw_AES_CTR_Encrypt* methods.Is there a way to use the HW acceleration for AES CTR more ?
Hi ,I am coding for STM32F207 for first time so I do not understand Why is STM32F207 processor loading 16 bit thumb instruction where as the Function pointer is 32-bit . is this ((void (*)(void))g_ulTransferAddress)() wrong ? As per our Project requirement we have 4 different sections of 1MB Flash. All the 4 Different sections of 1MB flash has 4 independent projects.1. CRC Verifier Project 0x0800_0000 to 0x0800_3FFF2. Decision Maker Project 0x0800_4000 to 0x0800_7FFF3. Bootloader Project 0x0800_8000 to 0x0801_FFFF4. Runtime or Scheduler Project 0x0802_0000 to 0x0810_0000Decision Marker should be loaded from the CRC verifier for this I am using following code g_ulTransferAddress=0x0800_4004 ;
SBSFU considers the secure boot as the root of trust. If we develop the firmware and manufacture the products in a factory (I assume that the firmware should be programmed during the manufacturing in the factory), how to guarantee the secure boot is correctly programmed? Any guideline for a good practice? Thanks!
I have a large application image running on the STM32F427. The image is more than 1M bytes, which make it impossible for dual-image. From ST's document, for single-image, "The user application cannot download a new firmware image: the local download procedure is the only way to update the active user code."One solution is to download the new image to external flash or SD card, what is the problem with this solution? If it is not a good idea, and I want to download the new firmware via OTA, then I have to implement the OTA code in SBSFU project?Or any suggestion?Thanks in advance!
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.