cancel
Showing results for 
Search instead for 
Did you mean: 

${project_loc} in DCT will not work

padawan
Senior

Hi,

I have written 2 cmd files. The first renames the main.cpp to main.c before the code generation runs. and the second renames main.c back to main.cpp afterwards. The files are in the project path. The plan was to access them with ${project_loc}\CppToC.cmd.
But this does not work.
Is there a solution?

padawan_0-1697619556140.png

 

Padawan

14 REPLIES 14
Pavel A.
Evangelist III

Me.... joining other boomers 😉

As for integration - CubeIDE could detect installed CubeMX on the machine (even multiple instances) and expose them in menu or toolbar?

Hi Pavel,

I guess we could do that... Trouble is normally to provide such feature across all OS we want to support.

 

As an alternative to that approach the use can manually do this play with the file associations instead to force ioc-files to be opened with MX stand-alone:

mattiasnorlander_2-1697790140281.png

Word of caution: If you set the "STM32CubeMX" editor as "Default" the project wizard will break :(
Internal ticket reference: 139637

My recommendation would be to just add this "editor" but not set it as Default. Means double-click on ioc-file will still open it inside the IDE. But, use this flow to open the ioc-file with MX stand-alone. A little bit less convenient than a double-click. But the project wizard remains functional.

mattiasnorlander_3-1697790227457.png

I don't know if that is useful or not? In theory, you can now use whichever external MX tool you want to configure and generate the project. Keep in mind that this is not a validated use case. But I still think it can be helpful in many cases.

Pavel A.
Evangelist III

@mattias norlander 

As an alternative to that approach the use can manually do this play with the file associations instead to force ioc-files to be opened with MX stand-alone

The hitch is that "power users" often have multiple CubeMX versions side by side. Microsoft earlier solved a similar problem with multiple versions of Visual Studio by special open handler for VS solution files that peeks into the file and finds a matching VS instance for its version. (I dunno how they did it, that was Windows specific). 

So I thought it could be easier to do on Linux and Mac in the CubeIDE app, maybe I'm wrong and there is a native way. It's very frustrating if you assign a random CubeMX instance to open all .ioc files and the Cube hails you with "wrong version" error.

 

 

Bob S
Principal

> The hitch is that "power users" often have multiple CubeMX versions side by side.

Yes indeed!

TurboTax solves this by changing the tax file extension to include the year (XXX.tax2022, XXX.tax2023, or something like that).  Ugly, but works.  And makes it plainly obvious which version that file belongs with.

ABish.3
Associate II

To ensure the CMD files run correctly from your project path, you can use relative paths or double-check the syntax of your commands. If `${project_loc}\CppToC.cmd` is not working, try using the relative path directly if the CMD files are in the same directory as your project. For example, simply use `./CppToC.cmd` or `.\CppToC.cmd` within your build scripts or IDE configurations. Additionally, ensure that the CMD files have the correct permissions to execute. If the problem persists, verify the environment variable `${project_loc}` is correctly set and accessible in your context.