Prerequisite module initialization

Before initializing µC/TCPIP some prerequisite modules must be initialized prior to starting the Network Protocol stacks initialization. µC/TCPIP requires an RTOS such as µCOS-II or µCOS-III. Before starting initializing µC/TCPIP and other prerequisite modules, the RTOS must be started and all initialization call should be performed within an initialization task. Please refer to the user manual of your RTOS for more information about how to initialize the RTOS and how to initialize other modules.

µC/TCPIP is using µC/CPU, µC/LIB memory module and µC/Common Kernel Abstraction Layer, refer to the following documentation for more information about the initialization of these modules:

µC/LIB User's Guide

µC/CPU User's Manual

µC/Common Module


Listing - AppTaskStart shows an example of the application initialization task that should be started by the RTOS. The listing shows also what prerequisite modules that must absolutely initialized prior calling the TCP/IP function AppInit_TCPIP(), which would be responsible to initialize the Network protocol tacks. Section Sample applications will detailed the contain of the AppInit_TCPIP() function depending on the type of interface used.

AppTaskStart
static  void  AppTaskStart (void *p_arg)                        
{
    CPU_INT32U  cpu_clk_freq;
    CPU_INT32U  cnts;
    OS_ERR      err_os;
    KAL_ERR     kal_err;
    NET_ERR     net_err;

    (void)&p_arg;

    BSP_Init();                                                 (1) 
    CPU_Init();                                                                                
    Mem_Init();   
                                        
    AppInit_TCPIP(&net_err);                                    (2)
                                                                (3)
                                          
    while (1) {                                                                                    
        OSTimeDlyHMSM((CPU_INT16U) 0u,                         
                      (CPU_INT16U) 0u, 
                      (CPU_INT16U) 0u, 
                      (CPU_INT16U) 100u, 
                      (OS_OPT    ) OS_OPT_TIME_HMSM_STRICT,
                      (OS_ERR   *)&err_os);
    }
}


(1) BSP_Init(), CPU_Init() and Mem_Init() must be called prior to the TCP-IP initialization function AppInit_TCPIP().

(2) AppInit_TCPIP() initializes the µC/TCP-IP stack and the initial parameters to configure it.

(3) If other IP applications are required this is where they are initialized.