Ask questions and find answers on STM32 security frameworks and tools, including cryptographic libraries, TrustZone, and the Secure Manager.
Most recent activity
I have to generate CRC on MCU (STM32L476VG). I am using code as below for generating CRC.uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength) { uint32_t temp = 0U; /* CRC output (read from hcrc->Instance->DR register) */ for (index = 0U; index < BufferLength; index++) { hcrc->Instance->DR = pBuffer[index]; } temp = hcrc->Instance->DR; /* Change CRC peripheral state */ hcrc->State = HAL_CRC_STATE_READY; /* Return the CRC computed value */ return temp; }Can you give some reference code for validating this CRC on another machine (OS environment) .My data packet and CRC as per below. 072300210c000001f900000000000a0001001e000000000000012c0000 3a7040ef |----------------------------------Data Packet-------------------------------------------|----CRC----|Please let me know if you need any further information.Thank you,Bhavin.
Hi,I want to block flash memory for writng after programming it. It is important that write protect should not be possible to deassert. I have read about RDP mechanism, but there is information that on level 2 write protection is permament, but only in case of programming flash from JTAG. I need to know how to block flash for programming from booth JTAG and internal program write access.
..
I am working through the Security MOOC and in section 6, they show how to build the NUCLEO-L476RG example project on Windows. Their procedure does not work for me on MacOS Big Sur.The most pressing problem is that when I try to build SECoreBin, I get this error:I haven't been able to figure out how to resolve this problem. Does anyone know how to get the project to build?Besides this problem I have several lesser issues: Importing existing projects into the workspace does not work at all with this expansion pack. When I try to do this the project has no c or h files in it. They appear to be linked to non existent files. So I think tried to import an AC6 project. That works better but it links to the files in the expansion pack download location. I don't like that at all. So I then copied the NUCLEO-L476RG project to a new workspace and finally got CubeIDE to import those files. That works the best but the directory structure on the disk does not match the structure in the IDE. Plus the
HI, I am trying to port one of ST's security hands on labs for firmware protection that targeted v3.1.3 of the CryptoLib package, to v4.0.1 of the CryptoLib package. It seems like the "legacy" v3.1.3 interfaces for SHA256_Init() / Append() / and Finish() (see screen shot below) have changed since I am getting unresolved symbols for these SHA256 calls when I try and link to the library in the new Crypto package. Would someone know where I can get information about the new interfaces for these functions? I searched the header files in v4.0.1 of the crypto package and was not able to find any files that describe equivalent functions. The ST firmware protection hands on lab that I am trying to port to v4.0.1 Crypto package is described in my earlier post here - https://community.st.com/s/question/0D53W000018Sf7hSAC/cryptolib-for-stm32go
My user application firmware is rather big. It runs on STM32G070, so I've adapted the example code from STM32G071. I've followed the example provided in AN5056 (see picture) to reduce the SBSFU size, it saved about 10 kB, but it is not enough (still overflows by about 5 kB).The last row depicts the method that can give the most of saved space, but how I do it? Does it mean to uncomment #define SECBOOT_DISABLE_SECURITY_IPS? Or something else?
Hi all,I would like to use the Cryptographic peripheral in my STM32L451 to encode and decode some data based on a pre-stored common key.Are there any examples for Atollic that would get me started on this?
I am currently experimenting on stm32l562e-dk board, and I discovered that, in the secure world, non-secure flash cannot be read via a secure memory region (i.e. not covered by any of the SAU regions). To be specific, value of zero is read.I am wondering whether this behavior is architecturally specified or just STM32-specific.Thanks
Hello everyoneSo I've managed to build MY user app, where a lot of things programmed alongside sbsfu support.But the binary file is simply huge - 134 MB! How comes?Also, sfb file does not get generated. May it be connected to disabled security defines? My controller does not have secure memory area
It looks like STM32L496xx.h does not have the hash peripheral definitions in it. e.g. The STM32Cube_FW_L4_V1.16.0 examples for STM32L496 HASH peripheral are all configured to use the STM32L4A6xx. Does ST have a plan to update STM32L496xx.h?, or Is it ST's accepted solution to define the L496 MCU as STM32L4A6xx?
Hi,All.First of all, LET me tell you the background of the problem. I use STM32G0 series MCU. The SWD port will be hardware connected to one of my wireless communication modules for OTA upgrade function. Then I tried to use the read protection function at the same time, but I found that when the RDP level changed (from level 0 to Level 1), the RDP could only take effect after the power reset. I have checked the document of RM0454 and mentioned that when SWD port is connected, it is necessary to replace system reset by power-on reset. Here comes the question:1.Is there any way to write RDP level 1 without power reset operation? (SWD interface always hardware connected but no sigal communitication) 2.Is it possible to restore it to level 0 or level 1 after RDP have been set to level 2?Regards!
Hi, I'm in the process of going through the labs in part 4 of the ST Security MOOCs, specifically the hands on over here .https://www.youtube.com/watch?v=0CVplWZ8zls&list=PLnMKNibPkDnF0wt-ZI74SflnsBV4yKzkO&index=3The hands on asks to connect a terminal to the board in order to receive some output from the app running on a Nucleo G071RB board. I am not, however, able to see any output, any ideas as to why that is? My Tera term configuration is given below, thanks! Upon reset I just get garbage printed to the screen as depicted in the 3rd screen shot below
I am trying to merge UserApp example into my existing project. Everything goes fine, except for the error mentioned in the title. I've checked that include list is identical to UserApp example, as well as Linker->Miscellaneous->Other flags. What am I missing?EDIT: I've forgot to mention that I'm using the example for STM32G071xx and my MCU is STM32G070xx. IDE is STM32CubeIDE.
I am using the STM32L562E-DK development kit. I have taken reference to NUCLEO-L552ZE-Q and ported it for STM32L562E-DK. Also added External OSPI flash. without FreeRTOS it is working fine.I have added FreeRTOS in the nonsecure application. For that, I have made the following changes1) Adopt Middleware folder as provided in "FreeRTOS_ThreadCreation" example of STM32L562E-DK2) Adopt stm32l5xx_hal_timebase_tim.c3) Remove SysTick_Handler() definition in stm32l5xx_it.c file.4) Add void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) API in main5) Add osKernelInitialize(); and osKernelStart(); in main().The same changes are working for the GPIO_IOToggle example. I am able to toggle GPIO in the thread. But in the case of the SBSFU Application is not working. Is there any specific change is required in bootloader or application?@Frantz LEFRERE , @Jocelyn RICARD Can you please guide me regarding it?
Hello,I am adapting the X-CUBE-SBSFU (version 2.5.0) for use in our product which uses the STM32L486RE device and I am using external flash memory to receive the downloaded firmware image. I used the sample project '2_Images_ExtFlash' for the B-L475E-IOT01A board as a starting point and I have been able to get everything up and running on my target hardware. I can bootload a small user application similar to the one used in the sample. However, I have run into some problems because the real application image that I will be installing is larger than a single bank of the MCU internal flash space.I have configured the bootloader to use one active slot in internal flash and have placed the header of the active image immediately after the SBSFU code (__ICFEDIT_SB_region_ROM_end__). The active image is allocated the remainder of the internal flash with the exception of the last sector that I need to keep reserved for storing application non-volatile data. At this poi
Hello guys!How are u all?I'm having few issues to develop self-test on my application. I setup everything from the SBSFU side to check image handling flags, and its working fine. I'm able to set my new firmware to self-test state and check the state of my active slot.My problem begin when i need to self-test. I have the following code on my application: printf("Before SE_APP_GetActiveFwState.."); SE_APP_GetActiveFwState(&se_Status, slot_number, &fw_state); printf("After SE_APP_GetActiveFwState.."); if (fw_state != FWIMG_STATE_SELFTEST) { printf("Firmware not is SELF_TEST state\r\n"); } else { printf("Firmware is in self test!\r\n"); se_retCode = SE_APP_ValidateFw(&se_Status, slot_number); if ((SE_SUCCESS == se_retCode) && (SE_OK == se_Status)) { printf("Firmware validated\r\n"); } else { printf("Firmware validation failure\r\n"); } }All i want is just to validate my firmware image. After
Hello,I have a system with one STM32L562QEI6 and one STM32F405RGT6, that is the main MCU.They communicate with USART interface.In the main CPU, boot0 and boot1 pins are phisically connected to VCC or GND through some resistors, so I can enter boot mode or leave the program run easily.On the STM32L562QEI6, I used a pull down in the boot0 pin and I connected this pin also to USART-RX line. When I want to enter boot mode on this MCU, I send a logic high level from the main MCU through USART-RX but the MCU won't boot. I see the high level on boot0 pin but I can't access boot memory. I don't understand why.Only with external connection between boot0 and VCC, MCU enter boot mode.Please can you help me?
Hello,I am trying to run the Secure boot feature on STM32L433RC using the SBSFU library example project (single image slot). The example project I am modifying is STM32L432KC board. Below are the modification/steps I made to example project to run on STM32L433RC:change the UART GPIO pins.change the LED GPIO pins.Disabled all the protections for now.Compiled SECore, SBSFU and User app.Downloaded the SBSFU to STM32L433RC.Opened Tera Term, Hit reset button.When asked to send the file using YMODEM protocol, I selected the SBSFU_UserApp.bin and the below error in the image is getting triggered. Can anyone help me to successfully load the User app onto the board? Please let me know if I need to modify anything more or change the above modifcations.Thanks!
HI,I have successfully implemented encryption in my project using STM32 cryptographic firmware library software expansion for STM32Cube. It works fine with 128 bit AES encryption (i.e. using 16 bytes long AES key). However, I need to implement 256 bit AES encryption and if I change the 16 bytes long key to 32 bytes, then the encryption does not work anymore. It seems that the default setting for encryption key is 16 bytes long. So could you please let me know what should I do other than changing the length of the key. I mean is there some library files or some other files where I have to make some changes to make 256 bit AES encryption working. It would be a great help for me because I have been stuck in the situation for quite a long time.
Hello everyone,I am trying to build SECoreBin, but the build fails with prebuild.sh. All python requirements listed in requirements.txt are installed, but the error is following:ImportError: No module named Cryptodome.CipherAnd even more: What should I do? As I have said, cryptodome is installed.
HelloI would like to use the same UART that is used in SBSFU, to communicate with the host PC for service purposes. Is it possible? Maybe create kind of a wrapper interface like "press 1 for sbsfu, 2 for logs"? A little bit confused how to implement it if possible. It is the only UART available on my custom board, all pins are already used.
Hi,I just downloaded the latest cryptolib v4 and read in the docs that it is not compatible with v3 anymore.Are there any instructions how to use it with the "STM32 Security in practice" workshop?Thanks,Anguel
HelloI'm having trouble calculating crc. I am using STM32F401 with cube ide. The correct crc occurs on crccalc.com. But I couldn't run CRC-8 with MCU. I have looked at the examples, but when I try it gives different results. Can you provide a working code example?
I am using STM32H747BI MCU and I have one project to write the data to flash memory. I am using core 7 to write the data to flash. While writing, I have to encrypt the data. So I requested cryptographic library software expansion from STM32 and they provided me the software. From that software, I copied four files:stm32h7xx_hal_cryp.cstm32h7xx_hal_cryp.hstm32h7xx_hal_cryp_ex.cstm32h7xx_hal_cryp_ex.hAfter that, I put these files in respective inc and src folders and I uncommented #define HAL_CRYP_MODULE_ENABLED from stm32h7xx_hal_conf.h. After doing all of these, I started to encrypt the data but in the project it could not find CRYP_HandleTypeDef . It shows the error unknown type name 'CRYP_HandleTypeDef'. Could anybody suggest me what the problem is because I don't know how to solve this issue as I have done all the things that needs to be done.
I am exploring the security feature of STM32WL55JC via Applications/BFU_1_Slot using latest firmware STM32Cube_FW_WL_V1.1.0I am not sure what I am doing wrong and I have followed youtube and readme.txt. I was able to compile as below and upload STM32CubeProgrammer and RDP to 0 (AA).Here is IDE output07:28:47 **** Build of configuration Debug for project 1_Image_UserApp **** make -j7 all arm-none-eabi-size UserApp.elf text data bss dec hex filename 25312 144 9928 35384 8a38 UserApp.elf Finished building: default.size.stdout "../../../1_Image_SECoreBin/STM32CubeIDE/postbuild.sh" ".." "./UserApp.elf" "./UserApp.bin" "1" "1" prepareimage with python script 07:28:50 Build Finished. 0 errors, 0 warnings. (took 3s.330ms)Below files are successfully created by postbuild.sh-rw-r--r-- 1 username staff 25968 28 Sep 07:28 UserApp.sfb -rw-r--r-- 1 username staff 89456 28 Sep 07:28 BFU_UserApp.binBelow is minicom output from macOS and I could see same from TerraTerm too.Welcome to mi
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.