Hi,
I am using the following code in retarget.c
#include <stdio.h> #include <rt_misc.h>
#pragma import(__use_no_semihosting_swi)
extern int sendchar(int ch); /* in Serial.c */ extern int getkey(void); /* in Serial.c */ extern long timeval; /* in Time.c */
struct __FILE { int handle;} ; FILE __stdout; FILE __stdin; FILE __stderr;
int fputc(int ch, FILE *f) { return (sendchar(ch)); }
int fgetc(FILE *f) { return (sendchar(getkey())); }
int ferror(FILE *f) { /* Your implementation of ferror */ return EOF; }
void _ttywrch(int ch) { sendchar (ch); }
void _sys_open(int return_code) { while (1); /* endless loop */ }
but i am getting the following errors
26564:Error: L6218E: Undefined symbol getkey (referred from Init.o). 26565:Error: L6218E: Undefined symbol sendchar (referred from Init.o).
Please let me know how to resolve the issue.
Thanks in Advance. Ramu
You are apparently missing the functions you need, and the source file SERIAL.C that implements the actual USART IO for your board. Review comments...
The answer should be obvious from the words themselves: if something is un-defined, then the way to resolve that is to define it - clearly?
Your comments claim they're in in Serial.c:
extern int sendchar(int ch); /* in Serial.c */ extern int getkey(void); /* in Serial.c */
are they?