AnsweredAssumed Answered


Question asked by John Craven on Feb 15, 2018
Latest reply on Feb 22, 2018 by Christian Keydel

I can't remember the last time i could use a complete set of project files generated by CubeMX without having to patch something in the project that isn't user code.


I am kind of tired maintaining backups of the patched files, or a live "MODs list" of things to repatch when i won't to go back to CubeMX and change a setting or add a peripheral etc.


I would like to see some method of marking individual files as do not overwrite on Cube project regeneration.


I tried just marking the files as READ ONLY. but CubeMX just ignores this and overwrites them anyways. This would be the simplest, just respect the Readonly settings!!!


If you want to do it the hard way, then  after initial generation, you would left me mark as protected from overwrite, either by perpherial/middleware, or by individual file.


Alternatively, add a comment section at the beginning of every file, that can be altered by the user, to mark it as "leave me alone"! CubeMX is smart enough to not overwrite my code between "USER CODE BEGIN" and "USER CODE END". I am sure it could just leave the whole file alone if some comment were added to the top of the "/* !!! PLEASE DON'T MAKE ME PATCH THIS AGAIN !!! */"


Its one thing to have to deal with all the issues is HAL and the many workarounds and to find them and fix it once. Its whole different level of annoyance to have to so the same thing over and over!!! STM please while your improving CubeMX and HAL/LL, please don't make me hate it due to useless repetition!!!