undefined reference to `GPIOSetDir' and undefined reference to `GPIOSetValue'

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

undefined reference to `GPIOSetDir' and undefined reference to `GPIOSetValue'

637 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wzq12138 on Thu Aug 22 20:50:29 MST 2013
My LPCxpresso board is  lpc11c24,and I  want to try the uart,and my code is

#include "LPC11xx.h"                 
#include "driver_config.h"
#include "target_config.h"
#include "gpio.h"                        
#include "uart.h"

#define TX_EN  GPIOSetValue(0,19,0); 
extern volatile uint32_t UARTCount;/
extern volatile uint8_t UARTBuffer[BUFSIZE];

uint8_t aa[10]="2010.5.9AM";       /                 
uint8_t bb[1];                                
int UARTRec()
{
  uint8_t BufferPtr;
  while((LPC_UART->LSR & 0x01) == 0);
  BufferPtr = LPC_UART->RBR;
  return  BufferPtr;
}

int main (void)
{


  UARTInit(115200);                      
  UARTCount=1;                            //
  bb[0]=0x00;                                  /
  GPIOSetDir(0,19,1 );        //error:  undefined reference to `GPIOSetDir'
  TX_EN;                      //error: undefined reference to `GPIOSetValue'                
  UARTSend((uint8_t *) aa,10);     /
  while (1)
  {

if ( UARTCount != 0 )                   /
{
   LPC_UART->IER = IER_THRE | IER_RLS;
   bb[0]=UARTRec();                    //
   UARTSend((uint8_t *) bb,1);

   LPC_UART->IER = IER_THRE | IER_RLS | IER_RBR;
}
  }
}

and  the  error is above  ,can you  help  me.
Labels (1)
0 Kudos
3 Replies

520 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Paul on Mon Aug 26 06:38:49 MST 2013
Which example code are you using?
The GPIOSetValue() function is normally found in the gpio.c file, and also defined in gpio.h.  Make sure these files can be found in your project.  If you are using the example code from: http://www.lpcware.com/content/nxpfile/sample-code-bundle-lpc11xx-peripherals-using-nxp-lpcxpresso
then the gpio.c file can be found in the "LPC11xx-LPCXpresso-CMSIS-update\gpio\Common\src" directory.
0 Kudos

520 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wzq12138 on Sun Aug 25 23:43:26 MST 2013
thank you ,in fact ,I want to use the uart to control the led on p1-20.the main is that when i send a code like FF or anything onthers ,the led on p1-20 will be lighten,and then when i send a code from the computer by the uart,the led on p1-20 will not be lighten .my english is poor ,do you understand me ,can you write the code for me ,thank you very much.
0 Kudos

520 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Fri Aug 23 00:29:48 MST 2013
They are CMSIS calls. You need to link with a CMSIS library.
0 Kudos