Including the drivers folder in a new project

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

Including the drivers folder in a new project

899 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Chris1seto on Wed Jul 13 21:54:20 MST 2011
In the LPC examples, I see several folders not added whe na new C project is created. Among these is the drivers folder, which holds the code to interact with GPIO which is what I need to do in my project/.

I am using the CMSIS in my project, 2.00.

So, I add the drivers folder to my project root, then under the quickstart panel/quick settings -> Include paths I add the path.

When I build, I get several of the following errors for each of the references to functions defined in the gpio .h/.c files. (I also add gpio.h in the C file generating the errors with "#include "gpio.h"")

Quote:
undefined reference to `GPIOSetDir'

It seems as though the .h file is found, but it can't find the functions defined in it.

Any ideas?
0 Kudos
Reply
3 Replies

838 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_USA on Fri Jul 15 15:47:29 MST 2011
You probably need to remove crp.c from the drivers folder (or tell LPCXpresso not to include it in the build) the example package with the drivers folder was created before LPCXpresso had its own CRP feature in the wizard.

-NXP
0 Kudos
Reply

838 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Chris1seto on Thu Jul 14 19:58:28 MST 2011
Thanks,

But I still am having issues.

Now I get the following error:

Quote:
./driver/crp.o:(.crp+0x0): multiple definition of `CRP_WORD'
./src/main.o:(.crp+0x0): first defined here
c:/nxp/lpcxpresso_4.0.5_123/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/bin/ld.exe: cannot find -lC:/Users/Chris/Documents/LPCXpresso_4.0.5_123/workspace/MyProject/driver
c:/nxp/lpcxpresso_4.0.5_123/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/bin/ld.exe: cannot find -lC:/Users/Chris/Documents/LPCXpresso_4.0.5_123/workspace/MyProject/config
collect2: ld returned 1 exit status
make: *** [PpmEncoder.axf] Error 1



I made sure those directories exist....
0 Kudos
Reply

838 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Jul 14 05:44:36 MST 2011
Your compiler doesn't know that you are trying to use a new source folder :eek::eek:

So just add your new source folder in:

Properties -> C/C++ General -> Paths and Symbols -> Source Location
0 Kudos
Reply