Using the NicheStack TCP/IP Stack - Nios II Edition Tutorial

ID 683574
Date 10/04/2021
Public
Document Table of Contents

1.7.4. Task Priorities in the Nios II Simple Socket Server Design

Task priorities in the application directly affect how the application runs, or if the task functions correctly at all. The MicroC/OS-II operating system uses a unique priority number scheme for running its tasks, in which tasks assigned a lower priority number are treated as higher priority tasks. Because the NicheStack TCP/IP Stack requires the use of the MicroC/OS-II RTOS for operation, all tasks run on the system must be assigned a unique priority number. For the Nios II Simple Socket Server demo application, all tasks have been assigned non-conflicting priorities. For your own application, however, you should verify that all tasks in your system are assigned unique priority numbers at run-time.

The table below lists the tasks that might be running in your system, and the mechanism for configuring the priority of these tasks.

Table 3.  Simple Socket Server Tasks and Configuration Mechanisms
Task Type Configuration Mechanism
MicroC/OS-II internal tasks ucosii settings, located on the Main tab of the Nios II BSP Editor
NicheStack TCP/IP Stack internal tasks ipport.h, located in the iniche/src/h/nios2 directory of your BSP project
Networking initialization task iniche_init.c, located in the <tutorial_files>\software/<app files> directory
User networking tasks (calls to TK_NEWTASK) Created in your application code
User non-networking tasks (calls to OSTaskCreate) Created in your application code

The following sections discuss the priorities of the tasks in the Nios II Simple Socket Server design: