Quantum Leaps - innovating embedded systems Quantum Leaps, LLC
info@quantum-leaps.com
www.state-machine.com

About This Website

Application Note (1.4MB PDF)

This website was served by the lightweight TCP/IP stack called lwIP (version 1.4.0) running on top of the QP™ state machine framework, which are both briefly described below.

The example provides an HTTP server with simple Server Side Include (SSI) and Common Gateway Interface (CGI) capability, so that dynamic web pages can be served and the pages can send data or commands to the target. Internal file system for web pages and a utility (qfsgen.exe) for generating the HTML-files and images is also provided in the QP-lwIP example code.

The lwIP code is initially configured in this example to use DHCP to obtain the IP address, so it assumes the presence of a DHCP server, such as a typical Ethernet router. By modifying the lwipopts.h header file, the application can also be configured to optain the IP address via AUTOIP (as described in RFC 3927), or to use a static IP address. The example also demonstrates UDP. A UDP test application (qudp.exe) for sending and receiving UDP packets (on Windows and Linux hosts) is provided in the QP-lwIP example code.

Please refer to the Quantum Leaps Application Note: "QP and lwIP TCP/IP Stack" for more information. The Application Note in PDF is provided in the QP-lwIP example code.

About the QP-lwIP Integration

QP-lwIP

The QP-lwIP integration has been carefully designed for hard real-time control-type applications, in which the TCP/IP stack is used to monitor and configure the device as well as to provide remote user interface (e.g., by means of a web browser). In particular, The lwIP stack, which is not preemptive, is strictly encapsulated inside a dedicated active object (LwIP-Manager), so no interrupt locking is necessary, which critical for low interrupt latency. Also, the Ethernet interrupt service routine (ISR) runs very fast and only signals the task level (the ISR does not perform lengthy copy operations at all). This means that hard-real-time processing can be done at the task level, especially when you use a preemptive QK kernel for executing your QP™ application.

The QP-lwIP integration has been also carefully designed for portability. All hardware-specific code is clearly separated in the Ethernet/lwIP device driver with the clean interface to the rest of the application.

About QP State Machine Frameworks

QP datasheet (1.4MB PDF)

QP™ is a family of very lightweight, open source, state machine-based frameworks for embedded microprocessors, microcontrollers, and DSPs. QP enables developing well-structured embedded applications as a set of concurrently executing hierarchical state machines (UML statecharts). With QP, coding of modern state machines directly in C or C++ is a non-issue. No big design automation tools are needed.

Practical UML Statecharts in C/C++, 2nd Ed.

Current versions of QP are: QP/C™ and QP/C++™, which require about 4KB of code and a few hundred bytes of RAM, and the ultra-lightweight QP-nano, which requires only 1-2KB of code and just several bytes of RAM.

QP can work with or without a traditional OS/RTOS. In the standalone configuration, QP can completely replace a traditional RTOS. QP includes a simple non-preemptive scheduler and a fully preemptive kernel (QK). The QP/C and QP/C++ frameworks can also work with a traditional OS/RTOS to take advantage of existing device drivers, communication stacks, and other middleware.

All versions of QP are described in detail in the book Practical UML Statecharts in C/C++, Second Edition: Event-Driven Programming for Embedded Systems by Dr. Miro Samek, (ISBN: 978-0750687065). QP has a strong user community and has been applied worldwide by some of the largest companies in their respective industries, such as: consumer electronics, telecommunications equipment, industrial automation, transportation systems, medical devices, national defense, and many more.

QP is licensed under the GPL version 2 open source license as well as under commercial closed-source licenses, which are expressly designed for users, who wish to retain the proprietary character of their code. More information about QP licensing can be found at http://www.state-machine.com/licensing.

About lwIP TCP/IP Stack

SICS--home of lwIP

lwIP is a light-weight implementation of the TCP/IP protocol suite that was originally written by Adam Dunkels at the Computer and Networks Architectures (CNA) lab of the Swedish Institute of Computer Science but now is being actively developed by a team of developers distributed world-wide headed by Kieran Mansley.

lwIP is available under a BSD-style open source license in C source code format and can be downloaded from the development homepage at http://savannah.nongnu.org/projects/lwip. The focus of the lwIP is to reduce the RAM usage while still having a full scale TCP/IP implementation. This makes lwIP suitable for use in embedded systems with tens of kilobytes of RAM and around 40 KB of code ROM.

Since its release, lwIP has spurred a lot of interest and is today being used in many commercial products. lwIP has been ported to multiple platforms and operating systems and can be run either with or without an underlying OS. lwIP includes the following protocols and features: