CMPE 246 Lecture 7 - (Jan.28)
CMPE 246 Lecture 7 - (Jan.28)
Design Studio
Dr. Ling Bai
ling.bai@ubc.ca
IEEE Member, ACM Member
Faculty of Applied Science | School of Engineering
The University of British Columbia, Okanagan Campus
1137 Alumni Avenue, Kelowna BC, V1V 1V7 Canada
Instructor Name: Ling Bai
2
Lecture 4
3
1- Start
4
1- Start In the Online Interactive Review Pages!
HD
HD
5
1- Start
In the Online Interactive Review Pages!
6
1- Start
7
2- Hardware Verification
Embedded Testing is soft- and hardware verification and validation
(V&V) to ensure the entire system is defect-free.
• Validation: Ensuring that the system meets the needs and requirements
of its intended users and the intended use environment.
8
2- Hardware Verification
Embedded Testing is soft- and hardware verification and validation
(V&V) to ensure the entire system is defect-free.
• Verification: Am I building the system right?
• Validation: Am I building the right system?
9
2- Hardware Verification
Embedded Testing is soft- and hardware verification and validation
(V&V) to ensure the entire system is defect-free.
• On the other hand, validation is the final step, aimed at confirming that
the finished product meets the user's needs and expectations.
10
2- Hardware Verification
Embedded Testing is soft- and hardware verification and validation to
ensure the entire system is defect-free.
• Unit testing
• Integration testing
System testing(optional)
11
2- Hardware Verification
12
2- Hardware Verification
V-model of design flows
13
2- Hardware Verification
V-model of design flows
14
2- Hardware Verification
V-model of design flows
15
2- Hardware Verification
Acceptance testing: System is tested in the real-world environment to ensure it meets
user requirements. (Beta testing)
16
2- Hardware Verification
Embedded Testing is soft- and hardware verification and validation to
ensure the entire system is defect-free.
Black box testing involves testing a system with no prior knowledge of its
internal workings. (Functionality testing)
18
2- Hardware Verification
White box testing analyze the internal structures the used data structures,
internal design, code structure.
19
2- Hardware Verification
Test-driven development is an agile development method where test
units are written before the code.
21
2- Hardware Verification
In many cases where there is no need for powerful embedded OSes, the
firmware is developed using bare-metal approach or with small RTOSes.
Embedded systems contain firmware.
Firmware is program that provides basic machine instructions that allow the
hardware to function and communicate with other software running on a device.
24
2- Hardware Verification
Reading:
https://www.intel.com/content/www/us/en/docs/programmable/683211/current/bare-
metal-user-guide.html
25
3- Flashing and Debugging
In most cases the chip is programmed while it is already soldered onto the board, called In-
System-Programming (ISP).
26
Soldering pins with iron tool
3- Flashing and Debugging
27
3- Flashing and Debugging
In most cases the chip is programmed while it is already soldered onto the board, called In-
System-Programming (ISP).
• Via a bootloader using communication interfaces (UART) that are used for other
purposes during normal operation of the device.
The firmware that comes installed in the device when you buy it is called stock
firmware.
31
3- Flashing and Debugging
An editor revising a written document to correct errors.
32
3- Flashing and Debugging
33
3- Flashing and Debugging
In order to find bugs, you can use the same serial interface/communication interface
and print debug messages to it. (JTAG/SWD/UART)
• monitor debugger
a piece of software that was programmed in
the memory of the embedded system and
reacted to requests of a debugger software
from outside.
• in-circuit emulator
a (large) piece of hardware that replaced and
emulated the processor located in the target
hardware by adaptation.
https://www.embedded.com/debugging-stories-from-printf-just-flash-and-beyond/
34
https://runtimerec.com/firmware-debugging-techniques-using-jtag-and-serial-interfaces/
https://medium.com/@lanceharvieruntime/using-debugging-interfaces-uart-jtag-and-swd-demystified-3f33b8f0513e
3- Flashing and Debugging
GNU Compiler Collection (GCC): a compiler suite that supports many
languages, such as C/C++ and Objective-C/C++.
GDB Debugger is the GNU Project's debugger, a powerful tool used primarily
for debugging programs written in C, C++, and other languages.
35
3- Flashing and Debugging
Features of GDB
• Breakpoints: Set breakpoints to pause program execution at specific points
to examine the current state.
• Step Execution: Execute programs step by step, monitoring the changes in
program states.
• Variable Inspection: Check variables and memory states.
• Stack Inspection: View the call stack to trace the path of execution.
• Thread Debugging: Manage and debug threads.
36
3- Flashing and Debugging
Breakpoint
37
3- Flashing and Debugging
Step Execution:
• step into: enter into the
function
This will take you inside the
add function, allowing you to
see what happens at the
line 5
Breakpoint
38
3- Flashing and Debugging
Step Execution:
• step over: skip over
function calls
This will execute the add
function without entering it,
and the debugger will stop
after it has finished, at the next
line 17
Breakpoint
39
3- Flashing and Debugging
Step Execution:
• continue
If you want the program to continue
running until the next breakpoint
If there are no other breakpoints
after the functions, Continue will
allow the program to run to
completion and exit.
Breakpoint
40
4- To Supplement
makefile
If you want to run or update a task
when certain files are updated, the
make utility can come in handy.
41
4- To Supplement
bash
your shell script
42
In Advance
• Please activate your UBC GitHub account. You can do this by visiting the
UBC GitHub Service page https://activate.github.ubc.ca/ and using your
UBC CWL to activate your account.
• After your account has been activated, log in to UBC GitHub
https://github.ubc.ca/ with your UBC CWL. This will complete the setup of
your account.
Organizations on GitHub are group accounts where members can collaborate on projects together.
We will use GitHub to manage the advanced project repository and conduct some evaluations through
Insight. When the course ends, you can make your project public by registering and opening your
43
personal GitHub account at github.com.
In Advance
Blinky Led
https://www.jeffgeerling.com/blogs/jeff-geerling/controlling-pwr-act-leds-raspberry-pi
Raspberry pi 4:
https://youtu.be/CL39xCXdU64
https://youtu.be/jO994kxodPU
https://roboticsbackend.com/raspberry-pi-control-led-python-3/
Raspberry pi 3: https://youtu.be/w_z0BUkzbIg
On Canvas
44
In Advance
45
Dr. Ling Bai
(email: ling.bai@ubc.ca)