Application Note AC365
November 2014 1
© 2014 Microsemi Corporation
SmartFusion cSoC: Running Webserver, TFTP on
lwIP TCP/IP Stack
Table of Contents
Introduction
The SmartFusion
®
customizable system-on-chip (cSoC) FPGA devices integrate FPGA technology with
the hardened ARM
®
Cortex
®
-M3 processor based microcontroller subsystem (MSS) and programmable
high-performance analog blocks built on a low power flash semiconductor process. The MSS consists of
hardened blocks, such as a 100 MHz ARM Cortex-M3 processor, peripheral DMA (PDMA), embedded
nonvolatile memory (eNVM), embedded SRAM (eSRAM), embedded FlashROM (eFROM), external
memory controller (EMC), watchdog timer, the Philips Inter-Integrated Circuit (I
2
C), serial peripheral
interface (SPI), 10/100 Ethernet controller, real-time counter (RTC), general purpose input/output (GPIO)
block, fabric interface controller (FIC), in-application programming (IAP), and system registers. The
programmable analog block contains the analog compute engine (ACE) and analog front-end (AFE),
consisting of ADCs, DACs, active bipolar prescalers (ABPS), comparators, current monitors, and
temperature monitors.
Ethernet MAC in the SmartFusion cSoC is a high-speed media access control (MAC) Ethernet controller
with the following features:
• Carrier sense multiple access with the collision detection (CSMA/CD) algorithms defined by the
IEEE 802.3 standard.
• Complies with the low-pin-count reduced media independent interface (RMII
™
) specifications.
• In-built DMA controller to move data between the external RAM and TX/RX FIFOs.
For more information about 10/100 Ethernet MAC interface, refer to the SmartFusion Microcontroller
Subsystem User’s Guide.
The lightweight IP (lwIP) stack is an open-source implementation of the TCP/IP stack specially designed
for embedded systems. The lwIP provides networking capability to the SmartFusion-based embedded
systems. This application note describes the porting of the lwIP TCP/IP stack with and without the RTOS
to the SmartFusion cSoC. This application note also demonstrates the lwIP applications such as a
webserver that serves web pages from the SPI Flash with FatFs file system and TFTP server on the
SmartFusion Development Kit Board.
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Introduction to lwIP TCP/IP Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Detailed Description of Porting the lwIP with and without RTOS to SmartFusion cSoC . . . . . . . . . 2
Configuring the lwIP TCP/IP Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
lwIP API Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Detailed Description of the Design Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Release Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Appendix A – Design Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
List of Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20