cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX code generation duplicated driver files and main.c

hakeila
Associate II

Hi,

 

I have got a project configured successfully using STM32CubeMX code generation for STM32H5 MCU series. I noticed that the Src and Inc folders are dublicated under Core folder and under the project folder.

 

When I make any changes in my drivers configuration on CubeMX and regenerate the code, only the source folders (Src and Inc) under Core are updated, however the other dublicated source files are not.

 

My question is that why the source files are dublicated? This creates confusion in my project setup and unnecessary files included in my git repo.

 

Also there are two main.c files; one in the project folder and the other in Core folder.

I am wondering if there is some kind of settings I have to do under STM32CubeMX.

 

I also imported the configured project into STM32CubeIDE and I am not sure if the issue in the IDE or in the CubeMX

 

Kind Regards,

Hani

4 REPLIES 4
Mahmoud Ben Romdhane
ST Employee

Hello @hakeila ,

First let me thank you for posting and welcome to the ST Community.

In order to reproduce the request, I suggest that you provide your ioc.File.

Thanks.

Mahmoud

Hi Mahmoud,

 

Thank you so much for quick and kind reply.

Sure thing. I will send you the .ioc file as a private message.

 

Kind Regards,

Hani

Hello @hakeila ,

Further to your comment and after investigation, I can confirm through you Ioc.File that you are working with Secure and NoSecure.

Thats why, after generating the code you will find WxING_NonSecure and WxpING_Secure folders.

In fact, the Src and Inc folders are not duplicated under Core folder. 

 

MahmoudBenRomdhane_0-1731920767823.png

Thanks.

Mahmoud

 

 

hakeila
Associate II

Hi Mahmoud,

 

Thank you for your reply. These source folders (Src and Inc) existed when I first generated the projects and then they won't be updated after each consequent code generation. This is my secure project where you can see the duplication as shown below

hakeila_1-1731977835524.png

 

 

If these files are not updated after each code generation, Can I remove them and put all my project code under Core folder?

 

Regards,

Hani