---
title: "Board Self-Test"
description: "The \"run this first on a fresh board\" self-test — identity, SoC, power, I²C bus"
source: https://docs.alplab.ai/sdk/examples/board-selftest
---

# `board-selftest`

The "run this first on a fresh board" self-test. Four checks, chip-free, portable across every E1M family — it answers *is this board alive and is it the board I think it is* before you spend an afternoon debugging an app. New in v0.14.0.

Source: [`examples/bringup/board-selftest/`](https://github.com/alplabai/alp-sdk/tree/main/examples/bringup/board-selftest).

## What it does

1. **SoM identity** — `alp_hw_info_read()`.
2. **SoC alive** — `alp_soc_secure_fw_ping()` then `alp_soc_info_read()`.
3. **Power profile** — `alp_power_profile_get(RUN)`.
4. **I²C bus scan** — `alp_i2c_read()` across the bus.

It opens the bus through the `BOARD_I2C_SENSORS` alias, so it runs on any E1M SoM without editing the source.

## SKIP is not FAIL

The three-state result is the point of this example. A check that **cannot answer on this hardware** reports `SKIP` — that is not a failure, and it is not something to chase. `FAIL` means the check ran and the answer was wrong. `PASS` means it ran and answered. Read the summary line accordingly:

```
[selftest] result: 4 PASS, 0 SKIP, 0 FAIL
```

## `board.yaml`

```yaml
som:
  sku: E1M-AEN801

preset: e1m-evk
supported_boards:
  - e1m-evk
  - e1m-x-evk

pins:
  - { e1m: E1M_I2C0, macro: EVK_I2C_BUS_SENSORS, doc: "Shared sensor + IO-expander + INA236 bus" }

cores:
  m55_hp:
    peripherals: [i2c]
```

## Expected output

Real hardware (E1M-AEN801), every check able to answer:

```
[selftest] === board self-test ===
[selftest] SoM identity: E1M-AEN801 rev r1 sn AEN0000123 -> PASS
[selftest] SoC identity: alif:ensemble:e8 (secure-fw OK) -> PASS
[selftest] power profile: RUN core 800 mV @ 400 MHz -> PASS
[selftest] i2c scan BOARD_I2C_SENSORS: 3 device(s) -> PASS
[selftest] result: 4 PASS, 0 SKIP, 0 FAIL
[selftest] done
```

:::note[Illustrative, not a bench citation]
The block above is **illustrative**. No dated bench capture is published for it — see [Status](#status).
:::

Under `native_sim` the emulated I²C bus is empty and there is no EEPROM target behind the identity read:

```
[selftest] SoM identity ... -> FAIL
[selftest] SoC identity ... -> SKIP
[selftest] power profile ... -> SKIP
[selftest] i2c scan ... 0 device(s) -> PASS
[selftest] result: 1 PASS, 2 SKIP, 1 FAIL
[selftest] done
```

That `FAIL` under `native_sim` is **expected and honest** — there is no EEPROM to read, so the identity check ran and could not produce the right answer. It is not a defect in the example, and it is not something to "fix" before moving on.

## Status

- **Build-only / `native_sim`-green.** The `native_sim` block above is what CI actually exercises.
- The real-hardware block is illustrative; **no dated bench capture is published**.
- Catalog status: `stable`.
- This is the canonical example behind the `diagnostics` scaffold template.

## See also

- [`<alp/hw-info.h>` reference](https://docs.alplab.ai/sdk/api/hw-info) — `alp_hw_info_read`
- [`<alp/power.h>` reference](https://docs.alplab.ai/sdk/api/power) — `alp_power_profile_get`
- [`<alp/peripheral.h>` reference — I²C](https://docs.alplab.ai/sdk/api/peripheral) — `alp_i2c_read`
- [`i2c-scanner`](https://docs.alplab.ai/sdk/examples/i2c-scanner) — the bus scan on its own, in more detail
- [`board.yaml` reference](https://docs.alplab.ai/sdk/board-yaml)
- [Examples overview](https://docs.alplab.ai/sdk/examples/overview)
