This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Some Questions about SYS/BIOS Tasks. (with EVM6678)

Other Parts Discussed in Thread: TMS320C6678


Hello,

I'm studying SYS/BIOS and NDK with TI's EVM6678(TMS320C6678) board.
I have some questions about SYS/BIOS Tasks. I'm new to SYS/BIOS.

If anyone know the answer, please let me know too. :)

1. Suppose a task is created(statically) and the task is like this.
   (I use multicore dsp processor.)

  void Task1(void)
  {
      int coreId;

      coreId = platform_get_coreid();
      if(coreid == 3) {
         while(1) {
            dosomething();
         }
      }
  }

  If I load the same program including the above task(function) to 8 cores,
  only core-3 will dosomething() and in other cores(0,1,2,4,5,6,7) the task1
  will be terminated. Right?
  Then, what will happen, if a task is terminated?

2. I printed osif.h and read it. I found some task-related functions there.
   To mention them, they are(arguments are omitted)

   a. TaskBlock()
   b. TaskCreate()
   c. TaskDestroy()
   d. TaskGetEnv()
   e. TaskGetPri()
   f. TaskSelf()
   g. TaskSetEnv()
   h. TaskSetPri()
   i. TaskSleep()
   j. TaskYield()

  I can understand what are TaskCreate(), TaskDestroy(), TaskGetEnv(),
  TaskGetPri(), TaskSetEnv(), TaskSetPri() from their name.
  I think I can understand what is TaskSleep(), TaskYield().
  But I have question.
  If a task is yielded, what can invoke the task again?

3. Is there any difference between TaskBlock() and TaskYield()?

 

4. Does anyone know what TaskSelf() means?

 

These questions might be so basic things, But important because I'm new to SYS/BIOS.

I hope my questions to be answered soon. Thank you.

  • Lots of questions!

    1. Yes, only core 3 will go into the loop. On the other cores, the task will terminate. If you have Task.deleteTerminatedTasks set to true in your .cfg file, the task will be cleaned up (e.g. stack freed if allocated in the create, etc.). If you have it set to false (the default), you'll need to call Task_delete to clean-up the resources.

    2. The NDK has the osif.h and library to allow it to be ran on non-SYS/BIOS systems. Since you are using SYS/BIOS, I would directly use the SYS/BIOS Task calls instead of the OSAL (Operating System Abstraction Layer) in your application code. For documentation about the SYS/BIOS Task module, please refer to the cdoc (<bios_install_dir>/docs/cdoc/index.html).

    You can see what SYS/BIOS Task APIs the NDK's Task OSAL is doing by looking at the source file: <ndk_install_dir>\packages\ti\ndk\os\task.c

    3. TaskBlock sets the priorities to inactive. So the Task does not run (but is not terminated).  TaskYield allows another Task of the same priority to run (if there is one ready to run).

    4. Every created task has a handle associated with it that is returned by the TaskCreate (or by the SYS/BIOS Task_create API). If the running task wants to get it's own handle, it can call TaskSelf (or Task_self in SYS/BIOS). This is really just a nice helper function instead of making you carry around the handle in your code.

    Todd

     

  • Thank you for your kindness, Todd.
     Your answer was really helpful for me to understand SYS/BIOS tasks.

    Now I understand the difference between "terminated" and "deleted".
    I read about SYS/BIOS task in SYS/BIOS User Guide again after I read your answer.
    It was a matter of system resources and I understand a task is an object managed by SYS/BIOS.
    (User Guide is not explaining everything.)
    I should read about Yielding and Blocking of tasks again.

    I think I have to familiarize myself with SYS/BIOS and NDK. :)

    Thank you.