Kinetis K60 modifying example programs

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

Kinetis K60 modifying example programs

1,060 Views
GaryOlmstead
Senior Contributor I

I am using MCUxpresso 11.1 with a Kinetis K60 in the 100 pin LQFP package in a bare metal project.  I want to test the SD interface, so I installed the example code from the K60 tower board SDK.  That codes uses a 100 pin K60 in a BGA package.

I used the Quick Start panel to create a new bare metal project, used the Pins config to set the SD port pins, and then copied and pasted the Tower SD project code into mine.  I made sure to copy the folders and all their contents.  I did not make any changes to this code.

Obviously, it's not compiling.  I get a dozen or so errors, all about functions such as f_read, f_write, f_mount etc, not being defined. I know there are software switches to control what is included, but all the ones I could find are set to include everything.  In poking around, I see that although I copied all the folders over, only about half of them are listed in the make file.  In particular, fatfs and sdmmc are not included, although they are in the folder.  When I compile the example code and run it on a Tower board, it works perfectly.

My question is how do I get the rest of the files into the mak files?

0 Kudos
8 Replies

795 Views
converse
Senior Contributor V

Are your files in folders that are defined as ‘source folders’? It should have a small blue c in the corner of the icon.

795 Views
GaryOlmstead
Senior Contributor I

Hi Con --

Most of the folders have the blue 'C', but two don't.  They are fatfs and sdmmc, which are the two I think are causing the problem.  How do I make them source files?

0 Kudos

795 Views
GaryOlmstead
Senior Contributor I

OK, I figured it out.  For the benefit of anyone else reading this, right click on the folder that doesn't have a blue 'C', go all the way down to Properties, and select it.  Then open Resource >> C

/C++ General >> Paths and Symbols.  There is a box near the top that says "Exclude resource from build".  Uncheck the box, select Apply and Close, and you're done.

Thanks, Con.

Where's the box that says Answered?

795 Views
converse
Senior Contributor V

The correct way to do this is described in the documentation. 

Help->Help contents

and search for "Source Folder"

Will give you instructions on converting a folder into a Source folder.

795 Views
GaryOlmstead
Senior Contributor I

Hi Con --

OK, that process does work for source files, but it doesn't work for include files.  Same screen, but with the Includes tab selected.  I select Add, and enter the name of a folder.  The header symbol is yellow, not blue, and the warning at the bottom says the selected folder does not exist or is not accessible.  It certainly does exist,and I can open it.  So, what is the secret to header files?

0 Kudos

795 Views
converse
Senior Contributor V

See this:

https://community.nxp.com/thread/388957 

You must realise the difference between Source folders, which tell the build system where to look for files to compile (i.e. 'where are the C files located to build') with Include Paths, which tell the compiler where to look for header files.

You may also find this article useful

Ways to apply Eclipse CDT C/C++ Project Settings | MCU on Eclipse 

795 Views
GaryOlmstead
Senior Contributor I

Hi Con --

The main point of that article was "use the Quick Start panel", which I did, and it solved that problem.  Double-checking the results by selecting Project >> Properties>> C/C++ General >>Paths and Symbols shows.... nothing.  Whatever Quick Start does, it doesn't do it here.

But, that problem has gone away, so on to the next one.  Thanks for your help.

0 Kudos

795 Views
converse
Senior Contributor V

It's in

Project->Properties->C/C++ Build->Settings->MCU C Compiler->Includes

0 Kudos