CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

using CCS TCP/IP stack problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
hello188



Joined: 02 Jun 2010
Posts: 74

View user's profile Send private message

using CCS TCP/IP stack problem
PostPosted: Sun Apr 22, 2012 3:43 am     Reply with quote

Hi, I recently purchased and received Embedded Ethernet Development Kit

I am using MPLAB IDE 8.83 as development environment, and PCH 4.127 person for the CCS compiler.

I coded just as described in the booklet included with the kit, but the project won't compile.

I included tcpip folder(provided by CCS) in the local folder in project directory.





Code:

//////////////////////////////////////////////////////////////////////////////
//
// ex7a.c - Example 7A from the Embedded Internet/Embedded Ethernet tutorial
//
// Displays incoming Ethernet packets over RS232
//
//////////////////////////////////////////////////////////////////////////////
#include <18F4620.h>
#use delay(clock = 20000000)
#use rs232(baud = 9600, xmit = pin_c6, rcv = pin_c7)
#fuses HS, NOWDT, NOLVP, NODEBUG
#define STACK_USE_CCS_PICENS TRUE
#define STACK_USE_MCPENC TRUE
#include "tcpip\stacktsk.c"

void MACDisplayHeader(MAC_ADDR *mac, int8 type) {
   int8 i;
   printf("\r\nMAC: ");
   for (i=0;i<6;i++) {
      printf("%X", mac->v[i]);
      if (i!=5)
         putc(':');
   }
   printf("  PROT:0x08%X ",type);

   if (type==MAC_IP)
      printf("[IP]");
   else if (type==MAC_ARP)
      printf("[ARP]");
}

void main(void) {
   MAC_ADDR mac;
   int8 type;

   printf("\r\n\nCCS TCP/IP TUTORIAL 7A\r\n");
   
   Init();

   MACInit();

   while(TRUE) {
      if (MACGetHeader(&mac, &type)) {
         if (type!=MAC_UNKNOWN) {
            MACDisplayHeader(&mac, type);
         }
      }
   }
}




Below are the error I got

Executing: "C:\Program files\Picc\CCSC.exe" +FH "main.c" +DF +LN +T +A +M +Z +Y=9 +EA
>>> Warning 201 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 189(1,1): Assignment inside relational expression
--- Info 300 "C:\Program Files\PICC\drivers\string.h" Line 408(7,13): More info: First Declaration of strupr
*** Error 31 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 302(1,2): Identifier is already used in this scope
*** Error 48 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 306(7,8): Expecting a (
*** Error 48 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 306(9,10): Expecting a (
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 307(5,10): Expecting a declaration
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 307(10,11): Expecting a declaration
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 307(12,13): Expecting a declaration
*** Error 48 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 307(15,16): Expecting a (
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 307(17,18): Expecting a declaration
*** Error 48 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 307(18,19): Expecting a (
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 307(21,22): Expecting a declaration
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 308(5,6): Expecting a declaration
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 309(9,11): Expecting a declaration
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 309(12,13): Expecting a declaration
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 309(14,15): Expecting a declaration
*** Error 48 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 309(17,18): Expecting a (
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 309(20,23): Expecting a declaration
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 309(24,26): Expecting a declaration
*** Error 48 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 309(29,30): Expecting a (
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 309(32,35): Expecting a declaration
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 309(35,36): Expecting a declaration
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 309(37,38): Expecting a declaration
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 310(13,14): Expecting a declaration
*** Error 48 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 310(16,17): Expecting a (
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 310(19,20): Expecting a declaration
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 310(20,23): Expecting a declaration
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 310(24,25): Expecting a declaration
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 310(26,29): Expecting a declaration
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 310(29,30): Expecting a declaration
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 310(30,31): Expecting a declaration
*** Error 48 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 311(5,6): Expecting a (
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 311(8,9): Expecting a declaration
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 312(5,6): Expecting a declaration
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 313(5,11): Expecting a declaration
*** Error 48 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 313(12,13): Expecting a (
*** Error 43 "D:\Work\Developing\Ethernet\Ex7\tcpip\helpers.c" Line 314(1,2): Expecting a declaration
*** Error 12 "main.c" Line 38(8,9): Undefined identifier -- Init
36 Errors, 1 Warnings.
Halting build on first failure as requested.
BUILD FAILED: Sun Apr 22 01:22:21 2012

Does anybody have an idea??

Thanks
[/code]
Ttelmah



Joined: 11 Mar 2010
Posts: 19546

View user's profile Send private message

PostPosted: Sun Apr 22, 2012 4:15 am     Reply with quote

Looks like the classic MPLAB problem.
In MPLAB, _only_ the main code file, should be in the 'source files' list of files to compile. Ones 'included' in this file, _must not_ be in this list.
MPLAB will try to compile every file in the list in turn. So things like header files, which are not compilable on their own, get sent to the compiler. They can be put under 'header files' in the project list.

Best Wishes
hello188



Joined: 02 Jun 2010
Posts: 74

View user's profile Send private message

PostPosted: Sun Apr 22, 2012 3:05 pm     Reply with quote

Thanks for your response.

I included only my main.c file in the project.

below is link to my entire project folder if you wish to look at it.

http://www.mediafire.com/?yy8pw5cef3za8xt
Thanks
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group