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

PebbleOS

  • Overview
  • Contributing
  • Exposing APIs to the SDK
  • Development
    • Prerequisites
    • The pbl CLI
    • Configuration Options
    • Building firmware
    • Build system
    • Running and writing tests
    • Integration tests
    • QEMU
    • Native
    • Debugging
    • Moddable JS Engine
    • Exposing functions to the SDK
    • Software bill of materials
    • Contribution Guidelines
  • Architecture
  • Boards
  • Reference
  • Firmware API Reference

Configuration Options

When configuring the build (pbl configure ...) there are several options you can enable or tune. Below you will find a list of the most relevant ones.

Choosing your target

There are a number of target boards to choose from when building PebbleOS. You can do so by using the (--board) flag followed by:

asterix:

(Core Devices) Pebble 2 Duo

obelix@bb2, obelix@dvt, obelix@pvt:

(Core Devices) Pebble Time 2

getafix@dvt, getafix@dvt2:

(Core Devices) Pebble Round 2

qemu_emery, qemu_flint, qemu_gabbro:

dedicated QEMU targets (see QEMU)

Keep in mind that some targets may not currently compile as-is.

Variant

--variant:

Build variant, normal (main firmware) or prf (recovery firmware).

Release build

-DCONFIG_RELEASE=y:

Build a release-mode firmware. Strips debug aids, enables shipping defaults, and reduces battery usage compared to a debug build. Pass this to pbl configure.

Main features

-DCONFIG_MODDABLE_XS=y / -DCONFIG_MODDABLE_XS=n:

Force the Moddable SDK’s XS JavaScript engine on or off, overriding the board defconfig. Pass to pbl configure. See Moddable JS Engine. PRF (recovery) builds always disable the engine regardless of this value.

Manufacturing

-DCONFIG_MFG=y:

Enable manufacturing-only functionality in the PRF build.

Debugging

-DCONFIG_WATCHDOG=n:

Build without the hardware watchdog driver. Software failures then halt with interrupts disabled for a debugger instead of rebooting, and the task watchdog only logs the stalls it detects.

-DCONFIG_DEBUG_INFO_MACROS=y:

Compile with -g3 rather than -g, so a debugger can expand the firmware’s macros. It costs around 7% of the compile time and makes the objects, and with them the link, noticeably larger.

-DCONFIG_LINKER_MAP=y:

Write build/pebbleos.map, the cross-referenced link map that tools/analyze_fw_static_memory_usage.py reads. It is tens of megabytes and costs around a fifth of the link.

Flashing

The flash, run and debug commands talk to a connected device through a runner. Each board declares its supported runners in its board manifest (e.g. boards/<board>/<board>.yml) and the first one is used by default. For the OpenOCD runner, the probe and target configuration lives in the board’s support/openocd.cfg.

--runner:

Override the board’s default runner for flash/run/debug.

--tty:

Serial port used by the sftool runner.

--resources:

Also flash system resources alongside the firmware (sftool runner).

Logging

-DCONFIG_DEFAULT_LOG_LEVEL_<LEVEL>=y:

Default log level, where <LEVEL> is one of ERROR, WARNING, INFO (default), DEBUG or DEBUG_VERBOSE.

-DCONFIG_LOG_HASHED=n:

Disable log messages hashing. This will increase ROM usage, but will not require a dictionary file to decode logs.

-DCONFIG_<MODULE>_LOG_LEVEL_RUNTIME=y:

Keep all log messages of a module in the image and filter them at runtime, using CONFIG_<MODULE>_LOG_LEVEL as the initial level. The level is changed with PBL_LOG_MODULE_LEVEL_SET(name, level) and read with PBL_LOG_MODULE_LEVEL_GET(name), where name is the one given to PBL_LOG_MODULE_DEFINE. Messages accepted by the module level skip the serial and flash log level filters. This will increase ROM usage for that module.

The Settings → System → Debugging → Vibe Log Info preference sets the alert UI, vibe score, and vibe pattern modules to DEBUG, so their traces reach bug reports. Normal firmware enables runtime levels for these modules by default. Disabling the preference restores each module’s configured level; the preference is also applied at boot. Recovery firmware keeps compile-time logging by default.

These and many more options can also be browsed and changed interactively with pbl menuconfig after configuring.

Generated from PebbleOS 91af4a22c. This page is maintained in the pebbleos repository: docs/development/options.md.

Overview

  • Choosing your target
  • Variant
  • Release build
  • Main features
  • Manufacturing
  • Debugging
  • Flashing
  • Logging