Skip to content

DynamicDevices/hello-world-yocto-ai-dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Hello World Yocto AI Development

Professional Yocto Embedded Development Template with AI IDE Integration

License: GPL v3 Build Status Yocto Compatible

A comprehensive template project demonstrating professional Yocto embedded development workflows with AI IDE integration, optimized for Dynamic Devices ARM64 boards.

🎯 Overview

This project showcases a complete embedded development workflow that includes:

  • Cross-compilation for ARM64 targets (Dynamic Devices boards)
  • AI IDE integration (Cursor, VS Code) with full IntelliSense
  • Remote debugging with GDB over SSH
  • Yocto BitBake recipe for production integration
  • Automated deployment and testing workflows
  • Professional build system with CMake

Supported Boards

  • Dynamic Devices Edge EInk (imx93-jaguar-eink) - E-Ink display applications
  • Dynamic Devices Edge AI (imx8mm-jaguar-sentai) - AI audio processing
  • Generic ARM64 Yocto-based systems

πŸš€ Quick Start

Prerequisites

# Install development tools
sudo apt-get update
sudo apt-get install -y \
    build-essential cmake git sshpass rsync \
    gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
    gdb-multiarch libgpiod-dev

# Install Cursor IDE (recommended for AI features)
# Download from: https://cursor.sh/

# Clone the repository
git clone https://github.com/DynamicDevices/hello-world-yocto-ai-dev.git
cd hello-world-yocto-ai-dev

# Open in Cursor IDE
cursor .  # or code . for VS Code

🎯 AI-Powered Development (Recommended Workflow)

# 1. Open project in Cursor IDE
cursor .

# 2. Build with IntelliSense integration (Ctrl+Shift+B)
./scripts/build_native.sh

# 3. Set breakpoints by clicking in code editor
# 4. Press F5 β†’ "Debug on Target Board" for remote debugging
# 5. Ask Cursor AI: "Explain this debugging output"

Native Development

# Build and test locally
./scripts/build_native.sh
cd build && ./hello_world_test --quick
./hello_world_app --demo

Cross-Compilation and Deployment

# Set target board IP (optional - defaults to 62.3.79.162)
export TARGET_IP="your.board.ip.address"

# Deploy to target board
./scripts/deploy_to_target.sh

# Run comprehensive tests on target
./scripts/test_on_target.sh

πŸ› οΈ Development Workflow

1. Local Development

  • Edit code with full IntelliSense support
  • Build and test natively: ./scripts/build_native.sh
  • Run local tests: cd build && ./hello_world_test --all

2. Target Testing

  • Deploy and test: ./scripts/test_on_target.sh
  • Interactive debugging: Use VS Code/Cursor debug configuration

3. AI-Powered Remote Debugging

  • Visual debugging: Click to set breakpoints, inspect variables
  • One-click workflow: Press F5 β†’ "Debug on Target Board"
  • Automatic setup: Builds, deploys, and connects to target automatically
  • AI assistance: Ask Cursor to explain debugging output and suggest fixes
  • Live debugging: Step through code running on actual ARM64 hardware

πŸ“ Project Structure

hello-world-yocto-ai-dev/
β”œβ”€β”€ include/                    # Header files
β”‚   β”œβ”€β”€ common.h               # Common definitions and macros
β”‚   β”œβ”€β”€ hello_lib.h            # Main library interface
β”‚   └── system_info.h          # System information utilities
β”œβ”€β”€ src/                       # Source code
β”‚   β”œβ”€β”€ hello_lib.c            # Main library implementation
β”‚   β”œβ”€β”€ system_info.c          # System information functions
β”‚   β”œβ”€β”€ main.c                 # Main application
β”‚   β”œβ”€β”€ test_main.c            # Test suite
β”‚   └── demo_main.c            # Interactive demo
β”œβ”€β”€ scripts/                   # Build and deployment scripts
β”‚   β”œβ”€β”€ build_native.sh        # Native compilation
β”‚   β”œβ”€β”€ build_for_target.sh    # Cross-compilation
β”‚   β”œβ”€β”€ deploy_to_target.sh    # Deployment automation
β”‚   β”œβ”€β”€ test_on_target.sh      # Remote testing
β”‚   └── *debug*.sh             # Debug session management
β”œβ”€β”€ .vscode/                   # VS Code/Cursor configuration
β”‚   β”œβ”€β”€ c_cpp_properties.json # IntelliSense setup
β”‚   β”œβ”€β”€ tasks.json             # Build tasks
β”‚   β”œβ”€β”€ launch.json            # Debug configurations
β”‚   └── settings.json          # Workspace settings
β”œβ”€β”€ yocto/                     # Yocto integration
β”‚   └── recipes-examples/      # BitBake recipe
β”œβ”€β”€ docs/                      # Documentation
└── CMakeLists.txt             # Build system

πŸ”§ Build System

CMake Configuration

The project uses CMake with support for:

  • Native compilation for development
  • Cross-compilation for ARM64 targets
  • Debug builds with symbols for remote debugging
  • Machine-specific configurations
  • Library dependencies (libgpiod, etc.)

Build Targets

