Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

Does the NIOS IDE 8.1 has the Microc/SO-II Toturial?

i use the nios ide 8.1 ,in the project template only have the Hello UCOS-II,

What is the defference between the Hello UCOS-II and MicroC/OS-II tutorial?

thanks in advance.

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    uC-OS/II is same to MicroC/OS-II. Jean J. Labrosse (uC-OS/II creator) replaced "mu" greek letter to "Micro" word because of issues related to book stores.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    yes ,i know that.

    but i want to know What is the defference between the "Hello UCOS-II" and "MicroC/OS-II tutorial" in the project template of the NIOS II IDE.

    and why the NIOS II IDE 8.1 don't have the "MicroC/OS-II tutorial" in the project template.

    thank you.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Any of two projects should be a good start point to develop your own uC/OS-II application. I don't remember about template included in Nios II IDE 8.1, however in case of Nios II IDE 9.0 project "Hello MicroC/OS" creates two threads:

    
    # include <stdio.h>
    # include "includes.h"
    /* Definition of Task Stacks */
    # define   TASK_STACKSIZE       2048
    OS_STK    task1_stk;
    OS_STK    task2_stk;
    /* Definition of Task Priorities */
    # define TASK1_PRIORITY      1
    # define TASK2_PRIORITY      2
    /* Prints "Hello World" and sleeps for three seconds */
    void task1(void* pdata)
    {
      while (1)
      { 
        printf("Hello from task1\n");
        OSTimeDlyHMSM(0, 0, 3, 0);
      }
    }
    /* Prints "Hello World" and sleeps for three seconds */
    void task2(void* pdata)
    {
      while (1)
      { 
        printf("Hello from task2\n");
        OSTimeDlyHMSM(0, 0, 3, 0);
      }
    }
    /* The main function creates two task and starts multi-tasking */
    int main(void)
    {
      
      OSTaskCreateExt(task1,
                      NULL,
                      (void *)&task1_stk,
                      TASK1_PRIORITY,
                      TASK1_PRIORITY,
                      task1_stk,
                      TASK_STACKSIZE,
                      NULL,
                      0);
                  
                   
      OSTaskCreateExt(task2,
                      NULL,
                      (void *)&task2_stk,
                      TASK2_PRIORITY,
                      TASK2_PRIORITY,
                      task2_stk,
                      TASK_STACKSIZE,
                      NULL,
                      0);
      OSStart();
      return 0;
    }
    

    Why you need specific diferences between two projects?