Nios® V Embedded Processor Design Handbook

ID 726952
Date 7/08/2024
Public
Document Table of Contents

5.7.3.1. Network Task Configuration

In this example design, the µC/TCP-IP stack has three configurable tasks, the Receive task, the Transmit De-allocation task and the Timer task. Each task is configured with its own task priority and task stack size.

In order to place a task at higher priority, you have to register it with a lower value, and vice versa. The third-party vendor recommends configuring the task priorities as listed below for optimum performance.

  • Network Transmit (TX) De-allocation task (Highest priority)
  • Network timer task
  • Network Receive (RX) task (Lowest Priority)
As for the task stack size, it is dependent on the processor architecture and compiler used. Configuring the stack size to 4,096 bytes is deemed sufficient for most applications.
Table 36.  Network task configuration
Settings Description Default Value
TX_TASK_PRIO Network TX De-allocation Task Priority 1u
RX_TASK_PRIO Network RX Task Priority 3u
TMR_TASK_PRIO Network Timer Task Priority 5u
TX_TASK_SIZE Network TX De-allocation Task Stack Size 4096u
RX_TASK_SIZE Network RX Task Stack Size 4096u
TMR_TASK_SIZE Network Timer Task Stack Size 4096u

Default network task configuration in uc_tcp_ip_init.c

#define TX_TASK_SIZE  (4096u)
#define RX_TASK_SIZE  (4096u)
#define TMR_TASK_SIZE (4096u)

static const unsigned TX_TASK_PRIO  = 1u;
static const unsigned RX_TASK_PRIO  = 3u;
static const unsigned TMR_TASK_PRIO = 5u;