ACS6127: Real-Time Embedded Systems Final Assignment
1
Dr S A Pope The University of Sheffield
Final Assignment
This assignment contributes 50% towards ACS6127
Aim
To allow you to demonstrate the knowledge and skills that you have developed by designing and
implementing an embedded system to meet a provided system specification.
Structure of the Assignment
Date assignment is available from: 0900 Monday, week 9, semester 1
Date of assignment submission: 1200 noon Monday 16th January 2023
Deadline for lab kit return: 1200 noon Monday 23rd January 2023
Marks awarded: This assignment is marked out of 100
Submission and return of the lab kit
Submission of your work will be through Blackboard. You will be required to submit the following
files/documents. Failure to submit all of these documents will lead to a mark of zero for the
assignment. The reason for this is that the assessor will not be able to check your project and test its
functionality. You should only submit work for a single project in part B of the submission below.
A. To Turn-it-In:
A single text document (.doc, .docx or .rtf - not a pdf) divided into two parts, as follows:
Part A.I: This section should explain the overall functionality of your code and how it
implements each level of the required specification in part A. It is restricted to a
maximum of 2 pages of size 12 font, single line spacing and 2.54 cm margins. A
submission with part A.I greater than 2 pages will get zero for the assignment.
Part A.II: This section should contain all of your “.c” and “.h” source files that you created for
your project (e.g. main, my_headers and Thread files) copied and pasted in as text (A
submission where the code is pasted as an image will get zero for the assignment).
Please make sure that each file starts on a new page and is clearly labelled.
B. To the standard Blackboard submission, the following files all attached in a single submission:
1. A .zip compressed version (only .zip compression - no other compressed file types) of the
complete project folder for your assignment. Please make sure that this folder contains:
The Keil μVision project file for your design (this is the “.UVPROJX” file found in the top
folder of your project).
All of your individual “.c” and “.h” source files that you created for your project (e.g.
main, my_headers and Thread files).
Your “system_stm32f4xx.c” file (found in the sub folder RTE->Device->STM32F407VGTx
of your project).
Your “RTX_Conf_CM.c” file (found in the sub folder RTE->CMSIS of your project).
2. The .hex file produced by the compiler. You will need to open the “Options for Target
‘Target 1’” window, select the Output tab and select the “Create HEX File” option. The
“Name_of_your_project.hex” file will be created in the Objects sub-folder of your main
project folder when you next run the compiler. It is the .hex file that will be run to test the
functionality of your code – make sure that you run “build” before submission to ensure that
you upload the latest version that matches your submitted project.
Standard penalties for late submission apply (https://students.sheffield.ac.uk/assessment/results/submission)
ACS6127: Real-Time Embedded Systems Final Assignment
2
Dr S A Pope The University of Sheffield
Lab kit should be returned to AJB reception. Unless an extension has been granted standard late
submission penalties also apply to return of the lab kit.
Restrictions
All code is to be solely developed using Keil μVision and the HAL drivers for the STM32F407. You are
only allowed to use library files or functions which are developed either by yourself, or which are
available as part of the standard HAL drivers. Work developed using other software (including
STM32CubeMX) and any code from restricted sources, will not be assessed.
Assessment and Feedback process
IMPORTANT: Your final source code should include your own original comments to fully explain its
operation. It is not acceptable to copy and paste ANY comments provided in the teaching material
(it is ok to include comments automatically generated by Keil in template files, such as Thread.c). If
your code does not contain sufficiently detailed comments for the assessor to understand its
operation (code where comments are copied from the teaching material will be classed as not
commented) you will only be awarded 50% of the marks for that part of the specification, compared
to what you could have been awarded if your code was correctly commented. This is because you
will be deemed to have not been able to sufficiently explain your answer.
Your work will be marked on a number of factors, including:
How well your code meets the required specification (method, correctness, etc.)
How robust your program design and code implementation is.
How efficiently it runs and uses system resources (see Lecture 4)
How well it is documented (see the previous statement about comments and note part A.I of
the list of submitted documents).
This is the final component of assessment for the embedded systems part of the module. This means
that you might receive the mark and written feedback for your assignment after the exam board and
at the same time as the final marks for the rest of your semester 2 modules. Full example solutions
will not be supplied as this will limit the assignments that can be set in future years.
Unfair Means
The lab should be completed individually. You should not discuss any aspect of it with other
students and should not work together in completing the lab. The lab must be wholly your own
work. Any suspicions of the use of unfair means will be investigated and may lead to penalties. See
https://www.sheffield.ac.uk/ssid/unfair-means for more information. In addition to your Turn-it-In
submission, your code will undergo additional checks. For example, MOSS is a specialist service
focused solely on detecting plagiarism and collusion in code.
Extenuating Circumstances
If you have circumstances which mean you are unable to complete this work on time or that have
affected your performance, please follow the extenuating circumstances process
(https://students.sheffield.ac.uk/extenuating-circumstances). Extensions cannot be considered
unless the extenuating circumstances process has been followed.
Support
If you have any problems with the equipment please contact Dr S A Pope immediately using the
email address s.a.pope@sheffield.ac.uk. These inquiries should only relate to problems with the
equipment, such as suspected faults. Any inquiry should include a clear description of the problem.
Any general questions about the assignment should be posted to the relevant section of the
Blackboard Discussion Forum.
Please turn to the next page for the assignment briefing
ACS6127: Real-Time Embedded Systems Final Assignment
3
Dr S A Pope The University of Sheffield
Assignment Briefing
Your task is to design and implement a multifunction embedded system. It will have two
modes of operation. In the first mode it acts as a tilt switch and in the second mode it is in
standby and simply blinks the LEDs on and off in a specific pattern. The mode change occurs
following a click of the user button. Your design is required to meet the following
specification. There are three levels to this specification, with each increasing the level of
functionality and complexity of the system and therefore the marks that can be gained.
IMPORTANT:
1. Your submitted assignment, irrespective of the specification level completed, is required
to use the CMSIS-RTOS RTX real-time operating system to implement an appropriate
multi-thread solution. An assignment submitted without using the CMSIS-RTOS RTX
real-time operating system will receive a mark of zero.
2. Your project is required to run correctly on any STM32F4Discovery with the same
specification as the one used in this module. Your submitted code will not be tested on
the STM32F4Discovery assigned to you, but on another STM32F4Discovery with the
same specification.
3. You can assume that the accelerometer provides calibrated acceleration measurements
directly. This isn’t strictly true, but will be a sufficient assumption for this assignment.
4. Configure the processor main clock to run at 168MHz.
5. Add the following line of code immediately at the start of the int main(void){}
function: SystemCoreClockUpdate();
Specification - Level 1
By completing this level you can achieve a maximum of 50 marks.
The STM32F4Discovery board should be programmed to operate as a two axis tilt switch.
Unlike the example in the “Serial Communication, Polling and Interrupts” lab which
indicated when the board was tilted more than 90 degrees from the level position, this tilt
switch is required to have the following functionality and features:
A. When the board is tilted from a flat horizontal orientation downwards
in the direction of any of the four user LED’s (the centre of the pivot is
the LIS3DSH) that LED should turn on – i.e the LED’s are used to
indicate which edge of the board drops below the horizontal. If the
board is tilted down in the direction of more than a single LED, then
multiple LEDs should illuminate.
B. Your program should include a small deadzone so that for each of the
single LED’s there is a small range of tilt angles in which only that
single LED illuminates (or no LEDs illuminate in the case of horizontal
orientation).
C. Your tilt switch should have an appropriate level of sensitivity. The
LED’s should not flicker too much, nor should there be too much of a
lag in updating the LED states when the board changes orientation.
Please turn over the page for the rest of the assignment
ACS6127: Real-Time Embedded Systems Final Assignment
4
Dr S A Pope The University of Sheffield
Specification - Level 2
By completing this level you can achieve an additional 20 marks.
A. When the blue user button is “clicked”, the tilt switch from level 1
should pause and indicate that it is paused by blinking the four user
LEDs on and then off in the following pattern and starting with the
green and red LED on. The red and green LED should turn on and
remain on for 1 second. The red and greed LED should then turn off
and the orange and blue LED immediately turn on and remain on for
0.5 seconds. The orange and blue LED should then turn off and the
sequence immediately repeat. The program should stay in this state
with this sequence repeating, until the blue button is clicked again,
after which the tilt switch from level 1 will resume. This pausing state
should be continuously available on further clicks of the button. A
“click” means a press and release, so that the change in state occurs
after the button is released.
Specification - Level 3
By completing this level you can achieve an additional 30 marks.
A. The STM32F4Discovery incorporates a “CS43L22, audio DAC with integrated
class D speaker driver”. You have not directly used this peripheral thus far, but
you have covered all of the techniques that you need to work out how to use it
and to implement the required code. This device can be used to provide an
audio output when either headphones or speakers are connected to the audio
jack on the STM32F4Discovery. This component should be used to provide an
audible output in the form of a “beep” played through a set of headphones, to
indicate, in addition to the flashing LEDs, that the system is in the pause state
required in Level 2. The “beep” should be clear and of an appropriate volume
for headphones to be used. Your Part A.I submission should describe which
communication interfaces are used by the CS43L22 to interface with the
STM32F407 and it should explain how you have configured them.
The data sheet for the “CS43L22, audio DAC with integrated class D speaker
driver” is provided on Blackboard in the same folder as the assignment briefing
sheet.
Please only submit a single project which contains all of the required functionality that
you have managed to achieve.
If you have not achieved some of the functionality for a level, but have made an attempt
at it, please comment this part out and ensure that it is well commented/documented so
that you can gain some method marks. You should make it clear in Part A.I of the
submission that you have made an attempt, but commented the code out for this reason.
If the work for a level has been commented out and not described in part A and
documented to describe its operation, it will gain no additional marks.
This is the last page of the assignment