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
  • Pebble Firmware
    • Overview
    • Playground
    • Application SDK
  • 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
    • Drivers
    • Subsystems
    • Libraries
    • Third-party
  • Hardware
    • Boards
    • Board Add-ons
    • Programmers
  • Community
    • Contribution Guidelines
  • Reference
    • Reference
    • Kconfig options

pbl debug

Debug the firmware with GDB.

pbl debug

The board’s first runner with debug support starts its GDB server, then GDB on the build’s ELF, attached to the running firmware and with the repository’s GDB extensions loaded. Quitting GDB stops the server.

Runner

GDB server

Port

qemu

Proxy to the emulator, with the kernel’s threads

1233

openocd

OpenOCD

3333

probe-rs

probe-rs

1337

native

None: runs the simulator under gdb or lldb

On QEMU boards the emulator has to be running already, e.g. with pbl run in another terminal. A server already listening on the port, e.g. one started with pbl debugserver, is used as it is; --gdb-port picks another port.

Platforms with a serial-based debugger, e.g. over the programmer’s debug UART, need its port, given with --tty:

pbl debug --tty /dev/cu.usbmodem5B7A1355001

--probe selects one of several debug probes, as VID:PID[:SERIAL]. Debugging covers the setup, and GDB tutorial walks through a session.

Options

pbl debug [-h] [-b DIR] [--dry-run] [--lab FILE] [--watch NAME]
          [--wait [SECONDS]] [--gdb-port PORT]
          [-r {native,nrfutil,openocd,phone,probe-rs,qemu,sftool,wasm}]
          [--tty TTY] [--probe VID:PID[:SERIAL]] [--keep-flash-image]
          [--decoration NAME] [--sunlight] [--bt-hci CHARDEV]
          [--bt-addr ADDRESS] [--http-port HTTP_PORT] [--no-browser]
          [--via {adb,cloud,ip}] [--address ADDRESS] [--adb-serial ADB_SERIAL]
--gdb-port PORT

Port of the gdb server (default: the runner’s)

-r, --runner {native,nrfutil,openocd,phone,probe-rs,qemu,sftool,wasm}

Override the board’s runner

--tty TTY

Serial port for the sftool and probe-rs runners (default: the lab’s)

--probe VID:PID[:SERIAL]

Debug probe for the probe-rs runner (default: the lab’s)

--keep-flash-image

Keep the emulator’s SPI flash image, and the apps and data in it, instead of rebuilding it

--decoration NAME

SDL decoration the emulator draws around the screen, or ‘none’ (default: the build’s first)

--sunlight

Show the colors as a watch’s panel does in sunlight

--bt-hci CHARDEV

H4 Bluetooth controller for builds with CONFIG_NIMBLE_HCI_UART, e.g. the serial port /dev/cu.usbmodem1101

--bt-addr ADDRESS

Random static Bluetooth address the watch uses, e.g. C0:00:00:00:00:01, instead of its controller’s

--http-port HTTP_PORT

Port the wasm runner serves the page on (default: 8000)

--no-browser

Do not open the page the wasm runner serves in a browser

--via {adb,cloud,ip}

How the phone runner reaches the phone’s Developer Connection: adb (Android, the default), cloud (signed in with ‘pebble login’) or ip (implied by –address)

--address ADDRESS

Phone address (Developer Connection) for the phone runner

--adb-serial ADB_SERIAL

Serial of the Android phone for the phone runner, when adb sees several

Generated from PebbleOS 7416f78a1. This page is maintained in the pebbleos repository: docs/pbl/debug.md.