Skip to main content
Associate
December 1, 2025
Solved

Is there anyway to customize the sub-project path during code generations?

  • December 1, 2025
  • 3 replies
  • 418 views

Hi,

 

Is there anyway to generate codes in such way that we can customize our sub-project paths? E.g. Instead of having project/core/src, we have project/src... etc? Thanks in advance!

Best answer by TDK

After you generate code, it is locked and can no longer be changed to avoid user code and other files being deleted unintentionally.

To change it, do a Save As on the IOC and it will be available again or manually edit the IOC file. Back up your files first--switching mid-project is not a supported use case.

3 replies

TDK
Super User
December 1, 2025

Nope. The structure is different based on the chip and some other stuff, but it's not flexible.

Options:

  • (recommended) live with what CubeMX generated as-is.
  • add post-generation script to rename. If you use user code, you'll have to un-rename in a pre-generation script.
  • at some point in the project, don't use "Generate Code" functionality any more and make changes manually.
"If you feel a post has answered your question, please click ""Accept as Solution""."
TDK
Super User
December 1, 2025

You can change the Application Structure between Advanced and Basic which changes how paths are set up. That is the only knob available.

TDK_0-1764631201742.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
karenCBAuthor
Associate
December 2, 2025

Hi @TDK,

 

Do you know how I can toggle between "Advanced" and "Basic" application structure? In my CubeMX, that option is unhigh-lighted and I can't change from "Advanced" to "Basic".

 

 

TDK
TDKBest answer
Super User
December 2, 2025

After you generate code, it is locked and can no longer be changed to avoid user code and other files being deleted unintentionally.

To change it, do a Save As on the IOC and it will be available again or manually edit the IOC file. Back up your files first--switching mid-project is not a supported use case.

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