Nios® V Processor Software Developer Handbook

ID 743810
Date 10/02/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

10.7.1. Initializing the Stack

Before you initialize the uc-tcp-ip stack, start the MicroC/OS-II scheduler by calling OSStart() from main(). Ensure RTOS and device I/O drivers are available, then only perform network stack initialization in a high priority task. You should perform all initialization call within an initialization task.

The network_init() function is called from the uc_main_task() function to initialize the network stack. The uc_main_task() then calls different µC/OS-II tasks or functions to implement the µC/TCP-IP Simple Socket Server or iPerf application.

You can use the following µC/OS-II tasks to create a thread, and performs actions specific task for simple socket server:

  • SSSCreateOSDataStructs() — Creates an instance of all the µC/OS-II resources.
  • SSSCreateTasks() — Initializes tasks that do not use the networking services.
  • SSSSimpleSocketServerTask()— Manages the socket server connection, and calls relevant subroutines to manage the socket connection

You can use App_IPerf_TaskTerminal()— Initialize and run iPerf Terminal function prototype for iPerf application:

The uc_main_task() is then added as an RTOS task right before OSStart() is called.