Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

STM32 External Source Files

I am writing some C source code for STM32 in CubeIDE and am trying to separate source code that will be reused on multiple designs into an external library (an external as far as SVN is concerned).

In terms of CubeIDE a have a new folder at the top level (same level as the folders Core, Release etc). I call this folder Externals.

My problem comes if I have external files such as Externals/Inc/test.h and Externals/Src/test.c. The system sees the .h files fine if I #include "test.h" in the main files but for some reason I also need to #include "test.c". This makes it work, but I have never seen this done before so I’m thinking something else must be wrong.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Select "Project", then "Properties", "C/C++ General", "Paths and Symbols" and select the "Source Location" tab. Here you can add source code folders (remember to select "All configurations" first).

You can then include/exclude individual files/folders as follows: In the Project Explorer window, right-click on the file/folder, select "Resource Configurations", "Exclude from build" and select/deselect as appropriate.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading