I use Eclipse and yagarto gcc
when i build my project using printf or sprintf function i get the
errors shown below. I have included stdio.h file in my project using
#include “stdio.h”.
It seems I cant access functions in the stdio library.
The project builds successfully when sprintf or printf is removed
/* *********************************************************
Header files & Function declarations
********************************************************* */
#include “lpc214x.h”
#include “uart.h”
#include “stdio.h”
void Initialize(void);
void feed(void);
void IRQ_Routine (void) attribute ((interrupt(“IRQ”)));
void FIQ_Routine (void) attribute ((interrupt(“FIQ”)));
void SWI_Routine (void) attribute ((interrupt(“SWI”)));
void UNDEF_Routine (void) attribute ((interrupt(“UNDEF”)));
void delay_ms(unsigned ms)
{
int i,j;
for(i=0;i<ms;i++)
for(j=0;j<6659;j++);
}
int main(void)
{
int val=0;
char s[30];
Initialize();
SCS = 0x03;
uart0_init(9600);
PINSEL1 |=0x10000000;
AD0CR= 0x01210608;
while(1)
{
AD0CR |= 0x01000000;
while((AD0DR3 & 0x80000000)== 0);
val = ((AD0DR3 >> 6) & 0x03FF);
sprintf(s,“Analog(AD0.3): %d \r”,val);
uart0_puts(s);
delay_ms(200);
}
}
/**********************************************************
Initialize
**********************************************************/
#define PLOCK 0x400
void Initialize(void) {
PLLCFG=0x24;
feed();
PLLCON=0x1;
feed();
while(!(PLLSTAT & PLOCK)) ;
PLLCON=0x3;
feed();
MAMCR=0x2;
MAMTIM=0x4;
VPBDIV=0x02;
}
void feed(void)
{
PLLFEED=0xAA;
PLLFEED=0x55;
}
void IRQ_Routine (void) {
while (1) ;
}
void FIQ_Routine (void) {
while (1) ;
}
void SWI_Routine (void) {
while (1) ;
}
void UNDEF_Routine (void) {
while (1) ;
}