2021-03-09 02:28 AM
I have the nucleo l152RE board and am trying to use this for following the mooc on sbsfu. It is possible for me to build (in cube IDE) both SECoreBin and SBSFU images. however, when building the UserApp it fails on the postbuild script. During build, I can see the UserApp.elf being created and showing up in my file explorer, but when the post-build script fails, the .elf file is also removed from my system.
According to the build output, the file "OEM_KEY_COMPANY1_key_AES_CBC.bin" can not be found, but I can see it in my directory structure.
I have the following build output:
11:19:33 **** Incremental Build of configuration Debug for project NUCLEO-L152RE_2_Images_UserApp ****
make all
arm-none-eabi-gcc -z max-page-size=1 -o "UserApp.elf" @"objects.list" -l:se_interface_app.o -mcpu=cortex-m3 -T"../STM32L152RETx.ld" --specs=nosys.specs -Wl,-Map="NUCLEO-L152RE_2_Images_UserApp.map" -Wl,--gc-sections -static -L../../../../2_Images_SBSFU/SW4STM32/NUCLEO-L152RE_2_Images_SBSFU/Debug -Xlinker -L ../../../../Linker_Common/SW4STM32 --specs=nano.specs -mfloat-abi=soft -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
Finished building target: UserApp.elf
arm-none-eabi-size UserApp.elf
text data bss dec hex filename
18240 144 5920 24304 5ef0 UserApp.elf
Finished building: default.size.stdout
arm-none-eabi-objdump -h -S UserApp.elf > "UserApp.list"
Finished building: UserApp.list
arm-none-eabi-objcopy -O binary UserApp.elf "UserApp.bin"
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
18240 144 5920 24304 5ef0 UserApp.elf
"../../../../2_Images_SECoreBin/SW4STM32/postbuild.sh" "../.." "./UserApp.elf" "../../UserApp.bin" "1" "1"
prepareimage with windows executable
[23428] Failed to execute script prepareimage
Traceback (most recent call last):
File "prepareimage.py", line 861, in <module>
File "prepareimage.py", line 858, 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 70: 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:85: post-build] Error 1
make: *** [makefile:51: all] Error 2
"make all" terminated with exit code 2. Build might be incomplete.
11:19:49 Build Failed. 2 errors, 0 warnings. (took 15s.343ms)
2021-03-09 05:11 AM
Hi,
I just tried the compilation but couldn't reproduce your issue.
Could you try extracting again the whole L1 project from the zip file, import the project in new workspace and compile?
Also, if you go in directory with command line
Projects\NUCLEO-L152RE\Applications\2_Images\2_Images_UserApp\SW4STM32\NUCLEO-L152RE_2_Images_UserApp\Debug
and type
dir ..\..\..\..\2_Images_SECoreBin\SW4STM32\..\Binary\OEM_KEY_COMPANY1_key_AES_CBC.bin
Does it display the file?
Best regards
Jocelyn
2021-03-09 06:48 AM
hi Jocelyn
I tried unzipping the file again and put it in the Downloads folder (as I did before). This gave the same error as before.
The next thing I tried was putting it inside C:\STM32SecuWS\L4 (like it was done in the course), then it ran succesfully. Maybe the path is too long when putting it inside the downloads directory?
Before I did this, I tried to type the dir command from the debug folder and it displayed the file correctly.
2021-03-09 08:55 AM
Hi,
yes this long path could also be the issue.
This is an issue that comes regularly but I forgot about it this time :)
Good to see you solve the issue anyway
Best regards
Jocelyn