PicoTCP is a fully featured and highly portable TCP/IP stack for low-end microcontrollers. It focuses on modularity, portability, performance and quality. Licensing is GPLv2 and proprietary dual-licensed, copyright owned by TASS.
Modularity: all modules (except core) are optional, e.g. DNS, 0MQ, HTTP, … . Complete stack for cortex-M is 68K, minimal IPv4 + TCP + UDP is 30K. Modules are selected with make variables. RAM size can be configured with buffersizes, which trade off size vs. throughput.
Portability: runs on 8- to 64-bit archs, EB or LE, with/without OS, already works on 10+ platforms, through OS abstraction layer (of mutexes, threads and blocking). Also portable to communication chips: wifi, ethernet, USB CDC, (tun/tap, libpcap for testing).
Quality: CI, automated testing, Tiobe TiCS quality label C. Literal implementation of RFCs.
Community on github, free to fork (GPLv2).
How to port:
- Implement malloc/free – custom PicoTCP memory manager is underway.
- Implement PICO_TIME_MS and PICO_TIME that implement elapsed time; basic implementation: timer interrupt increments 64-bit int every millisecond.
- Driver API: struct pico_device with send, poll and destroy functions. Often the platform vendor already has low-level drivers, so just wrap these functions together with some pico boilerplate.
Demo of MIDI keyboard that is connected to a PIC controller that puts it on a microchip Wifi channel over 0MQ protocol. On a PC, this goes into fluidsynth to synthesise it.