Skip to main content

alp-console

A single, shippable slot0 application that brings the alp interactive console up on the SoM's UART and — on the E1M-AEN801 — wires it to the on-module TI CC3501E Wi-Fi/BLE coprocessor plus a live RGB status LED. One app, three things to show: a Linux-like shell, on-air connectivity, and a "board is alive" indicator.

:::tip This page documents the example The alp command tree itself is SDK infrastructure with its own reference page — see Console for the full command surface, flags, and safety tiers. This page covers the example app that hosts it. :::

Source: examples/peripheral-io/alp-console/.

What it does

Almost nothing — and that's the lesson. Setting CONFIG_ALP_SDK_CONSOLE=y registers the whole alp command tree on the Zephyr shell at link time, so the app gets board / gpio / i2c / adc / pwm / mem / clk / reboot / companion diagnostics for free.

main() registers no commands. It only:

  1. Binds the companion chip (on Alif: opens the CC3501E and hands the handle to the console).
  2. Spawns the RGB status-LED thread.
SurfaceCommand(s)Backed by
Interactive shellalp … (Tab to explore)CONFIG_ALP_SDK_CONSOLE
SoM identityalp boardHW_INFO + the on-module EEPROM
Companion livenessalp companion ver / pingCC3501E bridge (Alif) / GD32 supervisor (V2N)
Wi-Fi scanalp companion wifi scanCC3501E Wlan_Scan
Wi-Fi connectalp companion wifi connect <ssid> [pass] [wpa3]CC3501E STA join
BLE enablealp companion ble enableCC3501E NWP controller + NimBLE host
BLE scanalp companion ble scanNimBLE ble_gap_disc
RGB status LED(automatic background thread)Alif UTIMER PWM (pwm-leds)

Wi-Fi

wifi scan lists nearby APs with channel, RSSI, and decoded security (open / wpa2 / wpa3). The security decode is worth knowing: it comes from the raw 16-bit TI SecurityInfo, whose sec-type bitmap lives in the high byte — (info >> 8) & 0x3f.

uart:~$ alp companion wifi scan
5 AP(s):
MyNetwork ch5 -43 dBm wpa3
Guest-2.4GHz ch3 -59 dBm wpa2
IoT-Hub ch6 -84 dBm open
uart:~$ alp companion wifi connect "MyNetwork" hunter2 wpa3
connecting to "MyNetwork" (wpa3)...
connected rssi=-44 dBm
ip 192.0.2.74

No passphrase means open; a trailing wpa3 token forces WPA3-SAE.

BLE

uart:~$ alp companion ble enable
BLE controller + NimBLE host up
uart:~$ alp companion ble scan
10 device(s):
66:c6:d2:91:31:26 -91 dBm ET-2870 Series
26:2a:8d:21:9d:4d -50 dBm (no name)

RGB status LED

A low-priority background thread breathes the on-board RGB LED through a rainbow on the Alif UTIMER PWM (the board overlay's pwm-leds children). The shell stays fully responsive while it runs. The thread is devicetree-guarded on led_red, so on a board without those PWM nodes (native_sim, V2N) it compiles out and nothing is spawned.

board.yaml

som:
sku: E1M-AEN801

preset: e1m-evk

cores:
a32_cluster:
os: "off"
m55_hp:
os: "off" # single-core HE app
m55_he:
app: ./src
peripherals:
- gpio # `alp gpio`
- i2c # `alp i2c`
- adc # `alp adc`
- spi # required by the CC3501E companion bridge

chips:
- cc3501e

diagnostics:
log_level: info

The console rides the board's existing chosen { zephyr,shell-uart } — no custom pins needed. The alp commands discover the peripheral buses through the EVK preset aliases.

prj.conf carries the console's own knobs:

CONFIG_ALP_SDK=y
CONFIG_ALP_SDK_CONSOLE=y
CONFIG_ALP_SDK_CONSOLE_UNSAFE=y
CONFIG_ALP_SDK_HW_INFO=y
CONFIG_SHELL=y
CONFIG_REBOOT=y
CONFIG_HWINFO=y
CONFIG_MAIN_STACK_SIZE=4096

:::warning CONFIG_ALP_SDK_CONSOLE_UNSAFE This unlocks the write-capable verbs (mem wr, gpio write, companion gpio write). The example sets it because it's a bench build. Leave it off in field builds. :::

Portability

main() is identical across targets; only the companion bind differs.

TargetCompanion bind
Alif (AEN801)No companion singleton, so main() opens the CC3501E via cc3501e_bridge_bringup() and hands the handle to the console. alp companion … then reaches Wi-Fi/BLE. Guarded by CONFIG_ALP_SDK_CHIP_CC3501E.
V2NThe GD32 supervisor is a managed singleton inside the SDK — the bind is a no-op and alp companion reaches the GD32 automatically. Its gpio sub-commands replace the CC3501E wifi/ble ones.
native_simNo companion at all. The console plus every non-companion command still works, so the example builds and runs everywhere.

Portability-lint allowlist

This example is on the SDK's example-portability lint allowlist. It reaches for Zephyr driver headers directly in two places:

  • zephyr/drivers/pwm.h for the RGB status LED;
  • gpio.h / pinctrl.h in the CC3501E bridge's own control-transport HAL.

Both are pre-existing gaps that predate the portable-surface migration; moving the LED path onto <alp/pwm.h> is tracked as separate follow-up work.

Status

build_only: true on native_sim/native/64. CI proves it compiles and links; the shell, Wi-Fi, BLE, and LED behaviour are bench signals on real AEN silicon.

The app is slot0-linked (CONFIG_FLASH_LOAD_OFFSET=0x10000), so it flashes via the MRAM path: app-gen-toc builds a signed ATOC, then J-Link loads the image and the ATOC to their addresses. The companion CC3501E must already be running its bridge firmware.

See also

Questions about this page? Discuss in Community Forum