Skip to content

About

PebbleOS on a simulated Pebble 2 Duo (nRF52840), running on pyrite

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run this firmware with no hardware. Simantic simulates the whole board, peripherals, sensors and buses included. Try it free at simantic.com, or run it locally: curl -fsSL https://simantic.com/install | sh

Run PebbleOS on a simulated Pebble 2 Duo

PebbleOS booting to the launcher, then the watch face and button navigation

The same run as an MP4 (432x504, 30 fps): demo.mp4. Pixels are the ones the firmware clocks into the Sharp memory LCD, scaled up by nearest neighbour. Frames are shown for the virtual time until the next one; the first-boot filesystem format (0.2 s to 12.6 s, nothing drawn) is cut to 1.5 s.

PebbleOS (Apache-2.0), built for the Pebble 2 Duo (board asterix, Nordic nRF52840), unmodified, booted by Core Devices' shipping asterix bootloader on pyrite, the Simantic simulator.

PebbleOS coredevices/PebbleOS @ ac576058737718d2de0783896789b836ea09757d, pbl configure --board asterix && pbl build
Bootloader coredevices/PebbleOS-legacy-bootloaders @ 334bc2f, bin/boot/boot_asterix@1753450013.bin at 0x0
pyrite main at 71982f34859cba04be3b975e40867b6c053f7cbf (simantic-dev/pyrite#3805, merged)
./run.sh    # builds PebbleOS if out/ has no image, runs 24 virtual s (about 16 s wall on an Apple M5), writes out/frames/, the GIF and the MP4

Timeline (virtual time, one ./run.sh run). Each button press holds the line low for 150 ms (buttons in sim/overlay.board).

Time (s) What Image
0.098 bootloader reads the NOR's JEDEC ID 0xC86019, boots the firmware
0.200 *** Booting PebbleOS v9.9.9-dev *** on UART
0.27 to 11.7 first boot: PebbleOS formats its filesystem on the empty NOR
12.117 Valid system resources found!
12.398 Starting Launcher; battery service reads 76 %, 3895 mV from the PMIC peer
12.596 launcher menu drawn png
12.798 first BLE ADV_IND on the air: Pebble 454F, 16-bit UUID 0xFED9
14.0 Back watch face, 12:00, January 1 (14.392) png
16.0 Select launcher (16.562)
17.0, 17.8 Down, 18.6 Up highlight moves Music, Notifications, Music strip
19.4 Select Music app (20.038) png
21.0, 22.0 Back launcher, then the watch face (22.326)
flowchart LR
  fw["nRF52840<br/>PebbleOS (asterix)"]
  nor(["GD25LQ255E 32 MB NOR, QSPI"]) --- fw
  lcd(["Sharp LS013B7DH01 144x168, SPIM3 + EXTCOMIN P1.15"]) --- fw
  pmic(["nPM1300 PMIC, TWIM1 0x6B"]) --- fw
  als(["OPT3001 light, TWIM0 0x44"]) --- fw
  imu(["LSM6DSO, MMC5603NJ, DRV2604, DA7212: TWIM0"]) --- fw
  btn(["Back/Up/Select/Down, P0.28-31"]) --- fw
  phone(["phone: BLE central on the RADIO"]) --- fw
Loading

Real and stand-in

Everything on the chip is pyrite's nRF52840 model. Everything off the chip is a Python peer in peers/, wired in sim/overlay.board from PebbleOS's boards/asterix/asterix.dts.

Part How it is simulated
nRF52840 (CPU, QSPI, SPIM, TWIM, RTC, RADIO, ...) pyrite's shared nRF52840 model
GD25LQ255E NOR pyrite's shared SPI NOR model with the board's JEDEC ID and size; GigaDevice status registers. Erase and program times are the model's generic ones
Sharp LS013B7DH01 display peers/spi/sharp_memlcd.py: the panel's serial protocol (LSB first, active-high CS, VCOM via EXTCOMIN) and a framebuffer written as PNG per frame
nPM1300 PMIC peers/i2c/npm1300.py: register file plus the ADC tasks the driver uses. MODELED SIMPLIFICATION: results are ready at once, the battery is a constant 3.9 V source
OPT3001 light sensor peers/i2c/opt3001.py
LSM6DSO IMU MODELED SIMPLIFICATION peers/i2c/regfile.py: WHO_AM_I, +1 g on Z, SW_RESET/BOOT complete at once; no FIFO, ODR or interrupts
MMC5603NJ magnetometer MODELED SIMPLIFICATION regfile.py: product ID only
DRV2604 haptics MODELED SIMPLIFICATION regfile.py: register file, no motor
DA7212 codec MODELED SIMPLIFICATION regfile.py: PLL reads locked
Buttons peers/gpio/pin_script.py: timed presses, active low against the pad pull-ups
Phone peers/ble/phone.py: a scripted BLE central that logs the watch's adverts

Open

  • No Pebble Protocol yet. PebbleOS talks PPoGATT only to a bonded phone over an encrypted link (the gateway intent is pairing-required; both PPoGATT services need an encrypted link). pyrite's scripted BLE peer has no SMP pairing or LL encryption, so the phone only watches adverts. A trial connection showed the watch accepting it (LE Conn Compl at 15.235 s) but no data PDU came back to the phone, and the link was lost to supervision timeout at 19.256 s. Tracked in simantic-dev/pyrite#3807.
  • Every run is a first boot (the NOR starts erased); dumping the NOR after one run and preloading it would cut the 11 s format.
  • scripts/build_pebbleos.sh is the recipe the image was built with; it has not been re-run from a clean checkout.

Needs Python 3, ffmpeg, and a pyrite sim built from main at or after 71982f348 (simantic-dev/pyrite#3805) (SIM=/path/to/sim ./run.sh). Building PebbleOS needs the PebbleOS SDK (PEBBLEOS_SDK=<install dir>).

The firmware is not in this repo. scripts/build_pebbleos.sh clones PebbleOS at the pinned commit and builds it, and fetches the bootloader. out/ and build/ are git-ignored. PebbleOS logs are hashed; scripts/dehash.py restores them with the build's log.dict.json.

Peer self-checks: python3 peers/i2c/npm1300.py, python3 peers/ble/phone.py.

About

PebbleOS on a simulated Pebble 2 Duo (nRF52840), running on pyrite

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages