2016-08-23 10:58 AM
I created a project with STM32CubeMX, generated the source code (for MDK-ARM5), then expanded my code by adding a couple of new source files.
Later, I went back to tweak my original Cube project and when I regenerated the source code, it deleted my new source files and created a new Keil project that didn't know about my new sources.Is there a trick to doing what I want here? My workaround so far is to store my new code in a separate folder - but I still have to re-add them to my project if I ever re-generate the source code.Thanks.2016-08-24 05:18 AM
Hi seymour.jim,
First, be sure that you are using the last version of CubeMx (4.16.0 now)For the option ''Keep user code when generating'' ( in “Project setting� -> “Code generator�), it is checked by default but also you can verify it
.Try to copy and paste the files that you want to add in source folder of your generated project -> add the files in workspace –> regenerate project.
-Hannibal-
2016-08-24 09:32 AM
Thanks. I am using the latest version and that option was selected.
But now I'm having trouble duplicating the original bug, so I'm not 100% sure about it anymore.I still have to manually add my custom source files to the project when I do a regenerate, but the files themselves didn't get deleted the last couple of times I tried this.Weird.2016-08-25 07:16 AM
Hi seymour.jim,
So it's OK. It seems that the first time you were not adding the files to the generated project's repository. -Hannibal-2016-08-25 08:32 AM
I am fairly confident that I can reproduce the problem, so I don't think it's ''OK''. But it clearly does not happen all the time, so it's not the big, scary bug I thought it was.