Building and Running the Sample Application

This section describes all the steps required to build a TCPIP-based application. The instructions provided in this section are not intended for any particular toolchain, but instead are described in a generic way that can be adapted to any toolchain.

The best way to start building a TCPIP-based project is to start from an existing project. If you are using µC/OS-II or µC/OS-III, Micrium provides example projects for multiple development boards and compilers. If your target board is not listed on Micrium’s web site, you can download an example project for a similar board or microcontroller.

Working project with RTOS

The first step before including the µC/TCP-IP stack is to have a working project with the RTOS of your choice. As previously mentioned, Micriµm offers starting example with the µC/OS-II and µC/OS-III kernels for many evalboards. 

Including Additional Modules to the Project

Once you have a working project with your RTOS, additional modules are needed by the Micriµm TCP/IP stack that are not necessarily already included in your project. Therefore, be sure to add µC/CPU, µC/LIB and µC/Common to your project.  

Bear in mind to include the required paths associated with those modules to your project’s C compiler settings.

Including the Board Support Package (BSP)

In order for the network device driver to remain hardware independent, µC/TCPIP requires a BSP abstraction layer to implement such things as configuring clocks, interrupt controllers, general-purpose input/ouput (GPIO) pins. Inside your project folder tree, under the board name, you should already have a BSP folder. Boards for which TCPIP application have been develop should have a TCPIP folder inside the BSP directory. You can add this directory to your project tree. If your board does not have such a folder, you would have to write your own BSP for the network device driver. Refer to section Network Board Support Package for more details on how to write a BSP for µC/TCP-IP. Micrium offers template files inside the BSP folder in the µC/TCP-IP source code distribution to get you started with your own BSP. However, we recommend starting with a working configuration from an example project for your network device. Micrium might have some projects available only for internal usage, so if no working project are found online, please ask at support@micrium.com for a BSP file example specific for your network device.

Afterwards, add a path leading to the following include paths to your project’s C compiler settings:

\Micrium\Software\EvalBoards\<manufactuer>\<boardname>\BSP\TCPIP

Including TCP-IP Stack Source Code

The µC/TCP-IP files to include in your project depends on the network interface(s) presents on your development board. Therefore, the complete files list we will be presented inside each following sub-sections associated with an interface type.

Ethernet Interface Setup

Wi-Fi Interface Setup

Copying and Modifying Template Files

Copy the files from the uC-TCPIP configuration folder into your application as illustrated in  Figure - Copying Template Files .


Figure - Copying Template Files



net_cfg.c is a configuration file including the NET_TASK_CFG objects used to configured the µC/TCP-IP internal tasks. The µC/TCP-IP stack has three internal tasks : the Receive task, the Transmit De-allocation task and the Timer task. Each task as its own NET_TASK_CFG object defining the task priority, the task's stack size and the pointer to start of task stack. Refer to  section Network Tasks Configuration for more details on the µC/TCP-IP tasks configuration.


net_cfg.h is a configuration file used to setup µC/TCP-IP stack static parameters such as the number of available sockets, TCP connections and network timers, the ARP and NDP parameters, the number of configurable interface and so on. Refer to section Static Stack Configuration  for more details on all the configurations inside net_cfg.h

net_dev_cfg.c and net_dev_cfg.h are configuration files used to set the wired or wireless device interface parameters such as the number and size of network buffers available for transmission and reception and the base address of the device's registers. They also include the PHY parameters such as the PHY bus mode (RMII or MII) in the case of a wired Ethernet device.

Since the device configuration is different depending if your interface is wired or wireless, the details on the device configuration modifications will be shown in the corresponding sub-sections. 

Modifying the Application Configuration Files

The µC/TCP-IP stack uses additional heap memory space. Therefore, it is possible that your example application will require more allocation of heap memory. If ti is the case, you can increase the value of the #define LIB_MEM_CFG_HEAP_SIZE inside the lib_cfg.h file of your example project. You can refer to section LIB Memory Heap Configuration  for more details on the heap usage of the µC/TCP-IP stack.