Target Description
hello_world_app Main application with CLI interface
hello_world_test Comprehensive test suite
hello_world_demo Interactive feature demonstration
libhello_world.so Shared library
libhello_world.a Static library

πŸ§ͺ Testing

Test Suite Features

  • Quick validation tests for CI/CD
  • Comprehensive functionality testing
  • GPIO hardware testing (if available)
  • System information validation
  • Cross-platform compatibility checks

Running Tests

# Local testing
./scripts/build_native.sh
cd build && ./hello_world_test --all --verbose

# Target testing
./scripts/test_on_target.sh

# Specific test categories
./hello_world_test --gpio --verbose
./hello_world_test --system --verbose

πŸ› AI-Powered Remote Debugging

Visual Debugging in Cursor IDE

One-Click Debugging Workflow:

  1. Set breakpoints: Click in the gutter next to line numbers
  2. Press F5: Select "Debug on Target Board"
  3. Debug visually: Inspect variables, step through code, view call stack
  4. AI assistance: Ask Cursor to explain values and suggest fixes

Debug Configurations

Configuration Purpose How to Use
Debug on Target Board Remote ARM64 debugging Press F5 β†’ Select this option
Debug Native App Local development debugging Press F5 β†’ For local testing
Debug Native Tests Test suite debugging Press F5 β†’ Debug test failures
Attach to Target Process Attach to running process For debugging live applications

Visual Debugging Features

  • βœ… Breakpoint management: Click to set/remove, conditional breakpoints
  • βœ… Variable inspection: Watch window, locals panel, hover values
  • βœ… Step-by-step execution: F10 (step over), F11 (step into), Shift+F11 (step out)
  • βœ… Call stack navigation: Click through function calls
  • βœ… Memory view: Inspect raw memory contents
  • βœ… AI code analysis: Ask Cursor to explain complex debugging scenarios

Manual GDB (Advanced Users)

# Manual GDB session (optional - usually use F5 in Cursor)
gdb-multiarch build_debug_target/hello_world_app
(gdb) target remote 62.3.79.162:2345
(gdb) continue

πŸ₯§ Yocto Integration

BitBake Recipe

The project includes a complete BitBake recipe for integration with Yocto:

# Copy recipe to meta-dynamicdevices layer
cp yocto/recipes-examples/hello-world-yocto-ai-dev/hello-world-yocto-dev_git.bb \
   /path/to/meta-dynamicdevices/recipes-examples/hello-world-yocto-ai-dev/

# Add to image
IMAGE_INSTALL_append = " hello-world-yocto-dev"

Recipe Features

  • Automatic dependency management
  • Machine-specific configurations
  • Development tools packaging
  • Documentation installation
  • Security hardening

πŸ—οΈ Dynamic Devices Board Support

Edge EInk (imx93-jaguar-eink)

  • SoC: NXP i.MX93 (ARM Cortex-A55)
  • Features: 6-color E-Ink display, low power
  • GPIO: libgpiod v2.x support
  • Use Case: E-paper applications, IoT displays

Edge AI (imx8mm-jaguar-sentai)

  • SoC: NXP i.MX8M Mini (ARM Cortex-A53)
  • Features: Audio processing, AI acceleration
  • Audio: TAS2563 codec with PDM microphones
  • Use Case: AI audio processing, voice applications

πŸ€– AI IDE Integration

AI-Enhanced Features

  • 🧠 AI Code Assistance: Ask Cursor to explain code, suggest fixes, generate functions
  • πŸ” Intelligent IntelliSense: Cross-compilation aware with ARM64 symbol resolution
  • πŸ› Visual Remote Debugging: One-click F5 debugging on target hardware
  • ⚑ Real-time Error Detection: AI-powered error analysis and fix suggestions
  • πŸ”„ Automated Workflows: Build, deploy, test, and debug with single commands
  • πŸ“± Cross-Architecture Navigation: Jump between native and ARM64 code seamlessly

Supported AI IDEs

  • 🎯 Cursor (Recommended - AI-first development environment)
  • πŸ“ Visual Studio Code with AI extensions (GitHub Copilot, etc.)
  • πŸ”§ Any LSP-compatible IDE with AI assistance capabilities

Key AI Workflow Benefits

  • Ask AI: "How do I add GPIO control?" β†’ Get complete code examples
  • Debug with AI: "Why is this ARM64 assembly failing?" β†’ Get detailed explanations
  • Code Review: "Review this embedded C code" β†’ Get best practice suggestions
  • Error Resolution: "Fix this cross-compilation error" β†’ Get specific solutions

πŸ“š Documentation

πŸ”’ Security

  • Hardened compilation flags
  • Stack protection enabled
  • FORTIFY_SOURCE protection
  • RELRO and BIND_NOW linking

πŸ“„ License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

πŸ‘₯ Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

πŸ“ž Support

🏒 About Dynamic Devices

Dynamic Devices Ltd specializes in professional embedded Linux solutions for edge computing platforms, providing comprehensive hardware and software solutions for IoT, AI, and industrial applications.


Ready to start embedded development? Clone this repository and follow the Quick Start guide to get up and running in minutes!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published