A dual-implementation educational project that simulates the boot LED sequence of the i.MX6QDL Sabre-SD development board through both console-based (C) and graphical (Python/Tkinter) interfaces.
This project provides a visual simulation of the 16-stage boot process used in the i.MX6QDL Sabre-SD development board. It demonstrates how embedded systems use LED indicators to show boot progression, making it an excellent educational tool for:
- Embedded systems students
- Linux boot process learners
- Embedded Linux developers
- Hardware simulation enthusiasts
- Console-based ASCII art LED display
- Configurable boot speed
- Verbose mode for detailed stage information
- Lightweight, no dependencies
- Cross-platform compatible
- Interactive 4x4 LED grid visualization
- Real-time status display with descriptions
- Speed control slider (1x to 10x)
- Pause/Resume functionality
- Manual step-by-step progression
- Stage highlighting with color coding
The simulation follows a realistic 16-stage boot sequence:
| Stage | LEDs | Description | Status |
|---|---|---|---|
| 1. Power ON | LED0 | Initial power-up and hardware initialization | 🔴→🟢 |
| 2. U-Boot Stage | LED1–LED4 | Bootloader initialization (4 phases) | 🔴→🟢 |
| 3. Kernel Boot | LED5–LED8 | Linux kernel loading and initialization | 🔴→🟢 |
| 4. RootFS Mount | LED9–LED11 | Root filesystem mounting (3 phases) | 🔴→🟢 |
| 5. Services Init | LED12–LED14 | Service initialization (Wi-Fi/Bluetooth/Ethernet) | 🔴→🟢 |
| 6. System Ready | LED15 | System fully booted and ready | 🔴→🟢 |
imx6qdl-sabresd/
├── README.md # This file
├── imx6qdl_sabre_led.c # C console implementation
├── led_gui.py # Python GUI implementation
├── Makefile # Compilation script for C program
├── imx6qdl_sabre_led # Compiled binary (after make)
└── (generated files after compilation)
For Python GUI:
sudo apt update
sudo apt install python3 python3-tkFor C Program:
sudo apt update
sudo apt install gcc makepython3 led_gui.pymake
./imx6qdl_sabre_ledLaunch the GUI with:
python3 led_gui.pyGUI Controls:
- Start/Stop Button: Begin or halt the simulation
- Speed Slider: Adjust boot speed (1-10)
- Step Button: Manually progress through stages
- Reset Button: Return to initial state
- LED Grid: Visual 4x4 display showing active LEDs
Visual Indicators:
- 🔴 Red: Stage not yet reached
- 🟢 Green: Active/current stage
- 🟡 Yellow: Completed stage
- 🔵 Blue: Service initialization stages
Basic Usage:
./imx6qdl_sabre_ledCommand Line Options:
./imx6qdl_sabre_led [OPTIONS]
Options:
-h, --help Show this help message
-s, --speed=N Set delay between stages (1=fast, 10=slow, default=3)
-v, --verbose Show detailed status messages
-q, --quiet Minimal output (only LEDs)Examples:
# Fast boot with details
./imx6qdl_sabre_led --speed=1 --verbose
# Slow, minimal display
./imx6qdl_sabre_led --speed=8 --quiet
# Default settings
./imx6qdl_sabre_led# Clean build
make clean
# Compile
make
# Optional: Install to system (requires sudo)
sudo make installgcc -o imx6qdl_sabre_led imx6qdl_sabre_led.c -Wall -Wextra -std=c99make # Compile program
make clean # Remove compiled files
make install # Install to /usr/local/bin
make uninstall # Remove from system
make debug # Compile with debug symbolsThe 16 LEDs are logically arranged in a 4x4 grid:
┌─────┬─────┬─────┬─────┐
│ LED0│ LED1│ LED2│ LED3│ ← Row 1: Power & U-Boot
├─────┼─────┼─────┼─────┤
│ LED4│ LED5│ LED6│ LED7│ ← Row 2: U-Boot & Kernel
├─────┼─────┼─────┼─────┤
│ LED8│ LED9│ LED10│LED11│ ← Row 3: Kernel & RootFS
├─────┼─────┼─────┼─────┤
│ LED12│LED13│LED14│LED15│ ← Row 4: Services & Ready
└─────┴─────┴─────┴─────┘
- Initialization: All LEDs off (red)
- Stage Progression: Each stage activates its LED(s)
- Status Updates: Console/GUI updates with stage info
- Completion: All LEDs active, system ready message
main() → parse_args() → initialize() → simulate_boot() → cleanup()
↓ ↓ ↓ ↓
Read options Setup display Loop through Free resources
16 stages
↓
update_led() + delay()LEDSimulator() → __init__() → create_widgets() → start_simulation()
↓ ↓ ↓ ↓
Application Initialize Build GUI Run boot sequence
↓
update_leds() + schedule_next()Quick Test Suite:
# Test C program
./imx6qdl_sabre_led --speed=2 --verbose
./imx6qdl_sabre_led --speed=5 --quiet
# Test Python GUI
python3 led_gui.py
# Test both implementations
chmod +x test.sh # If test script exists
./test.shExpected Output Examples:
C Program:
[ ] LED0 [ ] LED1 [ ] LED2 [ ] LED3
[ ] LED4 [ ] LED5 [ ] LED6 [ ] LED7
[ ] LED8 [ ] LED9 [ ] LED10 [ ] LED11
[ ] LED12 [ ] LED13 [ ] LED14 [ ] LED15
Starting boot sequence...
Stage 0: Power ON - LED0
[ON] LED0 [ ] LED1 [ ] LED2 [ ] LED3
...
Python GUI:
- Interactive window with 4x4 LED grid
- Status bar showing current stage
- Control panel with buttons and slider
In C program:
// Edit imx6qdl_sabre_led.c
#define DEFAULT_SPEED 3 // Change default speed
#define TOTAL_STAGES 16 // Number of LEDs
const char* stage_names[] = { // Edit stage descriptions
"Power ON",
"U-Boot Phase 1",
// ... etc
};In Python GUI:
# Edit led_gui.py
STAGE_DESCRIPTIONS = {
0: "Power ON - Hardware Initialization",
1: "U-Boot Phase 1 - CPU Init",
# ... etc
}
COLORS = {
'off': '#ff4444', # Change LED colors
'on': '#44ff44',
'active': '#ffff44'
}- Add sound effects: Integrate with
pygameor system beep - Logging: Add file logging for boot sequence
- Network simulation: Simulate network service initialization
- Web interface: Create Flask/Django web version
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow existing code style
- Add comments for complex logic
- Update documentation
- Test changes on both implementations
- Keep commits focused and atomic
- Add error simulation mode
- Create web-based version
- Add real hardware integration
- Create Docker container
- Add unit tests
- Internationalization support
This project demonstrates:
- Embedded boot sequences: How hardware indicates boot progress
- Multi-language implementation: Same logic in C and Python
- Event-driven programming: GUI event handling
- System simulation: Modeling real hardware behavior
- Cross-platform development: Works on Linux, macOS, Windows
| Issue | Solution |
|---|---|
python3-tk not found |
sudo apt install python3-tk (Debian/Ubuntu) |
make: command not found |
sudo apt install make |
gcc: command not found |
sudo apt install gcc |
| GUI window doesn't open | Check DISPLAY variable, try export DISPLAY=:0 |
| Program runs too fast/slow | Use -s option to adjust speed |
- Freescale/NXP for i.MX6QDL Sabre-SD board documentation
- Python Software Foundation for Tkinter
- GCC team for the C compiler
- Embedded Linux community for boot sequence references
- Questions: Open a discussion in GitHub
If you find this project useful, please consider giving it a star! ⭐