cancel
Showing results for 
Search instead for 
Did you mean: 

I am trying to build the STM32 X-CUBE SBSFU Package , I am able to build the 2_Images_SECoreBin and 2_Images_SBSFU Package, But Not able to build the 2_Images_UserApp.

wasi785
Associate II

Following Error Occurs

11:12:01 **** Incremental Build of configuration Debug for project STM32F769I_Discovery_2_Images_UserApp ****

make -j8 all 

arm-none-eabi-gcc -z max-page-size=1 -o "UserApp.elf" @"objects.list" ../../../../2_Images_SBSFU/SW4STM32/STM32F769I_Discovery_2_Images_SBSFU/Debug/se_interface_app.o -mcpu=cortex-m7 -T"../STM32F769NIHx.ld" --specs=nosys.specs -Wl,-Map="UserApp.map" -Wl,--gc-sections -static -Xlinker -L ../../../../Linker_Common/SW4STM32 --specs=nano.specs -mfpu=fpv5-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group

Finished building target: UserApp.elf

arm-none-eabi-size  UserApp.elf 

arm-none-eabi-objdump -h -S UserApp.elf > "UserApp.list"

arm-none-eabi-objcopy -O binary UserApp.elf "UserApp.bin"

  text   data   bss   dec   hex filename

 21536   208   6040  27784   6c88 UserApp.elf

Finished building: default.size.stdout

Finished building: UserApp.bin

Finished building: UserApp.list

arm-none-eabi-objcopy -O binary "UserApp.elf" "../../UserApp.bin"

arm-none-eabi-size "UserApp.elf"

  text   data   bss   dec   hex filename

 21536   208   6040  27784   6c88 UserApp.elf

"../../../../2_Images_SECoreBin/SW4STM32/postbuild.sh" "../.." "./UserApp.elf" "../../UserApp.bin" "1" "1"

prepareimage with windows executable

[6020] Failed to execute script prepareimage

Traceback (most recent call last):

 File "prepareimage.py", line 966, in <module>

 File "prepareimage.py", line 963, in args

 File "prepareimage.py", line 124, in do_encrypt

 File "keys.py", line 262, in load

FileNotFoundError: [Errno 2] No such file or directory: '../../../../2_Images_SECoreBin/SW4STM32/../Binary/OEM_KEY_COMPANY1_key_AES_CBC.bin'

../../../../2_Images_SECoreBin/SW4STM32/postbuild.sh: line 74: prepareimage.exe: No error

prepareimage.exe enc -k ../../../../2_Images_SECoreBin/SW4STM32/../Binary/OEM_KEY_COMPANY1_key_AES_CBC.bin -i ../../../../2_Images_SECoreBin/SW4STM32/../Binary/iv.bin ../../UserApp.bin ../../../Binary/UserApp.sfu : failed

make[1]: *** [makefile:97: post-build] Error 1

make: *** [makefile:63: all] Error 2

"make -j8 all" terminated with exit code 2. Build might be incomplete.

11:12:07 Build Failed. 2 errors, 0 warnings. (took 6s.448ms)

5 REPLIES 5
Arno1
Senior

I assume you've already checked if the file

[...]/STM32CubeExpansion_SBSFU_V2.5.0/Projects/STM32F769I-Discovery/Applications/2_Images/2_Images_SECoreBin/Binary/OEM_KEY_COMPANY1_key_AES_CBC.bin

exists and is readable?

Arno1
Senior

I also see in this line

prepareimage.exe enc -k ../../../../2_Images_SECoreBin/SW4STM32/../Binary/OEM_KEY_COMPANY1_key_AES_CBC.bin -i ../../../../2_Images_SECoreBin/SW4STM32/../Binary/iv.bin ../../UserApp.bin ../../../Binary/UserApp.sfu : failed

that it refers to iv.bin and there is no iv.bin. I believe I've run into this issue before and ended up using an iv.bin from another project, simply placing it in the Binary directory.

I suppose they meant to use the nonce.bin and to fix that, you would need to change your postbuild.sh script (SECBOOT_ECCDSA_WITH_AES128_CBC_SHA256.sh) to use the nonce instead of the iv (thus changing the -i to -n in the prepareimage calls with the path to the nonce)

Guillaume K
ST Employee

Hello

Are you using STM32CubeIDE ? which version ? which platform (Windows/Linux/Mac) ?

wasi785
Associate II

Hi Arno, Thanks for your reply, I checked the iv.bin in other projects and used the same still facing the same issue ,But I am not able to locate the UserApp.sfu file in Binary Folder.

16:46:27 **** Incremental Build of configuration Debug for project STM32F769I_Discovery_2_Images_UserApp ****

make -j8 all 

arm-none-eabi-gcc -z max-page-size=1 -o "UserApp.elf" @"objects.list" ../../../../2_Images_SBSFU/SW4STM32/STM32F769I_Discovery_2_Images_SBSFU/Debug/se_interface_app.o -mcpu=cortex-m7 -T"../STM32F769NIHx.ld" --specs=nosys.specs -Wl,-Map="UserApp.map" -Wl,--gc-sections -static -Xlinker -L ../../../../Linker_Common/SW4STM32 --specs=nano.specs -mfpu=fpv5-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group

Finished building target: UserApp.elf

arm-none-eabi-size  UserApp.elf 

arm-none-eabi-objdump -h -S UserApp.elf > "UserApp.list"

arm-none-eabi-objcopy -O binary UserApp.elf "UserApp.bin"

  text   data   bss   dec   hex filename

 21536   208   6040  27784   6c88 UserApp.elf

Finished building: default.size.stdout

Finished building: UserApp.list

Finished building: UserApp.bin

arm-none-eabi-objcopy -O binary "UserApp.elf" "../../UserApp.bin"

arm-none-eabi-size "UserApp.elf"

  text   data   bss   dec   hex filename

 21536   208   6040  27784   6c88 UserApp.elf

"../../../../2_Images_SECoreBin/SW4STM32/postbuild.sh" "../.." "./UserApp.elf" "../../UserApp.bin" "1" "1"

prepareimage with windows executable

[14540] Failed to execute script prepareimage

Traceback (most recent call last):

 File "prepareimage.py", line 966, in <module>

 File "prepareimage.py", line 963, in args

 File "prepareimage.py", line 124, in do_encrypt

 File "keys.py", line 262, in load

FileNotFoundError: [Errno 2] No such file or directory: '../../../../2_Images_SECoreBin/SW4STM32/../Binary/OEM_KEY_COMPANY1_key_AES_CBC.bin'

../../../../2_Images_SECoreBin/SW4STM32/postbuild.sh: line 74: prepareimage.exe: No error

prepareimage.exe enc -k ../../../../2_Images_SECoreBin/SW4STM32/../Binary/OEM_KEY_COMPANY1_key_AES_CBC.bin -i ../../../../2_Images_SECoreBin/SW4STM32/../Binary/iv.bin ../../UserApp.bin ../../../Binary/UserApp.sfu : failed

make[1]: *** [makefile:97: post-build] Error 1

make: *** [makefile:63: all] Error 2

"make -j8 all" terminated with exit code 2. Build might be incomplete.

16:46:40 Build Failed. 2 errors, 0 warnings. (took 13s.163ms)

Yes I am using STM32CubeIDE

Version: 1.6.1

Build: 9958_20210326_1446 (UTC)

Platform/OS: Windows 10 Enterprise