2025-01-20 06:32 AM - last edited on 2025-01-20 06:37 AM by Andrew Neil
Dear STMicroelectronics,
The problem described here: OEMiROT example flash protect sector problem seems to still be present in STM32Cube_FW_H5_V1.4.0. I tested to rebuild Projects/NUCLEO-H563ZI/ROT_Provisioning/OEMiROT from STM32CubeIDE after changing flash_layout.h and indeed only
NUCLEO-H563ZI/ROT_Provisioning/OEMiROT/img_config.sh
NUCLEO-H563ZI/ROT_Provisioning/OEMiROT/ob_flash_programming.sh
are updated so if you run provisioning.bat, the OBs for SECWM2_END etc. will not be correctly set.
Is there an internal ticket tracking a fix for this?
Best regards, Jesper
Solved! Go to Solution.
2025-01-21 01:02 AM
Hello @JesperEC ,
With STM32CubeIDE you need to use only .sh scripts.
So, please use provisioning.sh instead of provisioning.bat
Best regards
Jocelyn
2025-01-21 01:02 AM
Hello @JesperEC ,
With STM32CubeIDE you need to use only .sh scripts.
So, please use provisioning.sh instead of provisioning.bat
Best regards
Jocelyn
2025-01-21 02:10 AM - edited 2025-01-21 02:10 AM
Hi Ricard,
Thanks for your reply.
Well, to me this is a bug, or at least a lack of functionality that makes the developer experience not good. I don't see that it is documented anywhere that this limitation exists.
And if the developer uses a Windows box s/he will also need to install a stand-alone shell to run the scripts. So far I have not been able to run provisioning.sh via the busybox that is included in STM32CubeIDE. Probably because the scripts have some bashisms but AFAIK the shell in busybox is ash. I think the resulting error prints are just rerouted to /dev/null by STM32CubeIDE.
It is possible to run provisioning.sh via the bash in Git bash but you have to modify the tool paths in env.sh to fit the Cygwin mount points. And then they don't work with the busybox anymore so you have to remember to tweak them back before rebuilding in STM32CubeIDE.
At a bare minimum provisioning.bat should fail noisily when it has not been updated so you don't run it and end up with a board that doesn't boot and you need to do some digging to find out why. The variables could be left empty in the examples and templates provided and checked at run-time. If IAR or Keil hasn't updated them - because you used STM32CubeIDE instead - the bat-file could exit with a helpful message that informs the developer to use the .sh-scripts if using STM32CubeIDE.
Best regards, Jesper
2025-01-22 06:13 AM
Hello @JesperEC ,
thank you for valuable feedback.
I checked with CubeIDE's bash and get same issue. I will raise this point.
I'm using git bash and don't need to change anything in env.sh. The MINGW64 used behind can read windows path.
So, I guess you have a specific setup using Cygwin. Now path using /c/Program Files ... should also work.
Regarding wrong usage of bat script, this is very good idea indeed. This will avoid misuse and time loss. I will also raise this.
Best regards
Jocelyn
2025-01-29 01:45 AM
@JesperEC wrote:
It is possible to run provisioning.sh via the bash in Git bash but you have to modify the tool paths in env.sh to fit the Cygwin mount points. And then they don't work with the busybox anymore so you have to remember to tweak them back before rebuilding in STM32CubeIDE.
@Jocelyn RICARD wrote:
Hello @JesperEC ,
I'm using git bash and don't need to change anything in env.sh. The MINGW64 used behind can read windows path.
So, I guess you have a specific setup using Cygwin. Now path using /c/Program Files ... should also work.
I have found the cause of my problem now.
To make the c:\Program Files\... path work in both Git Bash/MINGW64 and the busybox in STM32CubeIDE that runs postbuild.sh you need to use forward slashes as directory separators. busybox seems to cope with both but Git Bash interprets the backslashes as escape sequences as bash normally does.
So, the part of env.sh should look like this:
# ==============================================================================
# General
# ==============================================================================
#Configure tools installation path
if [ "$OS" == "Windows_NT" ]; then
stm32programmercli="C:/Program Files/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI.exe"
stm32tpccli="C:/Program Files/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32TrustedPackageCreator_CLI.exe"
else
stm32programmercli_path=~/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/
PATH=$stm32programmercli_path:$PATH
stm32programmercli="STM32_Programmer_CLI"
stm32tpccli="STM32TrustedPackageCreator_CLI"
fi
But the Projects/NUCLEO-H563ZI/ROT_Provisioning/env.sh as delivered in STM32Cube_FW_H5_V1.4.0 uses backslashes so as a developer you think that is what is needed (despite them looking a bit out of place in a sh-style script).
May I please ask you to raise this internally as well? A change to forward slashes (and maybe a small comment about the reason) in the env.sh of the next release would reduce developer confusion.
Best regards, Jesper
2025-01-29 08:36 AM
Hello @JesperEC ,
The usage of / instead of \ doesn't arm in my case but I still have issue with script when trying to use busybox. It looks like some specific shell usage is not supported.
Anyway, I will update the internal ticket with your input.
Best regards
Jocelyn