Astra MCU SDK Examples - Overview

This repository contains example applications for the Synaptics SDK (Astra MCU SDK), demonstrating features and capabilities across Astra MCU platforms.

Throughout this guide, <sdk-root> refers to the directory where you extracted or cloned the SDK.

Scope


πŸ“‹ Table of Contents

  1. Overview

  2. Example Organization

  3. Prerequisites

  4. Directory Structure

  5. Build System Architecture

  6. Building Examples


Overview

The Synaptics SDK (Astra MCU SDK) provides core libraries, drivers, and build tools for Astra MCU development. This examples repository demonstrates how to build applications using the SDK in an out-of-tree configuration.

Out-of-tree means your application code lives in a separate directory from the SDK, keeping the SDK read-only and version-controlled independently.

Key Principles:

  • Out-of-tree examples β†’ Applications are maintained separately from the SDK core

  • Read-only SDK β†’ SDK acts as a versioned dependency, not modified directly

  • Reproducible builds β†’ Configuration files (defconfigs) drive consistent builds

  • Self-contained examples β†’ Each example can be built independently


Example Organization

Examples are organized by board and category:

SR110_RDK/
β”œβ”€β”€ configs/                    # Application defconfig files
β”‚   β”œβ”€β”€ cm55_demo_sample_app_defconfig
β”‚   β”œβ”€β”€ cm55_audio_example_defconfig
β”‚   └── ...
β”œβ”€β”€ audio_examples/             # Audio processing examples
β”‚   β”œβ”€β”€ audio_capture/
β”‚   β”œβ”€β”€ audio_playback/
β”‚   └── ...
β”œβ”€β”€ drivers_examples/           # Driver usage examples
β”‚   β”œβ”€β”€ gpio_example/
β”‚   β”œβ”€β”€ i2c_example/
β”‚   β”œβ”€β”€ spi_example/
β”‚   └── ...
β”œβ”€β”€ inference_examples/         # AI/ML inference examples
β”‚   β”œβ”€β”€ tflite_inference/
β”‚   └── ...
β”œβ”€β”€ vision_examples/            # Image processing examples
β”‚   β”œβ”€β”€ uc_person_classification/
β”‚   β”œβ”€β”€ object_detection/
β”‚   └── ...
β”œβ”€β”€ usb_examples/               # USB examples
└── unity_test/                 # Unit tests
SL2610_RDK/
β”œβ”€β”€ configs/                    # Application defconfig files
β”‚   β”œβ”€β”€ cm52_system_manager_rdk_defconfig
β”‚   β”œβ”€β”€ cm52_dma_sample_app_defconfig
β”‚   └── ...
β”œβ”€β”€ drivers_examples/           # Driver usage examples
β”‚   β”œβ”€β”€ dma_example/
β”‚   β”œβ”€β”€ i2c_exp_example/
β”‚   β”œβ”€β”€ spwm_example/
β”‚   └── ...
β”œβ”€β”€ system_manager/            # System Manager for SL2610_RDK

Example Structure

Each example typically contains:

  • Source files (.c, .cc, .h)

  • CMakeLists.txt - Build configuration

  • kconfig - Configuration options

  • README.md - Example-specific documentation

  • Assets - Models, test data, etc.

Configuration Files (defconfigs)

Defconfigs define:

  • Board selection (e.g., CONFIG_BOARD="sr110_rdk" or CONFIG_BOARD="sl2610_rdk")

  • Compiler choice (GCC or AC6)

  • Build type (Release, Debug)

  • Enabled SDK modules (drivers, utilities, etc.)

  • Application-specific settings

Example defconfig: SR110_RDK/configs/cm55_demo_sample_app_defconfig


Prerequisites

For full setup steps, see:

Required Tools

  • CMake 4.1.2

  • Ninja 1.13.1 or later

  • Python 3.13.x (for SDK image generation and tooling)

  • Toolchain: GCC 13.2.1, Arm Compiler 6.19 (AC6), or LLVM Clang 21.x (SR110 only; requires GCC sysroot)

Environment Variables

Set these environment variables before building:

# Required: SDK source directory
export SRSDK_DIR=<sdk-root>

# Required: Toolchain paths (choose one based on your compiler)
export GCC_TOOLCHAIN_13_2_1=/path/to/gcc-arm-none-eabi/bin
# OR
export AC6_TOOLCHAIN_6_19_0=/path/to/armclang/bin
# OR (SR110 + LLVM Clang)
export LLVM_TOOLCHAIN_ROOT=/path/to/llvm/bin
export GCC_TOOLCHAIN_ROOT=/path/to/gcc-arm-none-eabi

Use only one toolchain per build. LLVM builds require GCC_TOOLCHAIN_ROOT for the GCC sysroot and libstdc++.

