cancel
Showing results for 
Search instead for 
Did you mean: 

How to add external files .c and .h files in STM32CubeIDE project

SIVAOAS
Associate II

How to add external files .c and .h files in STM32CubeIDE project ,can you please explain steps to add .c and .h files in STM32CUBEIDE project

1 ACCEPTED SOLUTION

Accepted Solutions
mÆŽALLEm
ST Employee

Hello,

For .h files, you need to give the path(s) to that files as include paths:

Proprieties -> Settings -> MCC GCC compiler -> Include Paths:

SofLit_0-1720092773799.png

For .c file you need to drag and drop the file to the Project explorer at the level you want. You will get this message:

SofLit_1-1720093004615.png

Click OK. The file will be added to you project.

 

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.

View solution in original post

2 REPLIES 2
mÆŽALLEm
ST Employee

Hello,

For .h files, you need to give the path(s) to that files as include paths:

Proprieties -> Settings -> MCC GCC compiler -> Include Paths:

SofLit_0-1720092773799.png

For .c file you need to drag and drop the file to the Project explorer at the level you want. You will get this message:

SofLit_1-1720093004615.png

Click OK. The file will be added to you project.

 

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.
Andrew Neil
Super User

Not entirely sure what you mean by "external", but maybe try this?

https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/same-touchgfx-project-for-multiple-cubemx-files-in-the-same/m-p/672534/highlight/true#M37503

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.