Adding files to MCUXpresso project

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Adding files to MCUXpresso project

Jump to solution
5,118 Views
GaryOlmstead
Senior Contributor I

I am using MCUXpresso v11.1.0 build 3209 with a Kinetis K60 with an SDK for chip only, no development board.  I can create a Hello World project and run it with semihosting.  So far, so good. 

But when I try to add a new file (using File > New > Other... > Source File) it adds the file to the Project window, but not to the make file. Every bit of code I add to the file is ignored. 

So, how do I add files to make?

0 Kudos
1 Solution
4,912 Views
GaryOlmstead
Senior Contributor I

Well, the problem went away.  I closed MCUXpresspo, reopened it, and it compiled without errors.  I didn't do anything else to it.

Thanks for your help.

View solution in original post

0 Kudos
12 Replies
4,913 Views
ErichStyger
Senior Contributor V

Could it be that the function in question (TwelveVTest()) is defined as static?

Erich

0 Kudos
4,913 Views
GaryOlmstead
Senior Contributor I

Well, I didn't do anything different for these files, and I don't see where to set that option.  The help file, as usual, isn't much help.  Nothing in the file is defined as "static".

How do I find out whether it is static?

0 Kudos
4,913 Views
GaryOlmstead
Senior Contributor I

I installed the new version of code; it doesn't make any difference.

0 Kudos
4,913 Views
converse
Senior Contributor V

Can you show us the source code? Difficult to know what’s wrong without it

0 Kudos
4,913 Views
GaryOlmstead
Senior Contributor I

Well, the problem went away.  I closed MCUXpresspo, reopened it, and it compiled without errors.  I didn't do anything else to it.

Thanks for your help.

0 Kudos
4,913 Views
GaryOlmstead
Senior Contributor I

The above solution only worked one time.  What seems to be working more consistently is: always use Peripherals, AND Pins, AND Clocks.  Save it, then click on Update Code, which is an icon that I can't find at the moment.  Then choose Build from the Quick Start menu.

0 Kudos
4,913 Views
ErichStyger
Senior Contributor V

Make sure the file (or the folder) is not 'excluded'. The folder should have a 'C' on it and the source file shall have normal file extension (.c):

pastedImage_1.png

See Exclude Source Files from Build in Eclipse | MCU on Eclipse 

I hope this helps,

Erich

0 Kudos
4,913 Views
GaryOlmstead
Senior Contributor I

The file has a ".C" extension, and a "C" on the icon. The file in question is TwelveVoltTest.C.  It contains TwelveVTest(), which is called from the while loop below the "Hello World".  The file "CANTest.C" behaves the same way when I call it, which I am not in this version for simplicity.

MCUXpresso Screen Shot BPv4.png

0 Kudos
4,913 Views
GaryOlmstead
Senior Contributor I

Here's a better one that also shows the error message in the Problems window.MCUXpresso Screen Shot BPv4 better.png

0 Kudos
4,913 Views
converse
Senior Contributor V

What is the file extension? It needs to be .c . If that Does not help , take a screenshot of your project window and post it.

0 Kudos
4,408 Views
petrama
Contributor III

Yes, ".c"  - not ".C" !

0 Kudos
4,399 Views
ErichStyger
Senior Contributor V

Just in case: here is where the file mapping is done:

ErichS_0-1628227177980.png

Related to this: https://mcuoneclipse.com/2016/05/05/assembly-files-in-eclipse-cdt-projects/

I hope this helps,

Erich

0 Kudos