Click here to remove the style sheet (in order to print it or if you encounter problems).

Exercise 1

Develop an application composed by two tasks with the following execution order :

You will use semaphores. Try to modify the relative priorities of the two tasks: the execution must not be modified.

Exercise 2

Let us consider a "watch dog" task which check that a counter is incremented regularly. In case of error, it has the following behavior :
  • if the counter has not been incremented after 150ms, an error message is produced (watchdog functionality).
  • if the execution of the watch dog is not completed after 100ms, an error message is produced (deadline missed detection).

Write the code for a task which simulate the counter access (using a semaphore) and which will slow down regularly to switch from 50ms to 200ms in order to test the first kind of error.

Write the watch dog task. In order to be able to test the second error type, you will add a treatment loop, either in the watch dog task or in an other task with an higher priority.

Exercise 3

Modify exercise 2 in order to replace the terminal printing by a print on a standard shell. You will use for that a user process connected to real-time tasks by a FIFO. This can be viewed as a way to set up a deported debug console which will not overload the master console.