Skip to content

Latest commit

 

History

History
83 lines (69 loc) · 3.43 KB

L04.md

File metadata and controls

83 lines (69 loc) · 3.43 KB
layout title license
default
Time-triggered scheduler implementation and application

Introduction

This lab encourages you to develop your own time-triggered scheduler and to use it to develop a more responsive application than the one that you developed last week with a super-loop approach.

FRDM-K64F image

Exercises

  1. Make sure that you are up to date with the exercises so far. When you are ready to check your work, you can import the repositories and checkout the solution branches. Build, run, and observe the solution programs. Study the code carefully to make sure that you understand it. Ask your lab tutor for help with anything that you don't understand.

    $ cd ~/kf6010
    $ git clone https://github.com/davidkendall/pit-bare
    $ cd pit-bare
    $ git checkout P05

    and

    $ cd ~/kf6010
    $ mbed import https://github.com/davidkendall/blinky-mbed
    $ cd blinky-mbed
    $ git checkout P05
  2. Now import the repository that is the starting point for your development of a time-triggered scheduler.

    $ cd ~/kf6010
    $ mbed import https://github.com/davidkendall/blinky-mbed-tt
    $ cd blinky-mbed-tt

    Notice that the code is organised in src/TTsched and src/app directories. You will need to modify src/TTsched/scheduler.c, src/app/ttSchedConfig.h, and src/app/main.cpp. These files contain comments that indicate the work that needs to be done. Pay careful attemtion to them. Use the week 4 lecture slides to guide your development. Develop your system to a point where the red LED on the K64F board is toggled every 0.5 s, the red LED on the application board is turned off, and the green LED on the application board flashes at the same rate as the red LED on the K64F board, but is off when the red LED is on, and vice versa. Your system should be controlled by the time-triggered scheduler that you have developed.

  3. Once you have a time-triggered system that flashes the LEDs, develop it further to the point where it implements all of the application board requirements from week 3. Choose TT_SCHED_TICK_HZ and the delays and periods for your tasks to give the most responsive system that you can manage. You will need to add libraries to your project for the LCD, and the accelerometer and temperature sensors. Refer to the week 3 lab notes if you need a reminder of how to do this.

Working at home

You'll need to spend about 5 or 6 hours per week, outside of scheduled classroom time, working on the exercises and doing further reading. The most important part of this will be the time that you spend programming. You can configure your own computer to enable you to do any of the work that you would normally do in the lab. If your own computer has a Linux OS installed, then you can simply follow the instructions for installing the GNU Arm Embedded Toolchain and pyOCD. If you have a Windows or Mac machine, then you should install Virtualbox and create an Ubuntu 16.04 Desktop guest OS to run on your machine. See [Using Virtualbox]({{ site.url }}/kf4005/L01.html#using-virtualbox) for guidance. You can then install the tools, as explained earlier.