After successful compilation I tried to provision B-U585I-IOT02A board following the steps described here: STM32U5 provisioninghttps://trustedfirmware-m.readthedocs.io/en/latest/platform/stm/common/stm32u5xx/readme.html#write-software-on-target. Process did not succeed due to the errors described below. What am I missing?
postbuild.sh results in: Thomas@AMDMINIATX MINGW64 /c/Temp/tf-m/trusted-firmware-m/platform/ext/target/stm/common/scripts (main) $ ./postbuild.sh ./postbuild.sh: line 22: /c/Temp/tf-m/trusted-firmware-m/platform/ext/target/stm/common/scripts/preprocess.sh: No such file or directory preprocess bl2 file ./postbuild.sh: line 36: preprocess: command not found C:\Python312\python.exe: can't open file 'C:\Temp\tf-m\trusted-firmware-m\platform\ext\target\stm\common\scripts\scripts\stm_tool.py': [Errno 2] No such file or directory postbuild.sh failed
There are 3 versions of preprocess.sh script, it is compiler specific.
TFM_UPDATE.sh has some syntax errors which reveal themselves under GitBash Thomas@AMDMINIATX MINGW64 /c/Temp/tf-m/trusted-firmware-m/platform/ext/target/stm/common/scripts (main) $ ./TFM_UPDATE.sh TFM UPDATE started ./TFM_UPDATE.sh: line 52: [: ==: unary operator expected ./TFM_UPDATE.sh: line 56: [: ==: unary operator expected ./TFM_UPDATE.sh: line 59: [: ==: unary operator expected
These are easy to fix. Eg. if [ $encrypted == "0x1" ]; then -> if [ "$encrypted" == "0x1" ]; then
It looks postbuild.sh and TFM_UPDATE.sh take two additional parameters which are not documented. regression.sh takes one undocumented parameter.
After successful compilation I tried to provision B-U585I-IOT02A board following the steps described here: STM32U5 provisioning https://trustedfirmware-m.readthedocs.io/en/latest/platform/stm/common/stm3 2u5xx/readme.html#write-software-on-target .
Process did not succeed due to the errors described below.
What am I missing?
postbuild.sh results in:
Thomas@AMDMINIATX MINGW64 /c/Temp/tf-m/trusted-firmware-m/platform/ext/target/stm/common/scripts (main)
$ ./postbuild.sh
./postbuild.sh: line 22: /c/Temp/tf-m/trusted-firmware-m/platform/ext/target/stm/common/scripts/prepr ocess.sh: No such file or directory
preprocess bl2 file
./postbuild.sh: line 36: preprocess: command not found
C:\Python312\python.exe: can't open file 'C:\Temp\tf-m\trusted-firmware-m\platform\ext\target\stm\common\scr ipts\scripts\stm_tool.py': [Errno 2] No such file or directory
postbuild.sh failed
There are 3 versions of preprocess.sh script, it is compiler specific.
TFM_UPDATE.sh has some syntax errors which reveal themselves under GitBash
Thomas@AMDMINIATX MINGW64 /c/Temp/tf-m/trusted-firmware-m/platform/ext/target/stm/common/scripts (main)
$ ./TFM_UPDATE.sh
TFM UPDATE started
./TFM_UPDATE.sh: line 52: [: ==: unary operator expected
./TFM_UPDATE.sh: line 56: [: ==: unary operator expected
./TFM_UPDATE.sh: line 59: [: ==: unary operator expected
These are easy to fix. Eg. if [ $encrypted == "0x1" ]; then -> if [ "$encrypted" == "0x1" ]; then
It looks postbuild.sh and TFM_UPDATE.sh take two additional parameters which are not documented.
regression.sh takes one undocumented parameter.
Hi Tomasz,
from what I can understand from the below I think you're running the scripts from the wrong directory (i.e. /c/Temp/tf-m/trusted-firmware-m/platform/ext/target/stm/common/scripts) while instead they should be run from the `api_ns` directory inside the secure build directory. Regarding the syntax errors below I am not really sure, they probably look like a genuine issue but as this is all specific to STM32, somebody from ST should comment.
Thanks, Antonio
________________________________ From: Tomasz Jastrzębski via TF-M tf-m@lists.trustedfirmware.org Sent: Wednesday, January 24, 2024 23:53 To: tf-m@lists.trustedfirmware.org tf-m@lists.trustedfirmware.org Subject: [TF-M] STM32 target provisioning difficulties
After successful compilation I tried to provision B-U585I-IOT02A board following the steps described here: STM32U5 provisioninghttps://trustedfirmware-m.readthedocs.io/en/latest/platform/stm/common/stm32u5xx/readme.html#write-software-on-target.
Process did not succeed due to the errors described below.
What am I missing?
postbuild.sh results in:
Thomas@AMDMINIATX MINGW64 /c/Temp/tf-m/trusted-firmware-m/platform/ext/target/stm/common/scripts (main)
$ ./postbuild.sh
./postbuild.sh: line 22: /c/Temp/tf-m/trusted-firmware-m/platform/ext/target/stm/common/scripts/preprocess.sh: No such file or directory
preprocess bl2 file
./postbuild.sh: line 36: preprocess: command not found
C:\Python312\python.exe: can't open file 'C:\Temp\tf-m\trusted-firmware-m\platform\ext\target\stm\common\scripts\scripts\stm_tool.py': [Errno 2] No such file or directory
postbuild.sh failed
There are 3 versions of preprocess.sh script, it is compiler specific.
TFM_UPDATE.sh has some syntax errors which reveal themselves under GitBash
Thomas@AMDMINIATX MINGW64 /c/Temp/tf-m/trusted-firmware-m/platform/ext/target/stm/common/scripts (main)
$ ./TFM_UPDATE.sh
TFM UPDATE started
./TFM_UPDATE.sh: line 52: [: ==: unary operator expected
./TFM_UPDATE.sh: line 56: [: ==: unary operator expected
./TFM_UPDATE.sh: line 59: [: ==: unary operator expected
These are easy to fix. Eg. if [ $encrypted == "0x1" ]; then -> if [ "$encrypted" == "0x1" ]; then
It looks postbuild.sh and TFM_UPDATE.sh take two additional parameters which are not documented.
regression.sh takes one undocumented parameter.
[cid:image001.png@01DA4F7C.1778C260]
Hello Tomasz,
Yes exactly, should you run the scripts form this directory (C:....\build_s\api_ns).
Best regards.
ST Restricted From: Antonio De Angelis via TF-M tf-m@lists.trustedfirmware.org Sent: Thursday, January 25, 2024 10:29 AM To: tf-m@lists.trustedfirmware.org; Tomasz Jastrzębski tdjastrzebski@wp.pl Subject: [TF-M] Re: STM32 target provisioning difficulties
Hi Tomasz,
from what I can understand from the below I think you're running the scripts from the wrong directory (i.e. /c/Temp/tf-m/trusted-firmware-m/platform/ext/target/stm/common/scripts) while instead they should be run from the `api_ns` directory inside the secure build directory. Regarding the syntax errors below I am not really sure, they probably look like a genuine issue but as this is all specific to STM32, somebody from ST should comment.
Thanks, Antonio
________________________________ From: Tomasz Jastrzębski via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: Wednesday, January 24, 2024 23:53 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: [TF-M] STM32 target provisioning difficulties
After successful compilation I tried to provision B-U585I-IOT02A board following the steps described here: STM32U5 provisioninghttps://trustedfirmware-m.readthedocs.io/en/latest/platform/stm/common/stm32u5xx/readme.html#write-software-on-target.
Process did not succeed due to the errors described below.
What am I missing?
postbuild.sh results in:
Thomas@AMDMINIATX MINGW64 /c/Temp/tf-m/trusted-firmware-m/platform/ext/target/stm/common/scripts (main)
$ ./postbuild.sh
./postbuild.sh: line 22: /c/Temp/tf-m/trusted-firmware-m/platform/ext/target/stm/common/scripts/preprocess.sh: No such file or directory
preprocess bl2 file
./postbuild.sh: line 36: preprocess: command not found
C:\Python312\python.exe: can't open file 'C:\Temp\tf-m\trusted-firmware-m\platform\ext\target\stm\common\scripts\scripts\stm_tool.py': [Errno 2] No such file or directory
postbuild.sh failed
There are 3 versions of preprocess.sh script, it is compiler specific.
TFM_UPDATE.sh has some syntax errors which reveal themselves under GitBash
Thomas@AMDMINIATX MINGW64 /c/Temp/tf-m/trusted-firmware-m/platform/ext/target/stm/common/scripts (main)
$ ./TFM_UPDATE.sh
TFM UPDATE started
./TFM_UPDATE.sh: line 52: [: ==: unary operator expected
./TFM_UPDATE.sh: line 56: [: ==: unary operator expected
./TFM_UPDATE.sh: line 59: [: ==: unary operator expected
These are easy to fix. Eg. if [ $encrypted == "0x1" ]; then -> if [ "$encrypted" == "0x1" ]; then
It looks postbuild.sh and TFM_UPDATE.sh take two additional parameters which are not documented.
regression.sh takes one undocumented parameter.
Hi Antonio and Ahmad,
Thank you for your assistance. Complete solution contains fifteen `api_ns` directories, I am not finding `build_s/api_ns` path. The only other place where `TFM_UPDATE.sh` can be found is `tf-m-tests/tests_reg/build_spe/api_ns`. Is it the right location?
Despite numerous warnings (see below), `postbuild.sh` script executes from the above location. In any case, if I may suggest something, it is probably worth documenting the correct start path, same for additional script params.
Kind regards,
Tomasz
Thomas@AMDMINIATX MINGW64 /c/Temp/tf-m/tf-m-tests/tests_reg/build_spe/api_ns (main)
$ ./postbuild.sh
preprocess bl2 file
C:\Temp\tf-m\tf-m-tests\tests_reg\build_spe\api_ns\scripts\stm_tool.py:29: SyntaxWarning: invalid escape sequence '\s'
image_value_re = re.compile(r"^\s*"+args.macro+"\s*=\s*(.*)")
C:\Temp\tf-m\tf-m-tests\tests_reg\build_spe\api_ns\scripts\stm_tool.py:29: SyntaxWarning: invalid escape sequence '\s'
image_value_re = re.compile(r"^\s*"+args.macro+"\s*=\s*(.*)")
C:\Temp\tf-m\tf-m-tests\tests_reg\build_spe\api_ns\scripts\stm_tool.py:29: SyntaxWarning: invalid escape sequence '\s'
image_value_re = re.compile(r"^\s*"+args.macro+"\s*=\s*(.*)")
updated
C:\Temp\tf-m\tf-m-tests\tests_reg\build_spe\api_ns\scripts\stm_tool.py:29: SyntaxWarning: invalid escape sequence '\s'
image_value_re = re.compile(r"^\s*"+args.macro+"\s*=\s*(.*)")
updated
C:\Temp\tf-m\tf-m-tests\tests_reg\build_spe\api_ns\scripts\stm_tool.py:29: SyntaxWarning: invalid escape sequence '\s'
image_value_re = re.compile(r"^\s*"+args.macro+"\s*=\s*(.*)")
updated
C:\Temp\tf-m\tf-m-tests\tests_reg\build_spe\api_ns\scripts\stm_tool.py:29: SyntaxWarning: invalid escape sequence '\s'
image_value_re = re.compile(r"^\s*"+args.macro+"\s*=\s*(.*)")
updated
C:\Temp\tf-m\tf-m-tests\tests_reg\build_spe\api_ns\scripts\stm_tool.py:29: SyntaxWarning: invalid escape sequence '\s'
image_value_re = re.compile(r"^\s*"+args.macro+"\s*=\s*(.*)")
updated
C:\Temp\tf-m\tf-m-tests\tests_reg\build_spe\api_ns\scripts\stm_tool.py:29: SyntaxWarning: invalid escape sequence '\s'
image_value_re = re.compile(r"^\s*"+args.macro+"\s*=\s*(.*)")
C:\Temp\tf-m\tf-m-tests\tests_reg\build_spe\api_ns\scripts\stm_tool.py:29: SyntaxWarning: invalid escape sequence '\s'
image_value_re = re.compile(r"^\s*"+args.macro+"\s*=\s*(.*)")
C:\Temp\tf-m\tf-m-tests\tests_reg\build_spe\api_ns\scripts\stm_tool.py:29: SyntaxWarning: invalid escape sequence '\s'
image_value_re = re.compile(r"^\s*"+args.macro+"\s*=\s*(.*)")
updated
C:\Temp\tf-m\tf-m-tests\tests_reg\build_spe\api_ns\scripts\stm_tool.py:29: SyntaxWarning: invalid escape sequence '\s'
image_value_re = re.compile(r"^\s*"+args.macro+"\s*=\s*(.*)")
updated
C:\Temp\tf-m\tf-m-tests\tests_reg\build_spe\api_ns\scripts\stm_tool.py:29: SyntaxWarning: invalid escape sequence '\s'
image_value_re = re.compile(r"^\s*"+args.macro+"\s*=\s*(.*)")
updated
C:\Temp\tf-m\tf-m-tests\tests_reg\build_spe\api_ns\scripts\stm_tool.py:29: SyntaxWarning: invalid escape sequence '\s'
image_value_re = re.compile(r"^\s*"+args.macro+"\s*=\s*(.*)")
updated
C:\Temp\tf-m\tf-m-tests\tests_reg\build_spe\api_ns\scripts\stm_tool.py:29: SyntaxWarning: invalid escape sequence '\s'
image_value_re = re.compile(r"^\s*"+args.macro+"\s*=\s*(.*)")
C:\Temp\tf-m\tf-m-tests\tests_reg\build_spe\api_ns\scripts\stm_tool.py:29: SyntaxWarning: invalid escape sequence '\s'
image_value_re = re.compile(r"^\s*"+args.macro+"\s*=\s*(.*)")
C:\Temp\tf-m\tf-m-tests\tests_reg\build_spe\api_ns\scripts\stm_tool.py:29: SyntaxWarning: invalid escape sequence '\s'
image_value_re = re.compile(r"^\s*"+args.macro+"\s*=\s*(.*)")
updated
C:\Temp\tf-m\tf-m-tests\tests_reg\build_spe\api_ns\scripts\stm_tool.py:29: SyntaxWarning: invalid escape sequence '\s'
image_value_re = re.compile(r"^\s*"+args.macro+"\s*=\s*(.*)")
Hi Ahmad,
How to fix the syntax warning from stm_tool.py:29? I am not certain the script in its current form works the way it was intended.
Kind regards,
Tomasz
image_value_re = re.compile(r"^\s*"+args.macro+"\s*=\s*(.*)") stm_tool.py:29: SyntaxWarning: invalid escape sequence '\s'
tf-m@lists.trustedfirmware.org