Skip to main content
BWawr
Associate
October 16, 2018
Question

X-cube sbsfu with atollic truestudio

  • October 16, 2018
  • 1 reply
  • 595 views

Hi guys,

I’m new with x-cube sbsfu package and I have some troubles with running the example on stm32l476. I saw the stm manual for getting started etc but it didn’t work for me. Can anyone explain how to import properly project into workspace in Atollic and what should I do next in steps? I know that example is for sw4stm32 but it should also work in atollic, so please give me some tips how to properly run this on stm32l476. I didn’t have any problems with other stm32 packages but this one is hard one for me to run.

Best regards

    This topic has been closed for replies.

    1 reply

    Bill1
    Visitor II
    April 12, 2019
    1. Even I modify the includes-directory , add the library Paths under Project>>Properties>>C/CC General>>Paths and Symbols to make it compile successfully for STM32L476RG 2 Images SECoreBin, I found there is no Pre-build and Post-build steps integrated in this TrueStudio IDE.

    (I use the SW4STM32 converted by TrueSTUDIO)

    1. I try to put the Post-build to ask it generate the bin file from ELF manually, and it seems ok.
    10:20:34 **** Incremental Build of configuration Debug for project STM32L476RG_NUCLEO_2_Images_SECoreBin ****
    Info: Internal Builder is used for build
    arm-atollic-eabi-gcc -c -mthumb -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -g -Wa,--warn -x assembler-with-cpp -specs=nano.specs -o Application\User\se_key.o ..\..\se_key.s 
    arm-atollic-eabi-gcc -c ..\..\..\..\..\..\..\..\Middlewares\ST\STM32_Secure_Engine\Core\se_crypto_common.c -mthumb -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -std=gnu11 -DSTM32L476xx -DUSE_HAL_DRIVER -DUSE_STM32L4XX_NUCLEO 
    ....(I remove the long log here)
    Generate build reports...
    Print size information
     text	 data	 bss	 dec	 hex	filename
     18386	 80	 2616	 21082	 525a	SECoreBin.elf
    Print size information done
    Generate listing file
    Output sent to: SECoreBin.list
    Generate listing file done
    Generate build reports done
    arm-atollic-eabi-objcopy -O binary SECoreBin.elf SECoreBin.bin 
     
    10:20:40 Build Finished (took 5s.867ms)

    1. But after I try to put the prebuild.bat under Project>>Properties>>C/C++ Build>>Settings>>Build Steps which I also provide the directory path to it manually , I still get error about Assembler error messages for se_key.s as follow (either windows executable or python method) when I rebuild this SECoreBin project:

    note: I copy the prebuild.bat and SECBOOT_AES128_GCM_AES128_GCM_AES128_GCM.bat from \2_Images_SECoreBin\MDK-ARM to \2_Images_SECoreBin\SW4STM32

    =======================================================================

    10:56:34 **** Rebuild of configuration Debug for project STM32L476RG_NUCLEO_2_Images_SECoreBin ****
    Info: Internal Builder is used for build
    prebuild.bat C:\X-CUBE-SBSFU_V2.1.0\Projects\NUCLEO-L476RG\Applications\2_Images\2_Images_SECoreBin\SW4STM32\ 
    Prebuild with windows executable
    複製了 1 個檔案。
    arm-atollic-eabi-gcc -c ..\..\data_init.c -mthumb -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -std=gnu11 -DSTM32L476xx -DUSE_HAL_DRIVER -DUSE_STM32L4XX_NUCLEO -IC:\X-CUBE-SBSFU_V2.1.0\Projects\NUCLEO-L476RG\Applications\2_Images\Linker_Common\SW4STM32 -I../../../Inc -I../../../../../../../../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../../../../../../../../Drivers/STM32L4xx_HAL_Driver/Inc -I../../../../../../../../Drivers/BSP/STM32L4xx_Nucleo -I../../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../../Middlewares/ST/STM32_Cryptographic/Fw_Crypto/STM32L4/Inc -I../../../../../../../../Middlewares/ST/STM32_Secure_Engine/Core -I../../../../../../../../Middlewares/ST/STM32_Secure_Engine/Key -I../../../../../../../../Drivers/CMSIS/Include -IC:\X-CUBE-SBSFU_V2.1.0\Projects\NUCLEO-L476RG\Applications\2_Images\2_Images_SECoreBin\Inc -IC:\X-CUBE-SBSFU_V2.1.0\Projects\NUCLEO-L476RG\Applications\2_Images\2_Images_SBSFU\SBSFU\App -Os -ffunction-sections -g3 -fstack-usage -Wall -fmessage-length=0 -Wno-strict-aliasing -specs=nano.specs -o Application\SW4STM32\data_init.o 
    arm-atollic-eabi-gcc -c ..\..\..\Src\se_crypto_bootloader.c -mthumb -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -std=gnu11 -DSTM32L476xx -DUSE_HAL_DRIVER -DUSE_STM32L4XX_NUCLEO -IC:\X-CUBE-SBSFU_V2.1.0\Projects\NUCLEO-L476RG\Applications\2_Images\Linker_Common\SW4STM32 -I../../../Inc -I../../../../../../../../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../../../../../../../../Drivers/STM32L4xx_HAL_Driver/Inc -I../../../../../../../../Drivers/BSP/STM32L4xx_Nucleo -I../../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../../Middlewares/ST/STM32_Cryptographic/Fw_Crypto/STM32L4/Inc -I../../../../../../../../Middlewares/ST/STM32_Secure_Engine/Core -I../../../../../../../../Middlewares/ST/STM32_Secure_Engine/Key -I../../../../../../../../Drivers/CMSIS/Include -IC:\X-CUBE-SBSFU_V2.1.0\Projects\NUCLEO-L476RG\Applications\2_Images\2_Images_SECoreBin\Inc -IC:\X-CUBE-SBSFU_V2.1.0\Projects\NUCLEO-L476RG\Applications\2_Images\2_Images_SBSFU\SBSFU\App -Os -ffunction-sections -g3 -fstack-usage -Wall -fmessage-length=0 -Wno-strict-aliasing -specs=nano.specs -o Application\User\se_crypto_bootloader.o 
    arm-atollic-eabi-gcc -c -mthumb -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -g -Wa,--warn -x assembler-with-cpp -specs=nano.specs -o Middlewares\STM32_Secure_Engine\se_stack_smuggler_GNU.o ..\..\..\..\..\..\..\..\Middlewares\ST\STM32_Secure_Engine\Core\se_stack_smuggler_GNU.s 
    arm-atollic-eabi-gcc -c -mthumb -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -g -Wa,--warn -x assembler-with-cpp -specs=nano.specs -o Application\User\se_key.o ..\..\se_key.s 
    ..\..\se_key.s: Assembler messages:
    ..\..\se_key.s:1: Error: bad instruction `area |.SE_Key_Data|,CODE'
    ..\..\se_key.s:2: Error: bad instruction `export SE_ReadKey'
    ..\..\se_key.s:3: Error: bad instruction `se_readkey'
    ..\..\se_key.s:13: Warning: this instruction will write back the base register
    ..\..\se_key.s:17: Error: bad instruction `export SE_ReadKey_Pub'
    ..\..\se_key.s:18: Error: bad instruction `se_readkey_pub'
    ..\..\se_key.s:28: Warning: this instruction will write back the base register
    ..\..\se_key.s:38: Warning: this instruction will write back the base register
    ..\..\se_key.s:48: Warning: this instruction will write back the base register
    ..\..\se_key.s:58: Warning: this instruction will write back the base register
    ..\..\se_key.s:61: Error: bad instruction `end'
     
    10:56:37 Build Finished (took 2s.976ms)

    What 's going on ???

    compiler settings issue from TrueSTUDIO or ... anything missed to configure ?