Windows (PowerShell):

$env:SRSDK_DIR="C:\path\to\<sdk-root>
$env:GCC_TOOLCHAIN_13_2_1="C:\path\to\gcc-arm-none-eabi\bin"

VS Code: Add to .vscode/settings.json:

{
    "terminal.integrated.env.windows": {
        "SRSDK_DIR": "C:\\path\\to\\<sdk-root>,
        "GCC_TOOLCHAIN_13_2_1": "C:\\path\\to\\gcc-arm-none-eabi\\bin"
    }
}

Directory Structure

examples/
β”œβ”€β”€ build/                          # CMake build artifacts
β”‚   └── <target>/
β”‚       └── <compiler>/             # Build files per target/compiler
β”œβ”€β”€ install/                        # Installed Astra MCU SDK Package
β”‚   └── SR110_RDK/
β”‚       β”œβ”€β”€ include/                # SDK headers
β”‚       β”œβ”€β”€ lib/                    # SDK libraries (.a/.lib)
β”‚       β”œβ”€β”€ prebuilt/               # prebuilt libraries (.a/.lib)
β”‚       β”œβ”€β”€ config/
β”‚       β”‚   β”œβ”€β”€ config.h            # SDK configuration
β”‚       β”‚   └── *.ld/*.sct          # Linker scripts
β”‚       └── tools/
β”‚           └── cmake/              # Toolchain files
β”œβ”€β”€ out/                            # Final binaries
β”‚   └── <target>/
β”‚       β”œβ”€β”€ release/                # Release builds (.elf/.axf)
β”‚       └── debug/                  # Debug builds
β”œβ”€β”€ SR110_RDK/                      # Board-specific examples
β”‚   β”œβ”€β”€ configs/                    # Application defconfigs
β”‚   β”œβ”€β”€ audio_examples/
β”‚   β”œβ”€β”€ drivers_examples/
β”‚   β”œβ”€β”€ inference_examples/
β”‚   β”œβ”€β”€ vision_examples/
β”‚   └── ...
β”œβ”€β”€ CMakeLists.txt                  # Main build configuration
β”œβ”€β”€ Makefile                        # Build orchestration
└── kconfig                         # Example-level configuration

Build System Architecture

For build and flash workflows, see:


Two-Stage Build Process

Stage 1: SDK Build (BUILD=SRSDK, combined SDK + app)

  • Compiles SDK modules (drivers, os, soc, utilities, etc.)

  • Each module produces a static library (e.g., libdrivers.a)

  • Installs headers, libraries, and toolchain files to install/${BOARD}/

Stage 2: Application Build (BUILD=EXAMPLE)

  • Compiles application source files

  • Links against pre-built SDK libraries

  • Produces final executable (.elf or .axf)

Build Modes

  • BUILD=SRSDK β†’ Builds SDK libraries and the app (combined flow)

  • BUILD=EXAMPLE β†’ Builds application using pre-built SDK (default)

  • SDK-only β†’ Use make astrasdk BOARD=<BOARD> to build/install the SDK package without building an app

Key Features

Application Cache System:

  • Per-application cache of SDK headers and libraries

  • Hash-based change detection (libs, config.h, toolchain)

  • Automatic refresh when SDK changes

  • Location: build/<target>/<compiler>/srsdk_build/.cache/

Embedded SDK Build:

  • Automatically builds SDK if prebuilts are missing

  • Controlled via EMBED_SDK_BUILD CMake option

Configuration Management:

  • Kconfig-based configuration system

  • Defconfigs for reproducible builds

  • Interactive menuconfig editor


Building Examples

Important: SRSDK_DIR must be set to <sdk-root> in any shell where you build from <sdk-root>/examples/, even for app‑only builds.

export SRSDK_DIR=<sdk-root>

For step‑by‑step workflows, use the Build and Flash guides:

Understanding Build Modes

  • BUILD=SRSDK: Builds the SDK package from source, then builds your app using that fresh SDK.

    • Use when: first build, SDK source changed, or switching toolchains.

    • Slower, but ensures SDK and app are consistent.

  • BUILD=EXAMPLE (default): Builds only your app using the previously installed SDK package.

    • Use when: SDK already built and only app code changed.

    • Faster for iterative development.

Quick commands

# One-time per shell: point examples to your SDK root (required for combined builds and installing SDK into examples)
cd <sdk-root>/examples
export SRSDK_DIR=<sdk-root>

# Build SDK + application (combined; requires SRSDK_DIR)
make <cm55_demo_sample_app_defconfig> BOARD=SR110_RDK BUILD=SRSDK

# Rebuild application only (uses installed SDK)
make build BOARD=SR110_RDK