cancel
Showing results for 
Search instead for 
Did you mean: 

Prebuild and post build step deleted when the project is regenerated from CubeMx

Paolo Andreuzza
Associate II

I've created a project in the STM32CubeIDE environment, using the STM32CubeMX integrated configurator (STM32CubeIDE Version: 1.0.2, STM32CubeMX Version: 5.3.0).

I have added in project configuration a prebuild step that calls bat file that collect some information from the source control management tool, and put them in some #define in an include file, and a post build step that calls an other bat file to rework the just created binary file.

At this point, if I change something in the CubeMX (just an IO config is enought, for example) and I regenerate the code, the pre build and post build settings are deleted.

This is a very annoying beheviour, because it doesn't allow to automate the workflow. Are there any workarounds to bypass this beheviour?

thank you

Paolo

P.S. I've realized just now that exist an other post for the same issue for stand alone version of CubeMX and ATOLLIC TrueStudio here: https://community.st.com/s/question/0D50X0000A4mi6iSQA/stm32cube-v50-overwrites-postbuild-steps-when-generating-truestudio-project-files

18 REPLIES 18
Markus GIRDLAND
ST Employee

I can't seem to reproduce this issue so I might need more details.

Here's what I did:

  1. Created a new project for F4 Discovery board.
  2. Added "myBat.bat" in Debug folder which had "mspaint" as its only content as a pre-build step.
  3. Added "echo "End of test"" as a Post-build step.
  4. Build the project, everything is working as expected. Paint is opened, when I close it the build continues and ended with an "End of test" at the end of the build.
  5. Toggled a few settings in the .ioc editor and regenerated the code
  6. Build the project and result was the same as in step 4.

If you do the same steps I do, what result do you get?

If you get the same result I did...

Is there a specific MCU this happens on? A specific command? If you only have an echo "Hello world" as a pre-build step in your current project does that get deleted as well?

Any additional details would be helpful!

Paolo Andreuzza
Associate II

Thanks for your answer, Markus.

Doing some tests, suddenly all starts to work correctly, even in my workstation.

After a moment of bewilderment, I restart the test from the beginning and I get point.

If you keep open the tab with the ioc file in the STM32CubeIDE, all works correctly trought the code rigeneration.

Please, try the following steps:

  • After the project creation, be sure that the ioc tab in the IDE is close.
  • Change the pre build step
  • Open again the ioc editor clicking twice in the ioc file in the project explorer pane (it should appear a window with a progressbar that say someting like "Initilizing Device configuration tool..." for a second or less).
  • Now change somenthing in the configuration, push the generate button in the toolbar (the button with the gear icon)
  • Close the ioc tab and now check the project settings. The pre build step should be gone.

If you check, not only the Build steps are deleted but even other settings, such as Environment variables definition.

I hope you can reproduce the issue, because it is very annoyng. It doesn't allow to automate the workflow, that, instead, is a very important thing in professional.

Please, let me know if you can reproduce the issue, it's very important to me to find a way to make this work.

Thank you.

Paolo

Paolo Andreuzza
Associate II

Markus, let me add an other information.

If you try to:

  • add a build configuration (when the IOC editor is closed),
  • open the configurator clicking twice on the ioc file,
  • change something
  • rigenerate the code

the build configuration that you have just added disappear!:astonished_face:

EDIT: Same behaviour using the configurator in the stand alone version

There we have it, I was able to reproduce! The secret behind it is that you need to have had the ioc editor closed, then open it (with the "Initializing Device configuration tool") and then it will regenerate in a wrong way, even deleting my "myBat.bat" in the Debug folder!

I'll write a ticket for this immediately. Thank you for the report, Paolo!

This is a good news.

Thank you for support, Markus.

I hope in a quick fixing and release of the new version.

Is it already scheduled the next release? Is it public the roadmap of STMcubeIDE?

It looks like a problem in the MX end so it will be handled by that team, but I can't imagine that they wouldn't set this as a very high priority ticket.

There's no public roadmap of our development as of yet. Immediately after release we wanted to bug fix and stabilize so that's what the last versions have been about. The next "big" update will most likely involve multi core.

Ok.

Thank you again!

Paolo

DJohn.13
Associate II

This problem also affects Include files added to the properties editor (properties>C /C++ General>Path and Symbols>Includes) and to the Environmental Variables ( properties>C /C++ Build>Environment). Most likely anything changed in the properties>… editor will be lost once the .ioc file is closed and then later opened with changes made.

NPato
Associate II

Also linker script gets reset, silently loosing any custom changes. What a fun afternoon it was finding some of this out :(