Tcp/ip stack over ethernet interface problem


#1

Hi all,
I need to implement to transfer data using Tcp client. I use ENC28J60 connect to Q2687 module. I use SPI no.1 of Q2687 to interface ENC28J60, GPIO35, GPIO19 of Q2687 connect to CS pin, Reset pin of ENC28J60. I port Tcp_client and Ethernet example to Q2687 module. My problem are:

  • ENC28J60 is initialized but IP address of system isn’t configured If I tried setting WIP_BOPT_IP_DHCP to TRUE at wip_bearerSetOpts function in open_and_start_bearer(cfg_eth.c)–
26/03/2012 15:59:45.516 : <COM1> [ENC28J60] : opening IESM driver
26/03/2012 15:59:45.531 : <COM1> [ENC28J60] : MAC address read: 00-04-a3-01-01-01
26/03/2012 15:59:45.531 : <COM1> [ENC28J60] : subscribe to driver
26/03/2012 15:59:45.531 : <COM1> [ENC28J60] register: SPI=1 CS=00003023 EXTINT=0
26/03/2012 15:59:45.531 : <COM1> [ENC28J60]           RST=00003013 PWR=00003014
26/03/2012 15:59:45.547 : <COM1> [ENC28J60] spi_01_Master_MaxFreqClock=13000 , Clk_Speed=0
26/03/2012 15:59:45.547 : <COM1> [ENC28J60] : driver subscription successful
26/03/2012 15:59:45.547 : <COM1> open_and_start_bearer
26/03/2012 15:59:45.547 : <COM1> [ENC28J60] : io_ctrl : MAC address read: 00-04-a3-01-01-01
26/03/2012 15:59:45.562 : <COM1> [ETHER]: open: -> DISCONNECTED
26/03/2012 15:59:45.562 : <COM1> [ENC28J60] init
26/03/2012 15:59:45.703 : <COM1> [ENC28J60] mac address: 00:04:a3:01:01:01
26/03/2012 15:59:45.703 : <COM1> [ENC28J60] set half-duplex
26/03/2012 15:59:45.734 : <COM1> [ETHER]: start: -> CONNECTING
26/03/2012 15:59:45.734 : <COM1> Ethernet bearer started,
26/03/2012 15:59:45.734 : <COM1> MAC address: 00-04-a3-01-01-01
26/03/2012 15:59:45.750 : <COM1> [ETHER]: IP UP -> CONNECTING
26/03/2012 15:59:46.219 : <COM1> [ENC28J60] link status: 4
26/03/2012 15:59:46.219 : <COM1> [ETHER]: LINK STATUS: 1
26/03/2012 15:59:46.719 : <COM1> [ENC28J60] tx watchdog
26/03/2012 15:59:49.219 : <COM1> [ENC28J60] tx watchdog
  • If I tried setting WIP_BOPT_IP_DHCP to FALSE at wip_bearerSetOpts function in open_and_start_bearer(cfg_eth.c)– System use IP address what I configure but no connected to my server-
