Troubleshooting Guide¶
This guide covers common issues encountered when using the EmbSec Kit and their solutions.
Build Issues¶
CMake Configuration Errors¶
"CMake version 3.20 or higher is required"¶
Problem: Your CMake version is too old.
Solution:
# Check current version
cmake --version
# Ubuntu/Debian - update CMake
sudo apt-get update
sudo apt-get install cmake
# macOS
brew upgrade cmake
# Or download from https://cmake.org/download/
"The CMAKE_C_COMPILER: arm-none-eabi-gcc is not a full path"¶
Problem: ARM toolchain not found in PATH.
Solution:
# Check if installed
which arm-none-eabi-gcc
# Ubuntu/Debian
sudo apt-get install gcc-arm-none-eabi
# macOS
brew install arm-none-eabi-gcc
# Add to PATH if installed elsewhere
export PATH=/path/to/arm-toolchain/bin:$PATH
"TivaWare not found"¶
Problem: TivaWare SDK is not in the expected location.
Solution:
- Download TivaWare from TI website
- Extract to
vendor/tivaware/ - Ensure structure is:
Note: This warning can be ignored for QEMU-only builds.
Build Failures¶
"undefined reference to __aeabi_*"¶
Problem: Missing ARM runtime library functions.
Solution: Ensure you're using the correct toolchain:
"region `FLASH' overflowed by X bytes"¶
Problem: Program too large for target memory.
Solution:
-
Build with Release configuration:
-
Check code size:
-
Reduce code size:
- Remove debug prints
- Optimize data structures
- Use
-Osoptimization flag
"No rule to make target"¶
Problem: Missing source files or incorrect paths.
Solution:
-
Verify file exists:
-
Clean and rebuild:
QEMU Issues¶
QEMU Won't Start¶
"qemu-system-arm: command not found"¶
Problem: QEMU not installed.
Solution:
# Ubuntu/Debian
sudo apt-get install qemu-system-arm
# macOS
brew install qemu
# Verify installation
qemu-system-arm --version
"qemu-system-arm: -M lm3s6965evb: unsupported machine type"¶
Problem: QEMU version too old or missing machine support.
Solution: Install QEMU 4.0 or newer:
# Check version
qemu-system-arm --version
# List supported machines
qemu-system-arm -M help | grep lm3s
QEMU Runtime Errors¶
"Guest crashed or hung"¶
Problem: Lab program crashed.
Solution:
-
Debug with GDB:
-
Check for common issues:
- Stack overflow
- Invalid memory access
- Infinite loops
"No output from QEMU"¶
Problem: UART not configured or program stuck.
Solution:
- Verify UART initialization in code
- Add debug output early in main()
- Use
-monitor stdiofor QEMU monitor
Testing Issues¶
Python Test Failures¶
"ModuleNotFoundError: No module named 'test_framework'"¶
Problem: Python can't find test utilities.
Solution: Run tests from project root:
"FileNotFoundError: build-qemu/labs/..."¶
Problem: Labs not built for QEMU.
Solution:
"timeout: the monitored command dumped core"¶
Problem: Test timeout or crash.
Solution:
- Increase timeout in test script
- Check for infinite loops in lab code
- Debug the specific test:
Test Environment Issues¶
"Python 3.x required"¶
Problem: Python version too old.
Solution:
# Check version
python3 --version
# Ubuntu/Debian
sudo apt-get install python3
# Use virtual environment
python3 -m venv venv
source venv/bin/activate
Hardware Issues¶
Flash Programming¶
"lm4flash: command not found"¶
Problem: Flash tool not installed.
Solution:
# Install from source
git clone https://github.com/utzig/lm4tools.git
cd lm4tools/lm4flash
make
sudo cp lm4flash /usr/local/bin/
"Unable to find any ICDI devices"¶
Problem: Device not connected or drivers missing.
Solution:
- Check USB connection
- Verify device appears in
lsusb(Linux) or System Information (macOS) - Add udev rules (Linux):
Serial Communication¶
"Permission denied: '/dev/ttyACM0'"¶
Problem: No permission to access serial port.
Solution:
"No serial output"¶
Problem: Wrong serial settings or cable.
Solution:
- Check serial settings: 115200 8N1
- Verify TX/RX connections
- Test with serial terminal:
Development Environment¶
IDE Integration¶
"No compile_commands.json found"¶
Problem: IDE can't find compilation database.
Solution:
# CMake generates this automatically
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
# Link to project root
ln -s build/compile_commands.json .
"Includes not found in VS Code"¶
Problem: IntelliSense can't find headers.
Solution: Update .vscode/c_cpp_properties.json:
{
"configurations": [{
"name": "EmbSec",
"compileCommands": "${workspaceFolder}/compile_commands.json",
"intelliSenseMode": "gcc-arm"
}]
}
Docker Issues¶
"docker-compose: command not found"¶
Problem: Docker Compose not installed.
Solution:
# Install Docker Compose
sudo apt-get install docker-compose
# Or use Docker Compose V2
docker compose version
"Permission denied while trying to connect to Docker daemon"¶
Problem: User not in docker group.
Solution:
Common Mistakes¶
Configuration Mistakes¶
-
Wrong build directory
-
Missing environment setup
Code Mistakes¶
- Stack size issues
- Default stack is 1KB
- Large local arrays cause overflow
-
Use static or heap allocation
-
Uninitialized hardware
- Always call
embsec_init() -
Initialize peripherals before use
-
Wrong flag format
- Flags must be exactly 32 characters
- Use
embsec_flag_ttype
Getting Help¶
Debug Information¶
Collect this information when reporting issues:
# System information
uname -a
cmake --version
arm-none-eabi-gcc --version
qemu-system-arm --version
python3 --version
# Build configuration
cmake -L build | grep -E "(CMAKE|EMBSEC)"
# Build output
make clean
make build 2>&1 | tee build.log
Support Resources¶
- Documentation
- Check
/docsdirectory - Read lab README files
-
Review API documentation
-
Examples
- Study working labs
- Check SDK examples
-
Review test code
-
Community
- GitLab issue tracker
- Course forums
- Office hours
Quick Fixes¶
Reset Everything¶
Verify Tools¶
Test Minimal Setup¶
# Test QEMU
qemu-system-arm -M lm3s6965evb -nographic -kernel /dev/null
# Test toolchain
echo 'int main(){}' | arm-none-eabi-gcc -x c - -o test.elf
See Also¶
- Environment Setup - Initial setup guide
- Building - Build instructions
- Debugging - Debugging techniques
- Testing - Test procedures