cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to automatically separate the code generated by STM32CubeIDE into headers and source files for each type of peripherals?

VVakh.1
Associate III

When I create a new project in STM32CubeIDE with the use of a configuration (.ioc) file, configure peripherals, and generate code, all handlers (such as I2C_HandleTypeDef, UART_HandleTypeDef, QSPI_HandleTypeDef, DMA_HandleTypeDef, etc.) and their initialization functions are placed in main.c file.

Is there a way to automatically split the code into multiple pairs of headers and source files (let's say, a header-source pair for UART, a header-source pair for I2C, etc.)?

I would like to define some custom parameters and functions related to my peripherals. Of course, I can create additional headers and source files. I would just prefer to group them all together without producing multiple files.

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

> Is there a way to automatically split the code into multiple pairs of headers and source files (let's say, a header-source pair for UART, a header-source pair for I2C, etc.)?

Yes. See the screenshot here:

0693W00000HqYGAQA3.png

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

View solution in original post

3 REPLIES 3
TDK
Guru

> Is there a way to automatically split the code into multiple pairs of headers and source files (let's say, a header-source pair for UART, a header-source pair for I2C, etc.)?

Yes. See the screenshot here:

0693W00000HqYGAQA3.png

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

Thank you a lot! It helped, my issue is resolved.

thanks!