pebble
  • Tutorials
  • Get the SDK
  • Guides
  • Documentation
  • PebbleOS
  • Mobile App
  • Examples
  • Index 01
  • Community
  • Blog
  • More
Privacy
Cookies
Publish

PebbleOS

  • Overview
  • Start here
    • Getting started guide
    • Playground
  • Development
    • The pbl CLI
      • pbl configure
      • pbl build
      • pbl bundle
      • pbl menuconfig
      • pbl clean
      • pbl test
      • pbl itest
      • pbl samples
      • pbl sdk
      • pbl run
      • pbl console
      • pbl debug
      • pbl debugserver
      • pbl emulator
      • pbl image_resources
      • pbl image_recovery
      • pbl erase
      • pbl lab
      • pbl power
      • Extending pbl
    • Build system
    • Samples
    • Emulator and simulator
    • Testing
    • Debugging
    • Conventions
  • System
    • Architecture overview
    • Kernel
    • Subsystems
    • Drivers
    • Services
    • Libraries
    • Third-party
    • Application SDK
  • Hardware
    • Boards
    • Programmers
  • Community
    • Contribution Guidelines
  • Reference
    • Reference
    • Kconfig options

The pbl CLI

pbl is the developer command line for this repository: it configures and builds the firmware, puts the result on a device or an emulator, and hosts the operational commands around that.

It is a Python package, installed along with the rest of the project’s dependencies (see the Getting started guide):

pip install -r requirements.txt

After that pbl is on the PATH whenever the virtual environment is active. Run it from anywhere inside the checkout:

pbl configure --board asterix
pbl build
pbl run

pbl --help lists every command, grouped; pbl <command> --help shows one command’s own options.

Commands

Build

Device

pbl configure

pbl run

pbl build

pbl console

pbl bundle

pbl debug

pbl menuconfig

pbl debugserver

pbl clean

pbl emulator

pbl test

pbl image_resources

pbl itest

pbl image_recovery

pbl samples

pbl erase

pbl sdk

pbl lab

pbl power

Shared options

These options are accepted by every command, before or after the command name:

  • -b, --build-dir DIR — use a different build directory. It defaults to the one pbl.yml names (build/, or build-test/ for pbl test), and PBL_BUILD_DIR overrides that in turn.

  • --dry-run — print the commands that would run instead of running them.

  • --lab FILE — the lab file describing the hardware wired to this host, which device commands take their ports from. It defaults to $PBL_LAB, else ~/.config/pbl/lab.yaml.

  • --watch NAME — the lab’s watch to use, when several run the build.

Separate build directories let several boards be built side by side:

pbl -b build-qemu configure --board qemu_emery
pbl -b build-asterix configure --board asterix
pbl -b build-asterix run

Where its knowledge comes from

pbl holds no facts about the checkout of its own:

  • The workspace is wherever pbl.yml is, found by walking up from the current directory. That file also names the build and test directories.

  • The build is read back from its own byproducts: .config for every CONFIG_ symbol, CMakeCache.txt for the board, the variant and the project name the artifacts are named after. Configuring is therefore the only way to tell pbl about a build, and reconfiguring is enough to change its mind.

  • The board contributes the rest through boards/<board>/<board>.yml: its revisions, the binary runners it supports, and the SDL decorations the emulator can draw around its screen.

Runners

Device commands reach their target through a binary runner: a watch, or a program on the host running the firmware, such as the emulator. A board lists the runners it supports in its manifest, and for each command the first one that can handle the build and the command is the default, so a board can be flashed with one runner and debugged with another; -r/--runner picks another.

Runner

Boards

Operations

openocd

asterix

flash (with resources), erase, debug, debugserver

nrfutil

asterix

flash (with resources), erase

sftool

obelix, getafix, sf32lb57_dpi_hdk

flash (with resources), erase

probe-rs

asterix, obelix, getafix

debug, debugserver

phone

asterix, obelix, getafix

flash (always with resources)

qemu

qemu_*

run, debug, debugserver

native

native_*

run, debug

wasm

native_*/wasm

run

For the OpenOCD runner, the probe and target configuration lives in the board’s support/openocd.cfg, and how to write the resources and erase ranges, in support/flash.cfg.

The nrfutil runner needs a J-Link probe. To write the resources it takes the external flash configuration from the board’s support/nrfutil_ext_mem.json.

The probe-rs runner needs probe-rs. It takes the chip from the board’s support/probe-rs.yml. Some platforms have a serial-based debugger, e.g. over the programmer’s debug UART: give its port with --tty. --probe picks one of several debug probes. Both default to the lab’s watch, see pbl lab. Where probe-rs misreports the flash region to GDB, the file’s gdb-flash gives it, so that GDB sets hardware breakpoints there.

The phone runner needs no programmer: it goes through the Pebble app’s Developer Connection, at the phone address given with --address. It needs libpebble2.

Generated from PebbleOS 7753e801d. This page is maintained in the pebbleos repository: docs/pbl/index.md.

Overview

  • Commands
  • Shared options
  • Where its knowledge comes from
  • Runners