Implementing TerminateTask

From ErikaWiki

Jump to: navigation, search

Reference test

examples/s12xs/porting_examples/EEtest6

examples/s12xs/porting_examples/EEtest7

examples/s12xs/porting_examples/EEtest8


Description

The three tests below tests the following features:

  1. StartOs(...) function and TerminateTask() function;
  2. BCC1 mode;
  3. BCC2 mode;
  4. BCC1 mode with a shared resource;

examples/s12xs/porting_examples/EEtest6:

  • tests behavior 1 and 2
  • The goal is to test the start phase of the kernel (StartOs(...)), the activation of a task and its termination procedure.
  • To configure the task set we must change the files eecfg.h and eecfg.c located inside the Debug folder.
  • Finally, we created inside the EEtest6 a C file with a main() function. That function explicitly calls the StartOs(...) function and finishing with a for(;;). Please note that the TerminateTask() function is called inside a function called by the task. The compilation must finish with an executable fully linked.

examples/s12xs/porting_examples/EEtest7:

  • tests behavior 3
  • The goal is to create a task with pending activations to test the kernel behaviour in the BCC2 mode. Task2 is executed six times at the beginning.

examples/s12xs/porting_examples/EEtest8:

  • tests behavior 4
  • The goal is to activate two tasks that share a resource to test the scheduler and the blocking mechanism. The main function activates the low priority task. The high priority task is activated within the first task and is executed at the end of the low priority task. The rtos continues the execution of the high priority task.

Expected output

When everything is done in the right way, with the following commands we can have the executable file:

  • open a Cygwin shell
  • cd into the Debug directory
  • the commands make clean and make all should work correctly producing an executable inside the Debug directory.

To simulate the application we can use directly the hardware or a "good" software debugger.

Personal tools