2021-01-13 11:52 AM
I am using STM32CubeIDE on MacOS. I am finding that very often, at least every other build, CubeIDE duplicates a bunch of drivers in the HAL driver folder. When that happens the compiler throws a bunch of "multiple definition" errors. To fix that I go into the HAL driver folder and delete all the duplicated. Then all is well until it happens again on the next build or maybe the build after that.
Then, once in a while, there is a long period of time when it doesn't do it. Crazy.
Here is an screenshot of part of my CubeProgrammer GUI showing the dups:
I have also attached a zip of my project.
This is my biggest time waster right now and I'd sure like to know how to stop this from happening. Thanks for your help!
Clark
2021-01-13 02:57 PM
Do you share the project on other computers or OSs or with other people? Is it in a GIT repo?
Never seen this myself (Windows10), but have seen issues related to the above reported here.
2021-01-13 06:39 PM
TDK,
Yes I do share the files between two MacOS computers. The CubeProgrammer files sit on a shared folder. Do you think this could be causing my problem?
I searched the Community files and could not find any other similar reports. Can you give me a link to any other posts discussing similar problem? I will search again too.
I mentioned in my question that the problem is sporadic. Sometimes it happens every other build, but sometimes it doesn't. Right now I wonder if what is actually the case is that one computer has the problem and the other doesn't. I will watch more closely and see if that is the case.
I can't think of what would cause the OS to duplicate driver files, so it seems like it is a bug in CubeProgrammer. Assuming this is the problem, do you know if anyone found a solution to the problem?
Thanks for your help, TDK!
2021-01-13 08:36 PM
> Do you think this could be causing my problem?
That would be my guess. Is it possible one computer is accessing the files, or has them open somewhere which prevents the other computer from deleting them?
> Can you give me a link to any other posts discussing similar problem?
I searched for the thread I remember, but I'm not able to locate it. As you've probably experienced, the search feature here is lacking.
> it seems like it is a bug in CubeProgrammer
Just for clarity, the code generation program is STM32CubeMX, and the IDE which runs everything is STM32CubeIDE. The STM32CubeProgrammer is something else, and isn't related here. You probably know this.
Definitely seems like a bug in STM32CubeMX. Not sure of a solution, but I would store files locally if possible.
2021-01-13 09:20 PM
Thank you for your response.
I don't think the two computers are ever in CubeIDE at the same time. I certainly endeavor to shut down one CubeIDE instance before moving to the other computer. I may forget to do it once in a long while, but not often. I think it is a bug, but I don't know how to get ST to look at it if they don't respond here.
Yea, I knew that the problem was with CubeIDE but I was tired, or spaced out, or something.
I'll do more testing and see if I can figure out any process changes I can make. It just seems really odd to me that the IDE should even accidentally duplicate those files.
Anyway thanks again for your help. I really appreciate it!
2021-12-31 02:17 AM
I have exactly the same problem, and spend a lot of time cleaning up HAL duplicates each time I generate code. I use the STM32CubeIDE version 1.8 on MacOS. See my post here: https://community.st.com/s/question/0D53W00001EgOM8SAN/files-left-over-from-code-geneation-in-stmcubide
Could it be related to iCloud synchronisation/backup going on in the background?
I believe the CubeIDE needs to make a copy of the current set of HAL source files during the generation process in order to merge user code blocks into a new set of generated files, - but for some reason the IDE is unable to delete the copied files once generation is completed. To me, it looks like iCloud starts to synchronise the copied files almost immediately and prevents them from being deleted by the IDE (?). Maybe the problem disappears if the project is moved to a folder not being managed by iCloud, or if iCloud is turned off.
2022-01-01 02:20 PM
I turned off network connections and generated code without any duplicates. This points in the direction mentioned in my above reply.
2022-01-11 03:22 PM
I also found that I cannot use CubeIDE if the project is in a folder synced by iCloud. I was told ST was going to fix this, but I do not know if they have or not....I've just gotten used to having to transfer these files to other machines via SneakerNet.
2023-03-18 11:06 AM
Hi,
So I don't know if you are still having this issue, but I have been having it so I created an automaton application to easily remove the files for me.
This way when the driver nonsense happened I can just press "cmd+space" on my keyboard type in "Bad Drivers" and it will automatically move the duplicated drivers to a folder in my documents (just so I can verify that only the correct ones have been moved. You can alternatively move them directly to the bin.
Hope this helps!