This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: waiting for proposal. (TCP/IP stack used in ARM E7T board) Thanks a lot! ( Can I control the ethernet driver directly? I want to send out some testing ethernet frame instead of the IP package)


Thanks for your reply. but unfortunately the whole system doesn't work. the
following is the example code I use for testing:

What I am trying to do is: try to luminize the the LED to "1" on the ARM E7T
board at the beginning of the program. and try to change it to "3" when a
connection from remote computer comes.  Is there any possible way for me to
control the ethernet driver directly (for testing, just want to send some
ethernet frame out onto the ethernet link)? any ethernet driver functions I
can use in the app? Thanks a lot!


#include "lwip/sys.h"
#include "lwip/api.h"

#define IOPDATA	(volatile unsigned int*)(0x7ff0000 + 0x5008)

/*--------------------------------------------------------------------------
---------*/
static void
tcpecho_thread(void *arg)
{
  struct netconn *conn, *newconn;
  err_t err;

  /* Create a new connection identifier. */
  conn = netconn_new(NETCONN_TCP);

  /* Bind connection to well known port number 7. */
  netconn_bind(conn, NULL, 7);

  /* Tell connection to go into listening mode. */
  netconn_listen(conn);
	*IOPDATA = 0xbc00;

  while(1) {

    /* Grab new connection. */
    newconn = netconn_accept(conn);
    /*printf("accepted new connection %p\n", newconn);*/
    /* Process the new connection. */
    if(newconn != NULL) {
      struct netbuf *buf;
      void *data;
      u16_t len;

      while((buf = netconn_recv(newconn)) != NULL) {
	/*printf("Recved\n");*/
	do {
	  netbuf_data(buf, &data, &len);
	  err = netconn_write(newconn, data, len, NETCONN_COPY);
	  if(err != ERR_OK) {
	    /*	    printf("tcpecho: netconn_write: error \"%s\"\n",
lwip_strerr(err));*/
	  }
	} while(netbuf_next(buf) >= 0);
	netbuf_delete(buf);
      }
      /*printf("Got EOF, looping\n");*/
      /* Close connection and discard connection identifier. */
      netconn_delete(newconn);
    }
  }
}
/*--------------------------------------------------------------------------
---------*/
int
main(void)
{
  *IOPDATA = 0x1800;

  lwip_init();
  sys_thread_new(tcpecho_thread, (void*)"tcpecho");
  return 0;
}
/*--------------------------------------------------------------------------
---------*/





-----Original Message-----
From: Jani Monoses [mailto:jani@iv.ro]
Sent: 18 June 2002 14:33
To: jameshq
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] waiting for proposal. (TCP/IP stack used in ARM E7T
board) Thanks a lot!



> Dear all:
>     I am currently on a project to building a system with TCP/IP
networking
> functionality.  What I am planning to do is: ARM E7T board, PHY board with
> ICS1892,  and KS3C4510 ethernet driver developed by Grant Edwards. and
light
> weight TCP/IP stack: lwip  I have already built the ecos library as:  ARM
> E7T template, default, common ethernet support,  deselect "support for

You could try pinging the board for start...if that works then you can go on
to test it further...make sure you configured valid IP address and gateway
address
for it in the configtool.Put it in your local network (same netmask etc)

Jani.


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]