26/03/2012 15:57:15.016 : <COM1> Exception opening port : ie_Open - device already open
26/03/2012 15:57:29.297 : <COM1> [ENC28J60] tx watchdog
26/03/2012 15:57:30.297 : <COM1> [ENC28J60] tx watchdog
26/03/2012 15:57:31.297 : <COM1> [ENC28J60] tx watchdog
26/03/2012 15:57:36.250 : <COM1> [ENC28J60] : opening IESM driver
26/03/2012 15:57:36.266 : <COM1> [ENC28J60] : MAC address read: 00-04-a3-01-01-01
26/03/2012 15:57:36.266 : <COM1> [ENC28J60] : subscribe to driver
26/03/2012 15:57:36.266 : <COM1> [ENC28J60] register: SPI=1 CS=00003023 EXTINT=0
26/03/2012 15:57:36.266 : <COM1> [ENC28J60]           RST=00003013 PWR=00003014
26/03/2012 15:57:36.281 : <COM1> [ENC28J60] spi_01_Master_MaxFreqClock=13000 , Clk_Speed=0
26/03/2012 15:57:36.281 : <COM1> [ENC28J60] : driver subscription successful
26/03/2012 15:57:36.281 : <COM1> open_and_start_bearer
26/03/2012 15:57:36.281 : <COM1> [ENC28J60] : io_ctrl : MAC address read: 00-04-a3-01-01-01
26/03/2012 15:57:36.297 : <COM1> [ETHER]: open: -> DISCONNECTED
26/03/2012 15:57:36.297 : <COM1> [ENC28J60] init
26/03/2012 15:57:36.437 : <COM1> [ENC28J60] mac address: 00:04:a3:01:01:01
26/03/2012 15:57:36.437 : <COM1> [ENC28J60] set half-duplex
26/03/2012 15:57:36.453 : <COM1> [ETHER]: start: -> CONNECTED
26/03/2012 15:57:36.453 : <COM1> Ethernet bearer started,
26/03/2012 15:57:36.453 : <COM1> MAC address: 00-04-a3-01-01-01
26/03/2012 15:57:36.469 : <COM1> *** Ethernet bearer configuration ***
26/03/2012 15:57:36.469 : <COM1> Local: 192.168.1.10 Netmask: 255.255.255.0
26/03/2012 15:57:36.469 : <COM1> Default gateway: 192.168.1.1
26/03/2012 15:57:36.469 : <COM1> DNS1: 0.0.0.0 DNS2: 0.0.0.0
26/03/2012 15:57:36.484 : <COM1> [SAMPLE]: connecting to client 192.168.1.19:8000...
26/03/2012 15:57:36.484 : <COM1> [WIP] new TCPCLIENT 0x180c8214
26/03/2012 15:57:36.484 : <COM1> [ETHER]: IP UP -> CONNECTING
26/03/2012 15:57:36.484 : <COM1> [ETHER]: IP UP -> CONNECTED
26/03/2012 15:57:36.484 : <COM1> *** Ethernet bearer configuration ***
26/03/2012 15:57:36.500 : <COM1> Local: 192.168.1.10 Netmask: 255.255.255.0
26/03/2012 15:57:36.500 : <COM1> Default gateway: 192.168.1.1
26/03/2012 15:57:36.500 : <COM1> DNS1: 0.0.0.0 DNS2: 0.0.0.0
26/03/2012 15:57:36.500 : <COM1> [SAMPLE]: connecting to client 192.168.1.19:8000...
26/03/2012 15:57:36.516 : <COM1> [WIP] new TCPCLIENT 0x180c8294
26/03/2012 15:57:36.953 : <COM1> [ENC28J60] link status: 4
26/03/2012 15:57:36.953 : <COM1> [ETHER]: LINK STATUS: 1
26/03/2012 15:57:37.453 : <COM1> [ENC28J60] tx watchdog
26/03/2012 15:57:38.453 : <COM1> [ENC28J60] tx watchdog
26/03/2012 15:57:39.453 : <COM1> [ENC28J60] tx watchdog
26/03/2012 15:57:40.437 : <COM1> [ENC28J60] tx watchdog
26/03/2012 15:57:41.437 : <COM1> [ENC28J60] tx watchdog

I see that in 2 case link status report is:
[ENC28J60] link status: 4
[ETHER]: LINK STATUS: 1

I don’t understand this status because code block have report it is package in WIP library and this status isn’t described in any document of Seirra Wireless. I read many thread in Seirra Wireless forum, but I don’t have information about these problem and when I read help document of Develop studio, I see:
” This WIP sample application initializes the TCP/IP stack, either over PPP (UART or GSM) client/server, or over GPRS. Its configuration is tuned by customizing the following defines at the beginning of cfg_gprs.c for a GPRS connection, or at cfg_uart_client/server.c for a PPP over UART, or at cfg_gsm_client/server.c for a PPP over GSM DATA:
• OVER_UART_PPP_CLIENT / OVER_UART_PPP_SERVER / OVER_GSM_PPP_CLIENT / OVER_GSM_PPP_SERVER / OVER_GPRS, in appli.c: exactly one of these macros has to be defined, to decide which connection mode is selected” .
I think TCP/IP stack of Open AT don’t run well over Ethernet interface.

Version of firmware of module is R7.46.0.201108091301, version of OpenAT Embedded Software Suite is 2.35.0.201103111042.
Could you help me information about Ethernet on Q2687 module to solve these problem.

Thanks and best regards,


#2

Hi,

Seems like you are not using the Sierra Wireless Ethernet Expansion card (FXTE02) and unfortunately I do not have both the expansion card nor the ENC28J60 with me…

But I don’t think it is not supported over Ethernet interface.

For your information, I think the definition for “[ENC28J60] link status: 4” can be found in resources\WIP\itf\wip_eth.h.

For first case, using DHCP, can you check if any DHCP request was sent from the Ethernet chip?

For second case, using static IP, TCPClient was created before Link status event, I am not sure if that’s the problem, can you try to add short delay before creating TCPClient?

Hope this helps.
Thx.


#3

From memory link status 4 is disconnected, 1 – connected.

How do you connect?
If you connect directly to PC, you have to use cross-over cable.
Also, ENC28J60 is 10MBits half-duplex. If you other end is not negotiating properly…

Rudolf


#4

If you are still having trouble getting the ethernet working then ClearComm might be a good alternative. It bundles all of OpenAT’s ethernet functinality in a single applicaiton: clearconnex.com/content/clearcomm