| View previous topic :: View next topic |
| Author |
Message |
isalem
Joined: 02 Nov 2009 Posts: 12 Location: Amman - Jordan
|
Posted: Sat Nov 07, 2009 2:06 pm Post subject: __Write1USART:0 |
|
|
Hello,
my first post in the forum wasn't that good, no replies, so here I am giving myself another chance...
I've managed to fix up everything related to the PIC, but i can't seem to find a solution for one single thing:
Every time i try to compile the demo code up again on my PIC-GSM kit (TCPIP Demo App, C18 Compiler), i get the following error:
| Code: | ...
MPLINK 4.33, Linker
Copyright (c) 2009 Microchip Technology Inc.
Error - could not find definition of symbol '__Write1USART:0' in file 'Objects - TCPIP Demo App-C18\gsm-hw.o'.
Errors : 1
Link step failed.
----------------------------------------------------------------------
Release build of project `C:\Microchip Solutions\TCPIP Demo App\TCPIP Demo App-C18.mcp' failed.
Language tool versions: mpasmwin.exe v5.33, mplink.exe v4.33, mcc18.exe v3.33
Sat Nov 07 22:58:47 2009
----------------------------------------------------------------------
BUILD FAILED
|
can you please direct me to a solution if I'm doing something wrong??
Thank you and i really appreciate it...  |
|
| Back to top |
|
 |
angelsix
Joined: 07 May 2009 Posts: 376
|
Posted: Mon Nov 09, 2009 1:46 am Post subject: |
|
|
You are trying to find a function that is not in your code called Write1USART. Check your gsm-hw.c code file for a function called that, and if it does exist, then make sure you do a Build->Clean before building again and see if it goes away.
If the function isn't there, check where you are actually using the function and see if maybe it's just misspelt and there is a function in the code file called something similar (perhaps WriteUSART) |
|
| Back to top |
|
 |
isalem
Joined: 02 Nov 2009 Posts: 12 Location: Amman - Jordan
|
Posted: Mon Nov 09, 2009 5:11 am Post subject: |
|
|
thanx for the reply...
this is the error that is produced by the demo code provided by olimex themselves for the PIC-GSM... everytime i try to compile the code i get this error...
i checked the gsm-hw.c, the only thing referring to the problematic function is the function: putc1USART(); which, after tracing turned out to be a macro of the same write1USART(); function in the file usart.h file provided with the C18 Compiler...
the problem is, this is the function that transmits the commands to the GSM module everytime a call is made or a SMS is sent... so, i'm kind of lost here...
If you or anyone can help me, i will really appreciate it...
CheerZ! |
|
| Back to top |
|
 |
angelsix
Joined: 07 May 2009 Posts: 376
|
Posted: Mon Nov 09, 2009 5:45 am Post subject: |
|
|
| If you send me the code sample or upload it here I can take a look |
|
| Back to top |
|
 |
isalem
Joined: 02 Nov 2009 Posts: 12 Location: Amman - Jordan
|
|
| Back to top |
|
 |
angelsix
Joined: 07 May 2009 Posts: 376
|
Posted: Mon Nov 09, 2009 7:19 am Post subject: |
|
|
I think they have just screwed up their #define code. To test that just comment out line 301 in gsm-hw.c and uncomment the line below so it looks like this:
//putc1USART(c);
write1USART(c);
Then in the uart.h delete the following line:
#define putc1USART Write1USART
And see what error you get if any. |
|
| Back to top |
|
 |
isalem
Joined: 02 Nov 2009 Posts: 12 Location: Amman - Jordan
|
Posted: Mon Nov 09, 2009 8:12 am Post subject: |
|
|
hello,
before i commented out the define statement, i got the same error but without the underscores before the symbol... but i still get the same error... i really don't know what they did in their code!!
Error - could not find definition of symbol '__Write1USART:0' in file 'Objects - TCPIP Demo App-C18\gsm-hw.o'.
and i'm sorry i got you into my problems... I really appreciate your help... |
|
| Back to top |
|
 |
angelsix
Joined: 07 May 2009 Posts: 376
|
Posted: Mon Nov 09, 2009 9:30 am Post subject: |
|
|
When I look at the code (I dont have a C compiler installed at the moment) you have all the header files for USART, yet not actual code files, so I presume they are default as part of the environment or compiler.
The header files however do define the functions so it should find it, or at least the Write1USART function, as its right there at the top of the usart header file.
Do you perhaps have the code files for this usart function, and if not maybe that is the reason why.. there are no entry points for the function if you dont have the actual code files. |
|
| Back to top |
|
 |
isalem
Joined: 02 Nov 2009 Posts: 12 Location: Amman - Jordan
|
Posted: Mon Nov 09, 2009 9:43 am Post subject: |
|
|
hello angelsix,
i think i have all the reqiured codes and librares pre installed with the C 18 Compiler in the folder MCC18, also, a quick search on my PC turned out the file USART.h also in the MCC18\h folder, there is a SRC folder as well, with a complete folder especially for USART,
also, a file called u1write.c in the same folder:
| Code: |
#include <p18cxxx.h>
#include <usart.h>
/********************************************************************
* Function Name: Write1USART *
* Return Value: none *
* Parameters: data: data to transmit *
* Description: This routine transmits a byte out the USART1. *
********************************************************************/
#if defined (AUSART_V2) || defined (EAUSART_V6)|| defined (EAUSART_V7) ||\
defined (EAUSART_V8) || defined (EAUSART_V9) || defined (EAUSART_V10) ||\
defined (EAUSART_V11)
void Write1USART(char data)
{
if(TXSTA1bits.TX9) // 9-bit mode?
{
TXSTA1bits.TX9D = 0; // Set the TX9D bit according to the
if(USART1_Status.TX_NINE) // USART1 Tx 9th bit in status reg
TXSTA1bits.TX9D = 1;
}
TXREG1 = data; // Write the data byte to the USART2
}
#endif
|
shall i try to include this file as well in my code somewhere?? since the compiler isnt finding any relation to the function?
Awaiting your reply... |
|
| Back to top |
|
 |
isalem
Joined: 02 Nov 2009 Posts: 12 Location: Amman - Jordan
|
Posted: Mon Nov 09, 2009 9:48 am Post subject: |
|
|
A Quick look into the folder i'm talking about:
 |
|
| Back to top |
|
 |
isalem
Joined: 02 Nov 2009 Posts: 12 Location: Amman - Jordan
|
Posted: Mon Nov 09, 2009 10:45 am Post subject: |
|
|
Just a quick note to add:
OLIMEX just replied to me noting that they compile the code normally...
They use v3.22 Compiler version, so i have to look for that one now... i also contacted microchip to see if i can find a link through their support directly...
Lets always think positive ... i like doing that... i hope i find something...
Can someone help me by providing the file or a link to it if he/she has it?
Thanx for all |
|
| Back to top |
|
 |
isalem
Joined: 02 Nov 2009 Posts: 12 Location: Amman - Jordan
|
Posted: Mon Nov 09, 2009 12:19 pm Post subject: |
|
|
SOLVED !!!!
After some fiddling around the net... i found a good ol' rapidshare link with the old 3.1 compiler, then just upgraded it to 3.2 from microchip's site, and all is fine now!!
i don't know... how can a code only work on a deprecated version of a compiler if the new one is supposed to fix all its bugs!!??? |
|
| Back to top |
|
 |
|