Free (GPLv2) TCP/IP stack developed by TASS Belgium

Dependents:   lpc1768-picotcp-demo ZeroMQ_PicoTCP_Publisher_demo TCPSocket_HelloWorld_PicoTCP Pico_TCP_UDP_Test ... more

PicoTCP. Copyright (c) 2013 TASS Belgium NV.

Released under the GNU General Public License, version 2.

Different licensing models may exist, at the sole discretion of the Copyright holders.

Official homepage: http://www.picotcp.com

Bug tracker: https://github.com/tass-belgium/picotcp/issues

Development steps:

  • initial integration with mbed RTOS
  • generic mbed Ethernet driver
  • high performance NXP LPC1768 specific Ethernet driver
  • Multi-threading support for mbed RTOS
  • Berkeley sockets and integration with the New Socket API
  • Fork of the apps running on top of the New Socket API
  • Scheduling optimizations
  • Debugging/benchmarking/testing

Demo application (measuring TCP sender performance):

Import programlpc1768-picotcp-demo

A PicoTCP demo app testing the ethernet throughput on the lpc1768 mbed board.

Files at this revision

API Documentation at this revision

Comitter:
tass
Date:
Wed Aug 28 14:45:01 2013 +0000
Parent:
48:40fc4462265c
Child:
87:d45bc027b06d
Commit message:
enabled debug in tcp module + changed some debug strings, added prescaler to time functions

Changed in this revision

EthernetInterface/EthernetInterface.cpp Show annotated file Show diff for this revision Revisions of this file
include/arch/pico_mbed.h Show annotated file Show diff for this revision Revisions of this file
modules/pico_tcp.c Show annotated file Show diff for this revision Revisions of this file
--- a/EthernetInterface/EthernetInterface.cpp	Fri Aug 02 07:28:05 2013 +0000
+++ b/EthernetInterface/EthernetInterface.cpp	Wed Aug 28 14:45:01 2013 +0000
@@ -76,11 +76,11 @@
     gateway = pico_dhcp_get_gateway(id);
     //if (address) ? // still needed
     pico_ipv4_to_string(ip_addr, address.addr);
-    printf("IP assigned : %s\n",ip_addr);
+    //printf("IP assigned : %s\n",ip_addr);
     
     if (gateway.addr != 0) {
         pico_ipv4_to_string(gw_addr, gateway.addr);
-        printf("Default gateway assigned : %s\n",gw_addr);
+        //printf("Default gateway assigned : %s\n",gw_addr);
         pico_ipv4_route_add(zero, zero, gateway, 1, NULL);
     }
 
--- a/include/arch/pico_mbed.h	Fri Aug 02 07:28:05 2013 +0000
+++ b/include/arch/pico_mbed.h	Wed Aug 28 14:45:01 2013 +0000
@@ -61,15 +61,16 @@
 
 
 extern uint32_t os_time;
+extern uint32_t prescale_time;
 
 static inline unsigned long PICO_TIME(void)
 {
-  return (unsigned long)os_time / 1000;
+  return (unsigned long)(os_time / 1000 >> prescale_time);
 }
 
 static inline unsigned long PICO_TIME_MS(void)
 {
-  return (unsigned long)os_time;
+  return (unsigned long)(os_time >> prescale_time);
 }
 
 static inline void PICO_IDLE(void)
--- a/modules/pico_tcp.c	Fri Aug 02 07:28:05 2013 +0000
+++ b/modules/pico_tcp.c	Wed Aug 28 14:45:01 2013 +0000
@@ -16,6 +16,7 @@
 #include "pico_queue.h"
 #include "pico_tree.h"
 
+#include "PicoTerm.h"
 #define TCP_SOCK(s) ((struct pico_socket_tcp *)s)
 #define SEQN(f) (f?(long_be(((struct pico_tcp_hdr *)(f->transport_hdr))->seq)):0)
 #define ACKN(f) (f?(long_be(((struct pico_tcp_hdr *)(f->transport_hdr))->ack)):0)
@@ -48,8 +49,8 @@
 #define tcp_dbg_options(...) do{}while(0)
 
 
-#define tcp_dbg(...) do{}while(0)
-//#define tcp_dbg dbg
+//#define tcp_dbg(...) do{}while(0)
+#define tcp_dbg ptm_dbg
 
 
 #ifdef PICO_SUPPORT_MUTEX
@@ -1251,7 +1252,7 @@
   if( t->sock.net && ((t->sock.state & 0xFF00) == PICO_SOCKET_STATE_TCP_ESTABLISHED
         || (t->sock.state & 0xFF00) == PICO_SOCKET_STATE_TCP_CLOSE_WAIT) )
   {
-        tcp_dbg("\n\nTIMEOUT! backoff = %d\n", t->backoff);
+        tcp_dbg("TIMEOUT! backoff = %d\n", t->backoff);
         /* was timer cancelled? */
         if (t->timer_running == 0) {
             add_retransmission_timer(t, 0);
@@ -1398,7 +1399,7 @@
     tcp_dbg("%08x %d%s\n", cur, cur_f->payload_len, info);
 
   }
-  tcp_dbg("SND_NXT is %08x, snd_LAST is %08x", nxt, t->snd_last);
+  tcp_dbg("SND_NXT is %08x, snd_LAST is %08x\n", nxt, t->snd_last);
   tcp_dbg("===================================\n");
   tcp_dbg("\n\n");
 }
@@ -1552,7 +1553,7 @@
 
 static int tcp_finwaitack(struct pico_socket *s, struct pico_frame *f)
 {
-  tcp_dbg("RECEIVED ACK IN FIN_WAIT1\nTCP> IN STATE FIN_WAIT2\n");
+  tcp_dbg("RECEIVED ACK IN FIN_WAIT1\n TCP> IN STATE FIN_WAIT2\n");
 
   /* acking part */
   tcp_ack(s,f);
@@ -1983,7 +1984,7 @@
 static void tcp_send_keepalive(unsigned long when, void *_t)
 {
   struct pico_socket_tcp *t = (struct pico_socket_tcp *)_t;
-  tcp_dbg("\n\nSending keepalive (%d), [State = %d]...\n", t->backoff,t->sock.state );
+  tcp_dbg("Sending keepalive (%d), [State = %d]...\n", t->backoff,t->sock.state );
   if( t->sock.net && ((t->sock.state & 0xFF00) == PICO_SOCKET_STATE_TCP_ESTABLISHED) )
   {
         tcp_send_ack(t);