We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
When I try to compile my program I get the following error:
'project.axf: Error L6218E: Undefined symbol sendchar (referred from retarget.o).'
I've tried to solve this error for quite a while now, but it doesn't work out. I've read other forum threads and I've searched through the net, but I can't find a satisfying answer.
Some background info: I'm trying to get the UART0 working on the LPC2148. I use Keil uVision3 and I use the Philips LPC2000 Flash Utility V2.2.3 to upload the .hex file to the microcontroller.
I'm new with the UART and I find it quite difficult to work with.
This is the Retarget.c:
#include <stdio.h> #include <rt_misc.h> #pragma import(__use_no_semihosting_swi) extern int sendchar(int ch); struct __FILE (int handle;); FILE __stdout; int fputc(int ch, FILE *f) { return (sendchar(ch)); } int ferror(FILE*f) { return EOF; } void _ttywrch(int ch) { sendchar(ch); } void _sys_exit (int return_code) { label: goto label; }
I've tried several codes and everytime I get the same error. I've also tried the example code from 'The Insiders Guide To The Philips ARM7-Based Microcontrollers' for initializing the UART, which is:
#include "lpc214x.h" void init_serial (void) { PINSEL0 = 0x00050000; U1LCR = 0x00000083; U1DLL = 0x000000C2; U1LCR = 0x00000003; } int putchar (int ch) { if (ch == '\n') { while (!(U1LSR & 0x20)); U1THR = CR } while (!(U1LSR & 0x20)); return (U1THR = ch); } int getchar (void) { while (!(U1LSR & 0x01)); return (U1RBR); }
If I try to compile that, I get the error:
schiet.axf: Error: L6218E: Undefined symbol main (referred from kernel.o).
For my school project I need to get the LPC2148 communicating with a scoreboard. All that I have to get the LPC2148 to do is sending a code to the scoreboard to raise the score with '1' and I need to retrieve it's current score. But I have no ideas left how to get this working.
I hope that I've made my problem clear enough!
Kind regards!
That's true, but, just as I wrote, we've tried different codes, we didn't put them together :-)
And in my previous post I made a slight error. It worked in the debug mode yesterday, then we continued editing the code to make it working from the chip. And that's where it went bad and Keil started giving errors while compiling. Well, today we've been busy trying to correct the code, but we didn't manage to do so, and that's the reason I'm posting my problem on the forum.
Again, you are right Andy, I'm a freshman.