Specifications

Chapter 1: Using the NicheStack TCP/IP Stack 1–19
Nios II Simple Socket Server Overview
June 2011 Altera Corporation Using the NicheStack TCP/IP Stack - Nios II Edition Tutorial
MicroC-OS/II Resources
This section describes the tasks, queue, event flag, and semaphores that implement
the Nios II Simple Socket Server application.
Tasks
Table 13 lists the MicroC/OS-II tasks that implement the Nios II Simple Socket
Server application.
The application creates the tasks listed in Table 1–3. The NicheStack TCP/IP
Networking Stack creates two additional software component layer tasks: a main task
that operates the networking stack, and a time-keeping task that the main task uses.
The application creates the NicheStack TCP/IP Stack main task (
tk_netmain
) in the
netmain()
function with a priority of
TK_NETMAIN_TPRIO
. The application creates the
time-keeping task (
tk_nettick
) in the
netmain()
call with a priority level of
TK_NETTICK_TPRIO
. For more information about these tasks, and how to set their
priorities and stack sizes, refer to “Important NicheStack TCP/IP Stack Concepts” on
page 1–22.
Table 1–3. MicroC/OS-II Tasks for the Nios II Simple Socket Server
Task Description
SSSInitialTask()
Instantiates all the MicroC/OS-II resources. Initializes the NicheStack TCP/IP
Stack and the Nios II Simple Socket Server example RTOS structures and
tasks.
SSSNiosIISimpleSocketServerTask()
Manages the socket server connection, and calls relevant subroutines to
manage the socket connection.
LEDManagementTask()
Manages
LEDBlinkTask
, driven by commands received via a MicroC/OS-II
queue, named
SSSLEDCommandQ
. The MicroC/OS-II mailbox, named
SSSLEDFreqMailbox
, passes blink rate values to the LED blink task.
LEDBlinkTask()
Blinks an LED on the development board, based on frequencies received via
MicroC/OS-II mailbox.
SSSMonitorPhyTask()
Monitors the status of a single network PHY and maintains the network
connection.