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.

Committer:
tass
Date:
Thu Dec 05 08:31:32 2013 +0000
Revision:
128:ae39e6e81531
Parent:
114:36bdc244be23
Child:
142:35da43068894
updated repo to work with uint64 tick.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tass 6:55b47464d5bc 1 #include <mbed.h>
tass 6:55b47464d5bc 2 #include <rtos.h>
tass 6:55b47464d5bc 3
tass 6:55b47464d5bc 4 extern "C" {
tass 89:49ca05d9a19e 5 #include "pico_config.h"
tass 128:ae39e6e81531 6
tass 128:ae39e6e81531 7 uint64_t local_time;
tass 128:ae39e6e81531 8 uint32_t last_os_time;
tass 128:ae39e6e81531 9
tass 6:55b47464d5bc 10 void *pico_mutex_init(void)
tass 6:55b47464d5bc 11 {
tass 6:55b47464d5bc 12 return new Mutex();
tass 6:55b47464d5bc 13 }
tass 6:55b47464d5bc 14
tass 6:55b47464d5bc 15 void pico_mutex_lock(void *_m)
tass 6:55b47464d5bc 16 {
tass 6:55b47464d5bc 17 Mutex *m = (Mutex *)_m;
tass 6:55b47464d5bc 18 m->lock();
tass 6:55b47464d5bc 19 }
tass 6:55b47464d5bc 20
tass 6:55b47464d5bc 21 void pico_mutex_unlock(void *_m)
tass 6:55b47464d5bc 22 {
tass 6:55b47464d5bc 23 Mutex *m = (Mutex *)_m;
tass 6:55b47464d5bc 24 m->unlock();
tass 6:55b47464d5bc 25 }
tass 89:49ca05d9a19e 26
tass 89:49ca05d9a19e 27
tass 89:49ca05d9a19e 28 #ifdef PICO_MEASURE_STACK
tass 113:f2f9b678d3fe 29 int freeStack = STACK_TOTAL_WORDS;
tass 89:49ca05d9a19e 30 void stack_fill_pattern(void * ptr)
tass 89:49ca05d9a19e 31 {
tass 89:49ca05d9a19e 32 int * movingPtr = (int *)ptr;
tass 89:49ca05d9a19e 33 int * finalPtr = movingPtr - STACK_TOTAL_WORDS;
tass 108:1377967f703e 34 while(movingPtr >= finalPtr)
tass 89:49ca05d9a19e 35 {
tass 89:49ca05d9a19e 36 *movingPtr = STACK_PATTERN;
tass 89:49ca05d9a19e 37 movingPtr--;
tass 89:49ca05d9a19e 38 }
tass 6:55b47464d5bc 39 }
tass 89:49ca05d9a19e 40
tass 89:49ca05d9a19e 41 void stack_count_free_words(void *ptr)
tass 89:49ca05d9a19e 42 {
tass 89:49ca05d9a19e 43 int * movingPtr = (int *)ptr;
tass 108:1377967f703e 44 int * finalPtr = movingPtr - STACK_TOTAL_WORDS;
tass 114:36bdc244be23 45 int tmpFreeStack = 0;
tass 89:49ca05d9a19e 46
tass 89:49ca05d9a19e 47 while(finalPtr != movingPtr)
tass 89:49ca05d9a19e 48 {
tass 89:49ca05d9a19e 49 if(*finalPtr != STACK_PATTERN)
tass 89:49ca05d9a19e 50 break;
tass 114:36bdc244be23 51 tmpFreeStack++;
tass 89:49ca05d9a19e 52 finalPtr++;
tass 89:49ca05d9a19e 53 }
tass 114:36bdc244be23 54 freeStack = tmpFreeStack;
tass 89:49ca05d9a19e 55 }
tass 89:49ca05d9a19e 56
tass 89:49ca05d9a19e 57 int stack_get_free_words(void)
tass 89:49ca05d9a19e 58 {
tass 89:49ca05d9a19e 59 return freeStack;
tass 89:49ca05d9a19e 60 }
tass 89:49ca05d9a19e 61
tass 89:49ca05d9a19e 62 #endif
tass 89:49ca05d9a19e 63
tass 89:49ca05d9a19e 64 }