Lecture 7 - Tools for embedded programming Flashcards
What are static analysers?
Analyzes source code for potential errors.
Looks at every possible code-path,
Out of bound read/writes
Null pointer dereferences
Memory allocation/deallocation
Run-time analysers
Out of bound read/writes
Memory allocation/deallocation
Use of uninitialised variables
Track of what code is running
measure cache misses
What are unit tests?
Known input compared agains expected output
Check error handling
Test corner cases
What are integration tests?
Test real-world scenarios
Wrong input - error handling
Regression tests
What are performance tests?
Speed (throughput, latency)
Memory usage
IO bandwidth usage
Cache misses
power efficiency
Scalability
What do you need to be aware of when doing performance testing?
Make sure test is not optimized away by compiler
Measure only interesting parts
Run long enough to give stable result
How can you evaluate code coverage?
All functions are tested
All lines are tested
All branch conditions are tested
What are some tools that are useful when writing software
IDEs
Compilers
Build systems
Version control
What can IDEs provide?
syntax highlighting, tab-completion, navigation, build system integration, debugger
What does build systems do?
Invokes compiler and other tools
Start builds, tests, packaging, flashing
Avoid repeating unecessary steps
Allow configurable builds (debug, release)
find dependencies
Takes care of platform differences
What does version control tools do?
Keeps track of changes made
Allow multiple people working on the same code
Branching/merging
Synch with remote code repositories
run tools on change (CI)
What does debuggers do?
Breakpoints
watching variables
Stepping through code
read/write memory
call functions
What is a limitation of embedded system in regards to debuggers?
Might not be enough memory to run debugger itself
No direct access to memory from outside
No usable I/O lines
What can be used to debug embedded systems?
JTAG: standard protocol for debugging a chip using a few wires
Functionality:
Boundary scan
R/W to registers and mem
Stop/start/step the CPU
Flashing
Drawbacks:
Limited functionality
Standard signalling but (often) proprietary commands
Requires special hardware
What is a stub debugger?
Requires a spare seriel port
- Minimum code to read/write mem and reg
- Requires Kbs of flash mem
- Needs acces to UART or SPI communication
- Needs to hook into some interrupts
A real debugger on PC will interface with th stub debugger
Drawbacks:
-limited func.
- Needs modification of your embedded software