Skip to content

doc: Update README.md with info for building for Pebble boards/QEMU #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 58 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
This repository contains the source code of PebbleOS.

## How PebbleOS works

Read more in the very detailed [PebbleOS architecture presentation](https://docs.google.com/presentation/d/1wfyBRwbrv5YtSnvNRnEPz5tRx9y7VGcFsuHbi1X-D7I/edit?usp=sharing)

Then read this [presentation on how PebbleOS works](https://docs.google.com/presentation/d/1M--yoEJBO-uckvY5CTFfHT4srw6RCj9RTGT57RcogX8/edit?usp=sharing)!

Join the [Rebble Discord](https://discordapp.com/invite/aRUAYFN) #firmware-dev channel to discuss.

### Watch the Podcast
Several original PebbleOS firmware engineers [recorded a podcast](https://www.youtube.com/watch?v=dk5wsNN8abo) about the OS.

Several original PebbleOS firmware engineers [recorded a podcast](https://www.youtube.com/watch?v=dk5wsNN8abo) about the OS.
| Podcast | Gemini Summary |
|----------|----------|
| [![CleanShot 2025-02-11 at 22 26 27@2x](https://github.com/user-attachments/assets/9c55aefa-06f5-4a58-bf4f-fa40e1bd45bd)](https://www.youtube.com/watch?v=dk5wsNN8abo) | [![Arc 2025-02-11 22 25 13](https://github.com/user-attachments/assets/ee5361b3-a89c-450e-97a5-f10796c1fba5)](https://g.co/gemini/share/03350ab7b4e6) |


| [![CleanShot 2025-02-11 at 22 26 27@2x](https://github.com/user-attachments/assets/9c55aefa-06f5-4a58-bf4f-fa40e1bd45bd)](https://www.youtube.com/watch?v=dk5wsNN8abo) | [![Arc 2025-02-11 22 25 13](https://github.com/user-attachments/assets/ee5361b3-a89c-450e-97a5-f10796c1fba5)](https://g.co/gemini/share/03350ab7b4e6) |

### Architecture

![CleanShot 2025-01-31 at 14 38 16@2x](https://github.com/user-attachments/assets/23d13a36-55e6-4e3a-87ab-4fb1fd1fca5a)

![Arc 2025-01-31 11 44 47](https://github.com/user-attachments/assets/804bc6b9-47c1-4af5-b698-6078aca467ee)


**WARNING**: Codebase is being refactored/modernized, so only certain features
may work right now.

Expand All @@ -39,13 +39,14 @@ may work right now.
sure it is available on your `PATH` by checking `arm-none-eabi-gcc --version`
returns the expected version.
- If using Ubuntu, install `gcc-multilib` and `gettext`
- Install `nrfjprog` from
- (If you want to use an nRF based board) Install `nrfjprog` from
https://www.nordicsemi.com/Products/Development-tools/nRF-Command-Line-Tools.
- Create a Python venv:

```shell
python -m venv .venv
```

- Activate the Python venv (also every time you start working):
```shell
source .venv/bin/activate
Expand All @@ -68,10 +69,16 @@ may work right now.
First, configure the project like this:

```shell
./waf configure --board asterix_vla_dvb1 --nojs --nohash
./waf configure --board <board> --nojs
```

At this moment, only `asterix_vla_dvb1` board target may compile and boot.
Note: If you wish to debug, you're likely to want `--nowatchdog --nostop --nosleep` also.

At this moment, only the following boards are supported/tested:

- asterix_vla_dvb1
- snowy_bb2 (no Bluetooth)
- silk_bb2 (no Bluetooth)

Then build:

Expand All @@ -85,7 +92,15 @@ PRF can be also be built:
./waf build_prf
```

## Flashing
## Flashing firmware (silk/snowy bigboards)

Make sure openocd is installed, then run:

```shell
./waf flash
```

## Flashing firmware (nRF)

First make sure Nordic S140 Softdevice is flashed (only do this once):

Expand All @@ -99,15 +114,46 @@ Flash the firmware:
nrfjprog --program build/src/fw/tintin_fw.elf --sectorerase --reset
```

First time you should see a "sad watch" screen because resources are not
## Flashing resources

The first time you boot you may see a "sad watch" screen because resources are not
flashed. To flash resources, run:

```shell
python tools/pulse_flash_imaging.py -t /dev/$PORT -p resources build/system_resources.pbpack
./waf image_resources
```

You don't need to do this every time, only when resources are changed.

## Viewing logs

```shell
python tools/pulse_console.py -t /dev/$PORT
./waf console
```

## Building for QEMU

The same QEMU binary found in the SDK can be used to build and develop the firmware.

If you're using an Apple Silicon Mac, you might find it easier to build QEMU from [source](https://github.com/pebble-dev/qemu).

The steps here are similar that of real hardware:

```shell
./waf configure --board=snowy_bb2 --nojs --qemu
./waf build
./waf qemu_image_spi
./waf qemu
```

You can then launch a console using:

```shell
./waf qemu_console
```

Finally, you can debug with GDB using:

```shell
./waf qemu_gdb
```