cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX: Change Formatting of Generated Source Code

brandongmiche
Associate II

Hello,

Is it possible to change the format of the generated code from CubeMX? In other words, is it possible to configure the indentation and header comments that get generated from CubeMX, either with a template or some user option?

Thanks!

1 REPLY 1
Souhaib MAZHOUD
ST Employee

Hello @brandongmiche 

First let me thank you for posting.

Unfortunately the generated code from CubeMX can't be changed.

Otherwise, STM32CubeMX can generate a custom code based on a FreeMarker template file (.ftl
extension) for any of the following MCU configuration information:
• List of MCU peripherals used by the user configuration
• List of parameters values for those peripherals
• List of resources used by these peripherals: GPIO, DMA requests and interrupts

I recommend you to check the UM1718 paragraph 6.3 Custom code generation for more details.

Thx

Souhaib