PebbleOS
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations
Firmware metadata

Build information stored at the end of every firmware image. More...

Data Structures

Macros

#define FW_METADATA_CURRENT_STRUCT_VERSION   0x1
 Value of FirmwareMetadata::metadata_version written by this firmware.
 
#define FW_METADATA_VERSION_SHORT_BYTES   8
 Size of FirmwareMetadata::version_short in bytes.
 
#define FW_METADATA_VERSION_TAG_BYTES   32
 Size of FirmwareMetadata::version_tag in bytes.
 
#define FIRMWARE_METADATA_IS_RECOVERY_FIRMWARE   (false)
 Value of FirmwareMetadata::is_recovery_firmware for this build.
 
#define FIRMWARE_METADATA_HW_PLATFORM   (FirmwareMetadataPlatformUnknown)
 Value of FirmwareMetadata::hw_platform for the board being built.
 

Enumerations

enum  FirmwareMetadataPlatform {
  FirmwareMetadataPlatformUnknown = 0 , FirmwareMetadataPlatformPebbleOneEV1 = 1 , FirmwareMetadataPlatformPebbleOneEV2 = 2 , FirmwareMetadataPlatformPebbleOneEV2_3 = 3 ,
  FirmwareMetadataPlatformPebbleOneEV2_4 = 4 , FirmwareMetadataPlatformPebbleOnePointFive = 5 , FirmwareMetadataPlatformPebbleTwoPointZero = 6 , FirmwareMetadataPlatformPebbleSnowyEVT2 = 7 ,
  FirmwareMetadataPlatformPebbleSnowyDVT = 8 , FirmwareMetadataPlatformPebbleSpaldingEVT = 9 , FirmwareMetadataPlatformPebbleBobbyDVT = 10 , FirmwareMetadataPlatformPebbleSpalding = 11 ,
  FirmwareMetadataPlatformPebbleSilkEVT = 12 , FirmwareMetadataPlatformPebbleRobertEVT = 13 , FirmwareMetadataPlatformPebbleSilk = 14 , FirmwareMetadataPlatformPebbleAsterix = 15 ,
  FirmwareMetadataPlatformPebbleObelixEVT = 16 , FirmwareMetadataPlatformPebbleObelixDVT = 17 , FirmwareMetadataPlatformPebbleObelixPVT = 18 , FirmwareMetadataPlatformPebbleGetafixEVT = 19 ,
  FirmwareMetadataPlatformPebbleGetafixDVT = 20 , FirmwareMetadataPlatformPebbleGetafixDVT2 = 21 , FirmwareMetadataPlatformPebbleOneBigboard = 0xff , FirmwareMetadataPlatformPebbleOneBigboard2 = 0xfe ,
  FirmwareMetadataPlatformPebbleSnowyBigboard = 0xfd , FirmwareMetadataPlatformPebbleSnowyBigboard2 = 0xfc , FirmwareMetadataPlatformPebbleSpaldingBigboard = 0xfb , FirmwareMetadataPlatformPebbleSilkBigboard = 0xfa ,
  FirmwareMetadataPlatformPebbleRobertBigboard = 0xf9 , FirmwareMetadataPlatformPebbleSilkBigboard2 = 0xf8 , FirmwareMetadataPlatformPebbleRobertBigboard2 = 0xf7 , FirmwareMetadataPlatformPebbleFlintEmu = 0xf6 ,
  FirmwareMetadataPlatformPebbleEmeryEmu = 0xf5 , FirmwareMetadataPlatformPebbleObelixBigboard = 0xf4 , FirmwareMetadataPlatformPebbleObelixBigboard2 = 0xf3 , FirmwareMetadataPlatformPebbleGabbroEmu = 0xf2
}
 Hardware platform a firmware image is built for. More...
 

Detailed Description

Build information stored at the end of every firmware image.

The firmware places a FirmwareMetadata in its .pbl_fw_version section, linked last, so a .bin image ends with the 20-byte GNU build ID followed by this structure. The firmware reads it back from flash for the recovery and update images, and host tools (tools/fw_binary_info.py, the GDB scripts) parse it from .bin and .elf files. All fields are little-endian.


Data Structure Documentation

◆ FirmwareMetadata

struct FirmwareMetadata

Firmware image metadata, 47 bytes, packed.

Firmware image metadata.

The four flags share one byte, starting at bit 0.

Data Fields
uint8_t hw_platform Hardware platform, a FirmwareMetadataPlatform value.
bool is_ble_firmware: 1 Bluetooth controller firmware image; always false for PebbleOS.
bool is_dual_slot: 1 Built for the dual-slot layout of the pblboot bootloader.
bool is_recovery_firmware: 1 Recovery firmware (PRF) image.
bool is_slot_0: 1 Built to run from slot 0 of a dual-slot layout; false for slot 1 and single-slot images.
uint8_t metadata_version Structure version, FW_METADATA_CURRENT_STRUCT_VERSION; the last byte of the image.
uint8_t reserved: 4 Reserved, 0.
char version_short[FW_METADATA_VERSION_SHORT_BYTES] Abbreviated commit hash (7 characters), NUL-terminated.
char version_tag[FW_METADATA_VERSION_TAG_BYTES] Version from git describe, e.g.

"v4.9.0", NUL-terminated, at most 31 characters.

