Ask questions and find answers on STM32 security frameworks and tools, including cryptographic libraries, TrustZone, and the Secure Manager.
Most recent activity
Is it possible to set level 2 RDP to just a subset of a certain Flash bank? not the entire bank. (Begin Address -> End Address for example)Is it possible to set RDP levels for an external flash not the internal MCU flash?
Hi all,I am sending a message via USART from STM32F303 (later to be moved from STM32F3 to STM32F427) to an X86.The message consists of 2 parts payload + crc ,CRC is calculated on stm32 using crc hardware engine and calling CRC_CalcCRC/CRC_CalcCRC16bits/CRC_CalcBlockCRC appropriately.I would like to do a crc check for the payload upon receipt by the X86 and validate against CRC available within the packet.So i sourced x86 code authored by Swhite (https://community.st.com/s/question/0D50X00009XkbhnSAB/crc-calculation-in-software), to calculate crc on x86.But the crc computed by stm32 doesn't match the crc computed by this code.A copy of the x86 crc code is attached as a zip.Could someone please tell me how to proceed ?Thanks for the answers and ideas in advance.
I've strange problems with my custom board with microSD card:The same code doesn't work if I run debug build and works well if I flash the realise. It gives error CRC. And the error is the same if I remove the card. It looks like that response did not received from card via MMC or MMC driver. But the same code works in realise build. I'm using CubeIDE 1.4.0 with autogenerated code from CubeMX. And it can work in debug mode if I set 1-bit MMC (4-bit doesn't work). 1 and 4-bit MMC works in release.My code reads one file (config) and writes other one (log) every 5 seconds and goes to standby mode. It works well, but a few hours late no files on SD card... File system is Ok. f_mount() works. But my device shows me that no config file to reading... If I insert Card to PC - it is empty.
Hi.. Geeks From few days I'm playing with SBSFU. I'm using default application SBSFU files (STM32L496G-Discovery_AWS) with custom user application with STM32L496ZG The default code was ported on STM32L496AG which is x-cube AWS I have simply adopted it's default BootloaderOSC files To get synchronized with the original application, I have been change linker script of the user application as per the default app As per the default app,I've been linked out all applications with SBSFU script file and I'm able to generate the .sfb files Now my problem is, when I upload the .sfb file using teraterm YMODEM then SBSU files starts executing and I'm getting logs accordinglyhere is the logs ====================================================================== = (C) COPYRIGHT 2017 STMicroelectronics = = = = Secure Boot and Secure Firmware Update = ====================================================================== = [SBOOT] SECURE ENGINE INITIALIZATION SUCCESSFUL = [SBOOT] STATE:
Hello Experts,I am trying to integrate the "STM32 Cryptographic Library" to my application. The library name is "libSTM32CryptographicV3.1.3_CM4_GCC_ot_fpu.a".How big is the stack size used by this library?When I used the library, RTOS got a hard fault due to stack overflow.your quick help in getting the above library working is very much appreciated.Thanks!Best RegardsT.yama
I am trying to sign and verify messages with the STM32 CryptoLibrary and the ED25519 signing functionality.But the created signature is not the same as the created ED25519 signature created with the CryptoPP library.My code for generating a signature with STM32 CryptoLibrary and ED25519 is this:const uint8_t privateSigningKey[32] = { ... }; char *mbBuffer = "H"; int32_t mbLength = 1; // sign message uint8_t signature[64]; int32_t status = ED25519sign(signature, (uint8_t *) mbBuffer, mbLength, privateSigningKey);This code produces the following signature:a9ac43ecee622060e31f3453224f4bb8af735cf58224caccf2a54a389907098d7c81bb7129292d3b2aac2a5c22a1baa45c218c32edd1e8a68396ca8cf7477307However creating a signature with the CryptoPP library over the string: "H", returns the following signature:A9AC43ECEE622060E31F3453224F4BB8AF735CF58224CACCF2A54A389907098D6BF3939BF052493C635F7DD42196DED2DB3A29D5855E4C27BE0D6F0B705B5806I noticed that in the STM32 CryptoLibrary documentatio
Hi,I could successfully integrate the SBSFU feature to our application. everything goes well until I get a failure after swapping the images.FW signature is not getting verified and function SE_SP_SMUGGLE is returning SE_ERROR which is causing the error. I guess I have missed some signature somewhere. I could not debug further as SE_SP_SMUGGLE function leads to some low level programming.Could anyone help me with this.Thanks,Ankush
..
Hello, I am looking to port one the examples from X-CUBE-SBSFU to get it running on my Nucleo H745ZI-Q. For some background I am very new to the world of STM32 and STM32Cube and I am trying to learn to get this feature running on this nucleo board I am using.I have looked through the document AN5056 and I dont entirely understand what I need to change to get the example running on my nucleo. I started off with trying to follow the steps in AN5056 and UM2262 using the project for NUCLEO-H753ZI in the SBSFU package. I chose this sample project as it seems to be the closest package to my nucleo H745 board.I first added the projects for SECoreBin, SBSFU and UserApp to STM32CubeIDE. I updated the Tamper GPIO pin configuration in sfu_low_level_security.h to TAMPER2 since my board only has 2 tamper pins while the example was using 3. Then built all 3 of the projects in STM32CubeIDE. Following that I successfully downloaded the binary for SBSFU to my nucleo using STM32CubeProgrammer. After pow
Hi, I want to do some AES128 evaluation, I need a discovery board, no need other function,What is the recommend(simple and cheap) discovery board? Thanks a lot.Ken
I'm in the process of integrating the SBSFU into a project.I got stuck when the decryption process seemed to hang.After I got the SeCoreBin symbols loaded I realized that it was waiting for CPU2 to become active (specifically while waiting for FLAG_WAIT_CPU2_RDY to be set to 0)To make sure the FUS version was up to date I flashed a known-working application firmware and used it to read the FUS version (which is 1.1.0). But I noticed that I had to call SHCI_C2_FUS_GetState(..) twice, which means that the wireless firmware was running on CPU2.Is it a problem for SBSFU when the wireless stack is running on CPU2? If not, what could cause shci_notify_asynch_evt not being called?A deadlock here would mean a bricked product, which is of course not acceptable.Thanks in advance!
I'm working with an STM32F04, and I'd like to change the option bytes so that my firmware can't be read back out after the device is programmed. I can tell from documentation I need to set the RDP byte to something besides 0xAA or 0xCC, but there isn't much about how to do this from the IDE.Is there an option or a file I can edit in the STM32CubeIDE to modify the byte once my firmware is programmed?Thank you!
I am trying to setup the RDP programmatically on the STM32H7. I am running the code below. All functions return HAL_OK except HAL_FLASH_OB_Launch() which returns HAL_ERROR and its unclear to me why. Any ideas on how to debug this will be helpful as well.int main(void) { /* MCU Configuration */ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ MX_RTC_Init(); int err = 0; if ( HAL_FLASH_Unlock() != HAL_OK ) { err = 1 } if ( HAL_FLASH_OB_Unlock() != HAL_OK ) { err = 1} FLASH_OBProgramInitTypeDef ob_struct = {0}; // RDP on Flash bank 2 ob_struct.Banks = FLASH_BANK_2; ob_struct.OptionType = OPTIONBYTE_RDP; ob_struct.RDPLevel = OB_RDP_LEVEL_1; // Program options bytes HAL_FLASHEx_OBProgram(&ob_struct); if ( HAL_FLASH_OB_Launch() != HAL_OK) { err = 1 } // Lock memory HAL_FLASH_OB_Lock(); HAL_FLASH_Lock(); /* USER CODE END Init */
Hello people,I am trying to integrate the xcube sbsfu feature to our application and everything went well but there is an issue while sending the .sfb via ymodem. It starts downloading the firmware and after receiving 2 packets (4.9%), it stops downloading (see attached picture) and throws the below errors. -- -- !!Aborted by user!! -- !!Operation failed!!When I debugged the code, I found the problem is coming from the below code__HAL_UART_GET_FLAG(huart, Flag) ? SET : RESETI guess the system is setting this to RESET and HAL_timeout is getting returned. May be because of huart->Instance->ISR or FLAG.Could anyone please let me know what changes are required to successfully download the firmware on microcontroller (STM32L452).Is this because of timer settings or timing mismatch?Note : I still have to figure out how to generate .sfb file for our application. For now, I am trying the download the .sfb from the example project (STM32L476RG)I am using the sbsfu features of ST
I'm trying to build the SECoreBIn, and have changed the key (OEM_COMPANY_1) in:STM32CubeExpansion_SBSFU_V2.3.0/Projects/NUCLEO-G071RB/Applications/2_Images/2_Images_SECoreBin/Binary/OEM_KEY_COMPANY1_key_AES_CBC.binIf I have understood correctly from the Getting strated guilde, this is the symetric AES key used to encrypt the binary in the postscript.sh later.However, when I try to buld the SECoreBin, I am getting the following error from the python prepareimage.py script:21:38:49 **** Incremental Build of configuration Debug for project NUCLEO-G071RB_2_Images_SECoreBin **** make all "../../prebuild2.sh" "../.." ../.. Python 3.7.5 prepareimage with python script python /Users/Development/AgileProject/G0_SBSFU/STM32CubeExpansion_SBSFU_V2.3.0/Middlewares/ST/STM32_Secure_Engine/Utilities/KeysAndImages/prepareimage.py conf ../../../Inc/se_crypto_config.h SECBOOT_ECCDSA_WITH_AES128_CBC_SHA256 selected ECCDSA_WITH_AES128_CBC_SHA256 python /Users/Development/AgileProject/G0_SBSFU/STM32CubeExp
Hi,I'm trying to port SBSFU example (L476 Nucleo) to L475 MCU for a custom board. My user app works fine without the SBSFU but when I combine them the clock breaks and HAL_Delay gets stuck. The UserApp of the example project however works fine. I have tried the following:Compared the clock settings in both of them (in stm32l4xx_hal_conf.h) and all the settings are the same (the SysTickPriority in the example is 0x0F which I changed to 0x0 to be like mine and it works fine). All the arguments and parameters of SysTick_Config() is the same for both cases however in the provided example I cannot watch the SysTick in eclipse expressions, it says "No symbol "SysTick" in current context."Increased all NVIC priorities so to higher than 1 and the systick to 1 and it did not make any difference.In the hal_conf.h of the example all the peripheral callback registers are set to zero using defines such as `#define USE_HAL_ADC_REGISTER_CALLBACKS 0U`. My code doesn't have anything like that but since
Can we insert the Pre-build CRC32 calculation in the elf file before creating the elf file under the System Workbench . Currently I am doing it using Post Build and it is not possible to Debug the Source Code if the CRC does not match .
At the debug mode I would not like to provide .elf file , as the generated elf file does not have CRC that is generated .In STM system workbench I use post build command to generate .bin file and than I use srec-cat script to generate CRC on this .bin file at end of post build process I get .bin+CRC from my project.at this point I want to load into the controller file generated post build .bin+CRC file , and not .elf file as elf file does not have the CRC for the file content in it.Can we load .bin file in place of .elf file for debug purposes in the system workbench for stm32 , I do not need break points , I know I can load the same file using j_flash utility but I want this process with system workbench
My question is about intellectual property theft at CMs. Clearly ST recognizes the issue and even addresses it by adding SFI (secure internal firmware install) on some microcontrollers. AN5054 is listed in the resources for STM32L010K4; however, it is my understanding that STM32L0s lack SFI/SFIx features (as described in Table1 of DM003555688). Also, Datasheet - STM32L010F4 STM32L010K4 does not refer to SFI.What can be done for STM32L010K4?Thank you
As well as for TFM case, some IT tools remove exe files.The SBSFU is using:c:\STM32SecuWS\L4\STM32CubeExpansion_SBSFU_V2.3.0\Middlewares\ST\STM32_Secure_Engine\Utilities\KeysAndImages\win\prepareimage\prepareimage.exeIf this file was removed, please rename win directory to another one.Then install python 3.7go to :c:\STM32SecuWS\L4\STM32CubeExpansion_SBSFU_V2.3.0\Middlewares\ST\STM32_Secure_Engine\Utilities\KeysAndImages\and launch: pip3 install -r requirements.txtThe file requirements.txt already exists and contains:pycryptodomepycryptodomexecdsapyelftoolsnumpy Internet access is needed to process pip command.Nothing else is needed. During build process the python script will automatically be selected.Best regardsJocelyn
Sometimes, the windows exe file are not recognized as valid programs by internal IT tools.The TFM uses windows exe file to build the image signature.A way to solve this you need to use python:Install python 3.7Create a requirements.txt file containing:cryptography pyasn1pyyamljinja2The launch in a command line:pip3 install -r requirementsThis will install the necessary modules. You need an external access to be able to do this.One this is done, you need to editc:\STM32SecuWS\TFM\STM32Cube_FW_L5_V1.2.0\Projects\NUCLEO-L552ZE-Q\Applications\TFM_for_WS\TFM_Appli\STM32CubeIDE\postbuild.shand from line 23 to 33 you should have:#line for window executeable#echo Postbuild with windows executable#imgtool=$basedir"/scripts/dist/imgtool/imgtool.exe"#assemble=$basedir"/scripts/dist/assemble/assemble.exe"#cmd=""#line for pythonecho Postbuild with python scriptimgtool=$basedir"/scripts/imgtool.py"assemble=$basedir"/scripts/assemble.py"cmd="python"Be careful, a tipo in original file on imgtool.
in my invitation it's said, that the introduction starts at 8:30I can't join (8:50) and get following message:Sobald die Besprechung beginnt, geben wir den Personen Bescheid, dass Sie warten.Wenn Sie der Organisator sind oder die Einladung von Ihrer Arbeit oder Schule kam, bitteanmelden.
Hello,I have not received yet the board. Can I join in the workshop anyway? Why did you send the email for filling the form only 2 days before the workshop?
Hello,I’ve registered more than 2 weeks ago but haven’t received the HW yet. The workshop is supposed to be tomorrow.Can you tell me, when the board is delivered?Is it possible to switch to the workshop on 9th of July?Best regardsChristian Amberg
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.