cancel
Showing results for 
Search instead for 
Did you mean: 

Why does CubeProgrammer often duplicate HAL drivers?

Clark Sann
Senior

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:

0693W000007BAcFQAW.pngI 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

8 REPLIES 8
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".
Clark Sann
Senior

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!

TDK
Guru

> 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.

If you feel a post has answered your question, please click "Accept as Solution".
Clark Sann
Senior

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!

Per4
Associate II

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.

Per4
Associate II

I turned off network connections and generated code without any duplicates. This points in the direction mentioned in my above reply.

Clark Sann
Senior

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.

ABerg
Associate

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.

0693W00000aJGHKQA4.pngThis 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!