- Advanced Embedded Programming
- What's New
- Level 6 Course Structure
- Using the Glossary
- Setting Expectation
- Your Kit
- Attending Labs
- Lectures
These materials for part of the following modules taught at the University of Plymouth
- ELEC351 Advanced Embedded Programming
- COMP2008 Embedded Programming and the Internet of Things
All examples and tasks are written in C++. The embedded framework is Mbed OS. See the overview here.
This content was originally migrated from a previous version based on mbed-os 5.
Changes for 2021:
The following changes are confirmed.
- Module Support Board v4 provided to all stage-1.
- This has an extra switch mute the buzzer (by popular demand!)
- The MPU6050 is populated by default (motion sensor)
- The BMP was replaced with an alternative SPL06-001
- New schematics have been added
- New Driver Library is now used to assist with managing different board versions. This includes support for the new devices. These notes have been updated to reflect this.
- All projects are updated to Mbed-OS 6.13 and use Mbed Studio 1.4.2 onwards
- Various corrections and typos fixed
Changes for 2021:
- Adoption of Mbed Studio v1.X
- Adoption of Mbed-os 6.X
- More content on the fundamentals of C++ and Object Orientated Programming (OOP)
- Condition Variables
- The existing glossary is being migrated to a new version
- Blended delivery model
Changes for 2021:
- Restructuring. Moved content from level 6 back to level 5
- Additional Lab using Azure IoT Central
- Added additional network tasks, including NTP and TCP socket programming
Changes for 2022:
- Introduction to the Standard Template Library (STL)
- Dynamic Memory Allocation and Smart Pointers
- More content on Templates
- Copy and Move Semantics, Constructors and Types
- The
using
andnamespace
keyword - coming soon (now deferred until 2023) - USB on the go (OTG) - coming soon (now deferred until 2023)
This is an advanced programming module, that builds on content in levels 4 and 5. You may wish to survey some of the labs from previous year first.
In particular, make sure you are familiar with C/C++ structures, rapid polling and interrupts. If not, you must attempt those labs first as they underpin the content in this module.
Topic | Content | - | Weeks |
---|---|---|---|
1. | Review | See level 5 Lab Schedule - review labs on structures and interrupts | 1-2 |
2. | C++ and OOP | Lab1-C++ Classes, Lab2-C++ and OOP | 3-4 |
3. | Multi-threaded programming and networking | Lab3-Threads and Thread Synchronisation, Lab4-Thread Abstractions, Lab5-Network Programming | 5-7 |
4. | Coursework | 7 - 13 | |
Some crucial information is contained in the glossary.
This is so that the document is not cluttered with every detail. Do not ignore the glossary. You should read every entry referenced in each lab. In many cases, you may see a hyperlinked word (jargon typically). Some of these are links to glossary items. If you select them you can jump to the glossary items.
Remember that each student on the course may have a slightly a different background. Some will be returning from placement; others may be repeating then module. There are many variations.
This module is designed on the assumption that you have some knowledge and experience of embedded C programming, and some familiarity with Mbed. However, the first lab will be a refresher on interfacing with Mbed and Mbed Studio.
We will then recap on what we mean by blocking hardware and the problems is presents.
We will then review three approaches to managing multiple hardware devices in real-time, namely:
- Rapid polling loops (from level 5)
- Interrupts and interrupt safety (from level 5)
- Multi-threaded programming (new in level 6)
Some of this may be a refresher of what you were taught in level 5. However, repetition is often helpful as students don't often grasp the concepts first time.
Even if you have done some of the above before, beware of complacency and seek opportunities to push yourself and try to go deeper into the subject.
As a final remark, this is a fairly intensive course. Multi-threaded programming will be new, but in our experience, students who grasp it take it further when they attempt their final year projects. If you master it, it is a gateway to access more advanced applications including networking, USB and Bluetooth.
Different students may already have some of the equipment needed, depending on the year you first enrolled. You will be provided additional components that enable you to work both in the lab and at home.
You may also be loaned other equipment, such as a "Picoscope" (assuming you don't already have one).
Formal labs are scheduled at specific times in your timetable. Whether you are attending in person or doing some self study, you should ask questions in the Teams channel for that lab.
Look for the channel that says "Lab Sessions"
Labs will also contain interactive elements. There will typically be a briefing at the start and a poll part way through. Participating in these is important.
Each week there is a lecture, which often includes live recorded demo's. By the time you read this, the first lecture will have been delivered and recorded.
If you did not manage to attend the lecture for this week, please ensure you catch up via the video hosted on the DLE.
On the right hand-side, locate the "Panopto Block"
There you will find links to recorded lectures. You can also subscribe to these if you have a RSS on your computer or smart-device.
Panopto is our University video streaming service. It supports multiple video streams, closed captions and chapter points. This makes it much easier for students to find content within a video.
Some videos are restricted to a specific cohort of students, where others may be public. Please do not distribute these videos elsewhere.