Skip to main content
magene
Senior
November 3, 2023
Solved

Cube MX custom template for custom folder structure

  • November 3, 2023
  • 1 reply
  • 2162 views

The STM32CubeMX User Manual (UM1718 section 3) and various threads on this forum lead me to believe I can customize the folder structure that CubeMX uses for where it puts the code files it generates. I'm not trying to do anything fancy, I'd just like to put all the .c and .h files that CubeMX generates in one BSP folder instead of the /Core/Inc and /Core/Src folders that it defaults to.

Seems like some file somewhere in the 

C:\ProgramFiles\STMicroelectronics\STM32Cube\STM32CubeMX\db\templates directory will have the magic code, but I haven't been able to find it.

Is generating a custom folder structure possible and if so how?

Thanks

This topic has been closed for replies.
Best answer by Souhaib MAZHOUD

Hello @magene 
First let me thank you for posting.

if i get you right, there is no option in CubeMx to customize your folder structure that contains all the file generated by CubeMX.

Otherwise, the section 6 in UM1718 talk about generating a custom code based on FTL file. By default, the custom file is generated in the user project root folder that you can change it with another.

Thank you,

Souhaib

 

1 reply

Souhaib MAZHOUDBest answer
Technical Moderator
November 6, 2023

Hello @magene 
First let me thank you for posting.

if i get you right, there is no option in CubeMx to customize your folder structure that contains all the file generated by CubeMX.

Otherwise, the section 6 in UM1718 talk about generating a custom code based on FTL file. By default, the custom file is generated in the user project root folder that you can change it with another.

Thank you,

Souhaib

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.