uint32_t version_timestamp Commit time of the build's source revision, in seconds since the Unix epoch.

Macro Definition Documentation

◆ FIRMWARE_METADATA_HW_PLATFORM

#define FIRMWARE_METADATA_HW_PLATFORM   (FirmwareMetadataPlatformUnknown)

Value of FirmwareMetadata::hw_platform for the board being built.

FirmwareMetadataPlatformUnknown for boards without an entry.

◆ FIRMWARE_METADATA_IS_RECOVERY_FIRMWARE

#define FIRMWARE_METADATA_IS_RECOVERY_FIRMWARE   (false)

Value of FirmwareMetadata::is_recovery_firmware for this build.

true when built with CONFIG_RECOVERY_FW.

◆ FW_METADATA_CURRENT_STRUCT_VERSION

#define FW_METADATA_CURRENT_STRUCT_VERSION   0x1

Value of FirmwareMetadata::metadata_version written by this firmware.

◆ FW_METADATA_VERSION_SHORT_BYTES

#define FW_METADATA_VERSION_SHORT_BYTES   8

◆ FW_METADATA_VERSION_TAG_BYTES

#define FW_METADATA_VERSION_TAG_BYTES   32

Size of FirmwareMetadata::version_tag in bytes.

Enumeration Type Documentation

◆ FirmwareMetadataPlatform

Hardware platform a firmware image is built for.

Values are stable: they are stored in images. Bigboards (development boards) and emulators count down from 0xff.

Note
When adding a platform that uses the legacy CRC, add it to the list in tools/fw_binary_info.py.
Enumerator
FirmwareMetadataPlatformUnknown 

Unknown platform.

FirmwareMetadataPlatformPebbleOneEV1 

Original Pebble, EV1.

FirmwareMetadataPlatformPebbleOneEV2 

Original Pebble, EV2.

FirmwareMetadataPlatformPebbleOneEV2_3 

Original Pebble, EV2.3.

FirmwareMetadataPlatformPebbleOneEV2_4 

Original Pebble, EV2.4.

FirmwareMetadataPlatformPebbleOnePointFive 

Original Pebble, hardware 1.5.

FirmwareMetadataPlatformPebbleTwoPointZero 

Original Pebble, hardware 2.0.

FirmwareMetadataPlatformPebbleSnowyEVT2 

Snowy (Pebble Time), EVT2.

FirmwareMetadataPlatformPebbleSnowyDVT 

Snowy (Pebble Time), DVT.

FirmwareMetadataPlatformPebbleSpaldingEVT 

Spalding (Pebble Time Round), EVT.

FirmwareMetadataPlatformPebbleBobbyDVT 

Bobby (Pebble Time Steel), DVT.

FirmwareMetadataPlatformPebbleSpalding 

Spalding (Pebble Time Round), production.

FirmwareMetadataPlatformPebbleSilkEVT 

Silk (Pebble 2), EVT.

FirmwareMetadataPlatformPebbleRobertEVT 

Robert (Pebble Time 2), EVT.

FirmwareMetadataPlatformPebbleSilk 

Silk (Pebble 2), production.

FirmwareMetadataPlatformPebbleAsterix 

Asterix (Pebble 2 Duo).

FirmwareMetadataPlatformPebbleObelixEVT 

Obelix (Pebble Time 2), EVT.

FirmwareMetadataPlatformPebbleObelixDVT 

Obelix (Pebble Time 2), DVT.

FirmwareMetadataPlatformPebbleObelixPVT 

Obelix (Pebble Time 2), PVT.

FirmwareMetadataPlatformPebbleGetafixEVT 

Getafix (Pebble Round 2), EVT.

FirmwareMetadataPlatformPebbleGetafixDVT 

Getafix (Pebble Round 2), DVT.

FirmwareMetadataPlatformPebbleGetafixDVT2 

Getafix (Pebble Round 2), DVT2.

FirmwareMetadataPlatformPebbleOneBigboard 

Original Pebble bigboard.

FirmwareMetadataPlatformPebbleOneBigboard2 

Original Pebble bigboard, revision 2.

FirmwareMetadataPlatformPebbleSnowyBigboard 

Snowy bigboard.

FirmwareMetadataPlatformPebbleSnowyBigboard2 

Snowy bigboard, revision 2.

FirmwareMetadataPlatformPebbleSpaldingBigboard 

Spalding bigboard.

FirmwareMetadataPlatformPebbleSilkBigboard 

Silk bigboard.

FirmwareMetadataPlatformPebbleRobertBigboard 

Robert bigboard.

FirmwareMetadataPlatformPebbleSilkBigboard2 

Silk bigboard, revision 2.

FirmwareMetadataPlatformPebbleRobertBigboard2 

Robert bigboard, revision 2.

FirmwareMetadataPlatformPebbleFlintEmu 

Flint emulator (QEMU).

FirmwareMetadataPlatformPebbleEmeryEmu 

Emery emulator (QEMU).

FirmwareMetadataPlatformPebbleObelixBigboard 

Obelix bigboard.

FirmwareMetadataPlatformPebbleObelixBigboard2 

Obelix bigboard, revision 2.

FirmwareMetadataPlatformPebbleGabbroEmu 

Gabbro emulator (QEMU).