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 console

Attach to the firmware’s console: over serial on a watch, over TCP to a running emulator, or to the native simulator under pbl debug, which moves its console off the terminal.

pbl console                       # the emulator, or the lab's watch
pbl console --tty /dev/ttyACM0    # a watch

On a watch, the port defaults to that of the lab’s watch for the build, and the baud rate to the build’s CONFIG_CONSOLE_BAUDRATE.

A console on the firmware’s own USB serial port (CONFIG_USB_CDC_ACM, the port having the build’s USB vendor and product IDs) keeps what it printed until the host opens the port, and sends it then. pbl console keeps those bytes, where the serial library would throw away what arrives as the port opens, so the boot banner and the logs since boot show up, also each time --reconnect opens the port again. On other ports, such as a UART behind a USB bridge, it still drops what arrived before it opened them.

Send help to list the console commands. Firmware log messages are hashed at compile time, so the binary only contains a hash and the arguments; the console dehashes them on the fly using the dictionary the build generates at build/log.dict.json. Debugging covers the flash log buffer and coredumps.

Options

pbl console [-h] [-b DIR] [--dry-run] [--lab FILE] [--watch NAME]
            [--wait [SECONDS]] [--tty TTY] [--rtt] [--baudrate BAUDRATE]
            [--qemu-host QEMU_HOST] [--reconnect]
--tty TTY

tty to use for the console (default: the lab’s)

--rtt

Attach to RTT channel 0, which ‘pbl debugserver’ serves with OpenOCD on TCP port 9090

--baudrate BAUDRATE

Baudrate for the target’s uart (default: the build’s, else 115200)

--qemu-host QEMU_HOST

host:port for the emulator’s or the simulator’s console (default: localhost:12345)

--reconnect

Wrap the console in a keep-alive driver that reconnects

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