---
title: "Getting Started"
description: "This page walks you from a fresh clone to a running Alp SDK example. If you already have a Zephyr toolchain, jump to step 3."
source: https://docs.alplab.ai/getting-started
---

# Getting Started

This page walks you from a fresh clone to a running Alp SDK example. If you already have a Zephyr toolchain, jump to step 3.

:::tip[Two ways to develop]
Pick whichever fits your workflow:

- **Hand-written firmware** — write C against `<alp/...>` headers directly. The path covered below.
- **alp-studio codegen** — drag-and-drop blocks; Studio emits the same `<alp/...>` API. See [Alp Studio](https://studio.alplab.ai).
:::

The flow at a glance:

```mermaid
flowchart LR
  A[Install<br/>toolchain] --> B[Clone +<br/>bootstrap]
  B --> C[Build<br/>native_sim]
  C --> D{Runs?}
  D -->|yes| E[Flash real<br/>hardware]
  D -->|no| B
```

## Prerequisites

The SDK is supported equally on **Linux**, **macOS**, and **Windows** (native PowerShell or WSL2). Tooling versions are identical across hosts.

| Tool        | Version          | Notes                                                           |
|-------------|------------------|-----------------------------------------------------------------|
| Zephyr      | v4.4.1           | Pinned by the SDK's `west.yml` and `metadata/bootstrap.json`.   |
| Zephyr SDK  | 1.0.1            | Pinned by `metadata/toolchains.json`. Real silicon only.        |
| Python (bootstrap floor) | 3.10+ | `prerequisites.pythonMinVersion` — the host-universal floor the bootstrap scripts enforce. |
| Python (Zephyr build floor) | 3.12+ | `zephyr.pythonMinVersion` — Zephyr's real build floor. **Not** enforced by `bootstrap.sh` / `bootstrap.ps1`; Zephyr's own CMake enforces it at `west build` time. |
| Python deps | `pyyaml`, `jsonschema`, `imgtool` | Installed by `scripts/bootstrap.sh`.        |
| CMake       | 3.20+            | `find_package(Zephyr)` minimum.                                 |
| C compiler  | GCC 11+ / Clang 14+ | `native_sim` builds; cross-toolchain for real silicon.       |
| west        | 1.2+             | `pip install west` if your distro doesn't ship it.              |
| [`tan` CLI](https://docs.alplab.ai/sdk/tools/cli) | 0.7.0 | The SDK's sole user-facing command. A **Python** program shipped as a self-contained PyInstaller freeze — **no Rust toolchain, no rustup, no host Python interpreter**. Installed by its own script; the SDK bootstrap does **not** install it. `tan` 0.7.0 requires alp-sdk **v0.17.0** or newer. |

The POSIX bootstrap prerequisites are `git`, `cmake`, `python3`, `ninja`, `xz`, and `wget` — `ninja` is a real prerequisite, not an optional extra. On Windows, **7-Zip** is additionally required; it gates the Zephyr SDK unpack in `tan bootstrap`'s toolchain phase, not `bootstrap.ps1`.

Per-platform install one-liners:

**macOS:**

```bash title="Homebrew"
brew install git cmake python ninja xz wget
pip3 install west
```

**Linux:**

```bash title="Debian / Ubuntu"
sudo apt install -y git cmake python3 python3-pip ninja-build xz-utils wget
pip3 install west
```

**Windows (PowerShell):**

```powershell title="winget"
winget install -e --id Kitware.CMake
winget install -e --id Ninja-build.Ninja
winget install -e --id Python.Python.3.12
winget install -e --id Git.Git
winget install -e --id 7zip.7zip
pip install west
```

7-Zip unpacks the Zephyr SDK archive, so it gates `tan bootstrap`'s toolchain phase — `bootstrap.ps1` runs without it.

**Windows (WSL2):**

```powershell title="One-time WSL setup"
wsl --install -d Ubuntu
```

Then follow the **Linux** tab inside your Ubuntu shell.

For real-silicon builds you'll also need the [Zephyr SDK](https://docs.zephyrproject.org/latest/develop/toolchains/zephyr_sdk.html) `arm-zephyr-eabi` toolchain, pinned at **1.0.1** by `metadata/toolchains.json` — as of `tan` 0.7.0, `tan bootstrap` installs and verifies it for you (`--no-toolchain` skips it) — and a JTAG/SWD probe.

:::caution[Intel Mac: no Zephyr SDK target]
The pinned Zephyr SDK ships a `macos-aarch64` host archive only — there is no `macos-x86_64`. On an Intel Mac `tan bootstrap` skips the toolchain phase with a message, so **real-silicon Zephyr builds need a Linux host instead**. `native_sim` and the rest of the bootstrap are unaffected.
:::

## Step 1 — Install `tan`, clone, and bootstrap

Install [`tan`](https://docs.alplab.ai/sdk/tools/cli) **first** — bootstrapping the SDK is itself a `tan` verb. The default branch of `alp-sdk` is `dev`, which carries unreleased changes, so the commands below check out the **v0.17.0** release tag. The canonical first-install sequence:

```bash title="First install"
git clone --branch v0.17.0 https://github.com/alplabai/alp-sdk
cd alp-sdk

# highlight-next-line
curl -fsSL https://raw.githubusercontent.com/alplabai/tan-cli/main/install.sh | sh
# Windows PowerShell: irm https://raw.githubusercontent.com/alplabai/tan-cli/main/install.ps1 | iex

tan bootstrap --sdk-root "$PWD"     # workspace, venv, west, and the arm-zephyr-eabi toolchain
tan doctor

tan init --name my-app --destination .. --sdk-root "$PWD"
cd ../my-app
tan build
```

Every customer-facing step is a `tan` verb. As of `tan` 0.7.0 there is no separate `west sdk install` step: `tan bootstrap` installs the cross toolchain into `~/.alp/toolchains/` (hashing the archive against alp-sdk's pin), and `tan build` finds it there. If that download fails with `403 API rate limit exceeded` (a shared office egress, a VPN or a CI runner pool), set `TAN_GITHUB_TOKEN` (no scopes needed; `GH_TOKEN` / `GITHUB_TOKEN` also work) and re-run `tan bootstrap`. `tan sdk install` / `tan sdk switch` are not ported yet, so you still clone the SDK yourself.

:::warning[Upgrade `tan` and the SDK together]
`tan` 0.7.0 needs alp-sdk **v0.17.0** or newer — against v0.16.0, `tan build` fails Kconfig configure on any Zephyr board. See the [`tan` CLI page](https://docs.alplab.ai/sdk/tools/cli#install).
:::

The SDK also ships its bootstrap script, if you'd rather run it directly:

```bash title="Clone + bootstrap"
git clone --branch v0.17.0 https://github.com/alplabai/alp-sdk
cd alp-sdk
# highlight-next-line
bash scripts/bootstrap.sh
source ../.venv/bin/activate
export ZEPHYR_BASE="$PWD/../zephyr"
```

`scripts/bootstrap.sh` makes **the alp-sdk checkout's parent the west workspace** (`west init -l`), runs `west update --narrow`, installs `west` + the SDK's Python deps and an editable install of alp-sdk's internal Python tooling (the `alp_cli` library modules — not a command of its own) into a workspace venv (your system Python is never touched), does **not** install the cross toolchain (`tan bootstrap` does), and prints host-specific hints for the optional native libraries the Yocto backends need. It's idempotent, and it reuses an existing `$ZEPHYR_BASE` workspace only when it's a compatible v4.4.x tree *whose manifest is this checkout*. It enforces the **3.10** host Python floor and nothing more — Zephyr's **3.12** build floor is checked only later, by Zephyr's own CMake.

:::caution[Bootstrap does not give you a command to run]
There is no `alp` binary installed anywhere — `pyproject.toml` registers only `alp-mcp` — and as of alp-sdk v0.17.0 there is no `python -m alp_cli <verb>` front door either. `tan` does **not** shell out to `alp_cli`: `tan` is itself a Python program and carries its own implementations. Install [`tan`](#install-the-tan-cli) before you build anything.
:::

The layout it produces — alp-sdk is the manifest repo, so **the topdir is its parent**:

```
<parent>/                # west topdir
├── alp-sdk/             # this repo — the workspace manifest
├── .west/
├── .venv/               # hermetic west + Zephyr Python deps
├── zephyr/              # v4.4.1
└── modules/
```

:::info[Changed in v0.10.1]
Bootstrap used to create a separate `zephyrproject/` workspace from the upstream Zephyr manifest, which left alp-sdk as a non-manifest project — so west never discovered the SDK's extension commands and every `west alp-*` command failed with **"unknown command"** (#769). It now inits from alp-sdk's own `west.yml`, which both registers the surviving `west alp-*` commands and moves the topdir to the checkout's parent. If you bootstrapped earlier, re-run on a fresh clone; `../zephyrproject/zephyr` is no longer the right `ZEPHYR_BASE`.
:::

On **native Windows**, run the PowerShell-7+ companion instead:

```powershell title="Native Windows (PowerShell)"
git clone --branch v0.17.0 https://github.com/alplabai/alp-sdk
cd alp-sdk
pwsh scripts\bootstrap.ps1
& ..\.venv\Scripts\Activate.ps1
$env:ZEPHYR_BASE = "$PWD\..\zephyr"
```

`bootstrap.ps1` won't install git / CMake / Python / Ninja for you (it prints the matching `winget install` line and exits if one is missing) and leaves the Arm toolchain + Zephyr SDK as manual installs. `native_sim` isn't available on native Windows — use WSL2 for the simulator + Yocto halves.

:::warning[Bootstrapped on Windows before v0.11.0? Your layout is stale]
Through v0.10.1 the #769 fix had landed in `bootstrap.sh` only, so `bootstrap.ps1` initialised from the upstream Zephyr manifest into a `zephyrproject\` sibling, leaving every `west alp-*` command an **"unknown command"**. As of **v0.11.0** `bootstrap.ps1` produces the same layout as `bootstrap.sh`. Re-run `pwsh scripts\bootstrap.ps1` on a fresh clone and update `ZEPHYR_BASE` — the old `..\zephyrproject\zephyr` path no longer applies, and the old workspace is **not** reused. See [Installation](https://docs.alplab.ai/sdk/installation#windows-native-bootstrap).
:::

### Install the `tan` CLI

[`tan`](https://docs.alplab.ai/sdk/tools/cli) is the SDK's **sole user-facing command** — scaffolding, validating, generating, host preflight, serial console, diagnostics, and building / flashing / sizing / bundling / cleaning / running headless on `native_sim`. It ships from its own repo ([`alplabai/tan-cli`](https://github.com/alplabai/tan-cli)) on its own version line — currently **`0.7.0`** — so you install it **separately** from the SDK bootstrap, and before it.

`tan` is a **Python** program, released as self-contained PyInstaller `--onedir` freezes. The install script puts a ready-to-run freeze on your `PATH`; there is no Rust toolchain, no rustup, and no Python interpreter to provide.

```bash title="One-time"
curl -fsSL https://raw.githubusercontent.com/alplabai/tan-cli/main/install.sh | sh
```

```powershell title="Windows PowerShell"
irm https://raw.githubusercontent.com/alplabai/tan-cli/main/install.ps1 | iex
```

On Linux and macOS the installer needs only a downloader (`curl` **or** `wget`), `tar`, and `sha256sum` (macOS: `shasum`), and it verifies the archive's SHA-256 digest. From a source checkout instead: `python3 -m pip install ./python`, inside a virtual environment, with **Python 3.12 or newer**.

Everything then runs inside that one program — no verb forwards to `python -m alp_cli`:

- **`build` / `flash` / `size` / `image` / `clean` / `run`** — `tan`'s own build executor. Per [ADR 0020](https://github.com/alplabai/alp-sdk/blob/main/docs/adr/0020-sdk-owns-build-execution.md), alp-sdk is **plans-only** for this surface: `tan` runs `west` / `bitbake` / `cmake` per slice itself.
- **`model`, `monitor`, `faultdecode`, `new-som`** — native Python inside `tan`.
- **`generate`** — renders **in-process** from `tan.planner`; spawning the SDK's `scripts/alp_project.py` is an opt-in escape hatch behind `TAN_GENERATE_EXECUTOR=subprocess`. There is no `tan emit` verb — use `tan generate --target <target>`.
- **`validate`** — as of `tan` 0.7.0, also **in-process**: a port of the SDK's board.yaml validator; `TAN_VALIDATE_ENGINE=subprocess` spawns the SDK's `scripts/validate_board_yaml.py` instead.

## Step 2 — Set up the Zephyr workspace (alternative)

If you'd rather drive `west` directly — works on every host:

```bash
mkdir alp-workspace && cd alp-workspace
west init -m https://github.com/alplabai/alp-sdk --mr v0.17.0
west update --narrow -o=--depth=1
west zephyr-export
export ZEPHYR_BASE="$PWD/zephyr"
```

After this the topdir contains `zephyr/` (v4.4.1, pinned by the SDK's `west.yml`), the standard Zephyr modules, and `alp-sdk/` as the workspace manifest. Initialising from alp-sdk's manifest is what registers the surviving `west alp-*` commands — `west alp-migrate` (board.yaml schema migration), `west alp-lock` (dependency lockfile), `west alp-quality` (quality-task registry) and `west alp-emit` (the generated-artefact subset). Building is **not** among them: that surface belongs to `tan`.

## Step 3 — Build the GPIO example

[`tan`](https://docs.alplab.ai/sdk/tools/cli) is the single front door — from inside a project it finds `board.yaml`, builds every core, and (on `native_sim`) runs the result in one step:

```bash
cd alp-sdk/examples/peripheral-io/gpio-button-led
tan run                    # build for native_sim + execute
```

There is no `--board` selector: the target comes from the project's own `board.yaml` — `native_sim/native/64` on your host or real silicon. From outside the project directory, point `tan` at it instead:

```bash
tan --project alp-sdk/examples/peripheral-io/gpio-button-led build
```

Expected output:

```
*** Booting Zephyr OS build v4.4.1 ***
[gpio] init button=BOARD_PIN_ENCODER_SW, led=BOARD_PIN_LED_RED
[gpio] led=0 status=0
[gpio] led=1 status=0
...
[gpio] done
```

`tan build` validates the example's `board.yaml` (via alp-sdk's `alp_orchestrate`), generates `alp.conf` + the build-time `<alp_hw_info_build.h>` companion header, and delegates to `west build` per slice. See the [`board.yaml` reference](https://docs.alplab.ai/sdk/board-yaml) for the schema.

alp-sdk's own contribution to that pipeline is inspectable without `tan` — it emits plans, it never builds:

```bash
PYTHONPATH=scripts python3 -m alp_orchestrate --input board.yaml --emit build-plan
PYTHONPATH=scripts python3 -m alp_orchestrate --input board.yaml --emit system-manifest
```

## Step 4 — Target real hardware

For an Alp Lab EVK (or your own board), `tan` builds every core from the project's `board.yaml` and programs the whole system over its registered flash backends. Nothing changes on the command line between `native_sim` and real silicon — the target lives in `board.yaml`:

```bash
cd alp-sdk/examples/peripheral-io/gpio-button-led
tan build && tan flash --confirm
```

`--confirm` arms the write on the backends that gate it; an AEN Flow D (MRAM) slice additionally needs `--atoc-unqueryable`, which acknowledges that the write replaces the module's whole ATOC (see [`tan flash`](https://docs.alplab.ai/sdk/tools/cli#tan-flash--program-the-built-project)). `tan flash --dry-run` previews every backend without touching the board.

From the workspace topdir, name the project instead:

```bash
# AEN family on the E1M EVK
tan --project alp-sdk/examples/peripheral-io/gpio-button-led build
tan flash alp-sdk/examples/peripheral-io/gpio-button-led

# V2N family on the E1M-X EVK — the M33 system-manager app; preview first
tan --project alp-sdk/examples/v2n/v2n-gd32-bridge-ping build
tan flash alp-sdk/examples/v2n/v2n-gd32-bridge-ping --dry-run
tan flash alp-sdk/examples/v2n/v2n-gd32-bridge-ping --confirm
```

The on-module helper MCUs — the GD32 bridge on V2N / V2M and the CC3501E on AEN — are programmed by Alp Lab in production. `tan flash` skips them (`flash_policy: recovery_only`); field updates go over their own update channels, and recovering a bricked one is a separate procedure with Alp Lab-supplied binaries (see the SDK's [`docs/gd32-bridge.md`](https://github.com/alplabai/alp-sdk/blob/main/docs/gd32-bridge.md) for the GD32).

Board files ship in-tree under `zephyr/boards/alp/` (exposed via `zephyr/module.yml`'s `board_root`) — nothing extra to fetch.

To order an Alp Lab EVK, [request a dev kit](https://alplab.ai/developerskit-form/).

## What next?

- [Firmware Quickstart](https://docs.alplab.ai/sdk/firmware-quickstart) — patterns per SoM family (PMICs, RTC, Ethernet PHYs, DEEPX, GD32 bridge)
- [`board.yaml`](https://docs.alplab.ai/sdk/board-yaml) — single declarative project config
- [API reference](https://docs.alplab.ai/sdk/api/overview) — every `<alp/*.h>` library
- [Examples catalogue](https://docs.alplab.ai/sdk/examples/overview) — minimal apps, one per peripheral class
- [VS Code extension](https://docs.alplab.ai/sdk/tools/vscode) — schema-aware editing, GUI configurator, west wrappers
