2021-03-02 12:13 AM
I'm trying to build the SBSFU project for board STM32H7B3I-DK (2_Images_ExtFlash) but am unable to. Everything does build fine but it fails on the last step, the postbuild.sh step, at prepareimage.py enc.
I'm using STM32CubeIDE 1.5.1 on Linux
This is the error I get:
arm-none-eabi-objcopy -O binary "UserApp.elf" "../../UserApp.bin"
arm-none-eabi-size "UserApp.elf"
text data bss dec hex filename
19680 160 2856 22696 58a8 UserApp.elf
"../../../../2_Images_SECoreBin/STM32CubeIDE/postbuild.sh" "../.." "./UserApp.elf" "../../UserApp.bin" "1" "1"
prepareimage with python script
Traceback (most recent call last):
File "STM32CubeExpansion_SBSFU_V2.4.0/Middlewares/ST/STM32_Secure_Engine/Utilities/KeysAndImages/prepareimage.py", line 861, in <module>
args()
File "STM32CubeExpansion_SBSFU_V2.4.0/Middlewares/ST/STM32_Secure_Engine/Utilities/KeysAndImages/prepareimage.py", line 858, in args
subcmds[args.subcmd](args)
File "STM32CubeExpansion_SBSFU_V2.4.0/Middlewares/ST/STM32_Secure_Engine/Utilities/KeysAndImages/prepareimage.py", line 150, in do_encrypt
encrypted , signature , nonce_used = key.encrypt(payload, address, nonce)
File "STM32CubeExpansion_SBSFU_V2.4.0/Middlewares/ST/STM32_Secure_Engine/Utilities/KeysAndImages/keys.py", line 102, in encrypt
inarr = numpy.asarray(list(payload), numpy.int8).reshape(-1, 16)
File "/usr/local/lib/python2.7/dist-packages/numpy/core/numeric.py", line 538, in asarray
return array(a, dtype, copy=False, order=order)
ValueError: invalid literal for long() with base 10: ''
python STM32CubeExpansion_SBSFU_V2.4.0/Middlewares/ST/STM32_Secure_Engine/Utilities/KeysAndImages/prepareimage.py enc -k ../../../../2_Images_SECoreBin/STM32CubeIDE/../Binary/OEM_KEY_COMPANY1_key_AES_CTR.bin -n ../../../../2_Images_SECoreBin/STM32CubeIDE/../Binary/nonce.bin -a 0x09000040 ../../UserApp.bin ../../../Binary/UserApp.sfu : failed
make[1]: *** [makefile:90: post-build] Error 1
make: *** [makefile:56: all] Error 2
"make all" terminated with exit code 2. Build might be incomplete.
(some paths truncated)
There is no nonce.bin in Projects/STM32H7B3I-DK/Applications/2_Images_ExtFlash/2_Images_SECoreBin/Binary but after adding the one from 2_Images (without ExtFlash) I get the same error.
Best regards,
Arno
2021-03-12 02:31 AM
Hello Arno,
I tried to reproduce the issue on a Ubuntu 16.04 LTS with same version of STM32CubeIDE.
I could see 2 issued while building the loader:
1- Need to change '\' by '/' in the ld file path in the properties
2- Need to activate the VFP also in properties
After that all when well until UserApp build.
One possible reason for your issue is the too long path where the package is installed.
Best regards
Jocelyn