2025-05-07 8:08 AM
What I have to do that I can directly call some python scripts as pre/post code generation step with CubeMX 6.14.1 under Linux?
Currently I can execute directly the python script on a Windows Machine, but on the Linux machine nothing happens. On Linux I can execute the scripts directly from command line without CubeMX and I can execute the scripts over a bash script which is calling the python script.
Thanks in advance
nobody
2025-05-08 8:48 AM
Relative path can be wrong. Try: python -c "import os; os.getcwd()" to see if python works at all and where you are.
2025-05-12 9:32 PM
It looks like that it is only possible to call an existing script file. It's not possible to execute directly some command. If I understood you right, that was your suggestion.
2025-05-12 9:33 PM
I think it's not a "terminal window" tab. I think it's only a "file selection" tab.
2025-05-12 9:37 PM
If I understood you right, you also suggested to directly execute that. Unfortunately it looks that only a file selection is possible.
2025-05-12 10:24 PM
As mentioned, I am no Cube user.
Have you tried something like this : https://stackoverflow.com/questions/44220993/how-to-run-system-shell-terminal-inside-eclipse
Like other build system, Eclipse use a set of "private" environment variables, like "PROJECT_DIR" or "PROJECT_ROOT". Most internal and external tools and the objects they process are referenced that way, to be easily interchangeable between different machines/developers.
2025-05-13 3:15 PM - edited 2025-05-13 3:30 PM
I've tried also to select an existing file, such as (in Windows) c:\tmp\junk.bat - with same result: "the specified path is invalid".
Only if the script file is in the same directory with the .ioc , and specified *with NO path* at all (just junk.bat) - it works.
For me, both .bat and .py files run on Windows.
In Linux, either mark the file executable or wrap in a script.
2025-05-14 12:54 AM
well,
works for me, e.g. with the content 'code' it will start VS code.
Some computer mysteries may remain unsolved forever.
KnarfB