# Raspberry Pi RP2040 boot ROM (B1 and B2)

Breadboard's Raspberry Pi Pico and Pico W boards start uploaded UF2 firmware
through the real RP2040 boot ROM, as the chip does. This folder is the only
place Breadboard distributes that ROM. The simulator downloads
`rp2040-bootrom-b1.bin` as a separate file when a circuit contains a Pico or a
Pico W, and accepts only the exact bytes below. `rp2040-bootrom-b2.bin` is the
B2 image that the RP2040 Rust model (BRE-281) runs; that model represents a B2
chip throughout (owner decision, 2026-10-01). The ROM is not part of
Breadboard's application, engine or WebAssembly code.

## Files

| File | Bytes | SHA-256 | Contents |
|---|---:|---|---|
| [`rp2040-bootrom-b1.bin`](rp2040-bootrom-b1.bin) | 16384 | `90b31e108faedfa6bbcfcc33ba05dac61e645108cfbbdc385f8dafc71fde44ae` | The ROM image, addresses `0x00000000`–`0x00003fff`, unmodified. Byte `0x13` is the ROM version, `0x02` (B1). |
| [`rp2040-bootrom-b2.bin`](rp2040-bootrom-b2.bin) | 16384 | `9c19b46f068c21f90d200c514faad4a0d5cecfc978f155b8c9d25cb6bc2efd81` | The B2 ROM image, addresses `0x00000000`–`0x00003fff`, unmodified: the loadable segment of Raspberry Pi's official `b2.elf` release asset. Byte `0x13` is the ROM version, `0x03` (B2). |
| [`LICENSE.TXT`](LICENSE.TXT) | 1669 | `69f1e3f7bd45c28982b321076f6065bc6a37eaafeaf3b0c241611cec8a932555` | The upstream licence (BSD-3-Clause), verbatim. It excludes the two mufplib files. |
| [`mufplib-NOTICE.txt`](mufplib-NOTICE.txt) | | | The notice of `bootrom/mufplib.S` and `bootrom/mufplib-double.S`, verbatim, and how Breadboard uses them. |
| [`GPL-2.0.txt`](GPL-2.0.txt) | 17984 | `edaef632cbb643e4e7a221717a6c441a4c1a7c918e6e4d56debc3d8739b233f6` | GNU General Public License, version 2 ([gnu.org copy](https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt)). |
| [`pico-bootrom-rp2040-00a4a191-source.zip`](pico-bootrom-rp2040-00a4a191-source.zip) | 118216 | `0589763d1f3280d2133aa3226a14bb0f19381b19181b07afd1dfc0bf6215928c` | Complete source of the ROM: `git archive` of upstream commit `00a4a191`. |
| [`pico-bootrom-rp2040-ef22cd8e-source.zip`](pico-bootrom-rp2040-ef22cd8e-source.zip) | 116565 | `c844f96e7ed0adae5ae88bf59d40c315a75dd1417b3a1b739a8c8b570b7511a5` | Complete source of the B2 ROM: `git archive` of upstream tag `b2`, commit `ef22cd8e`. |
| [`pico-sdk-1.0.0-source.zip`](pico-sdk-1.0.0-source.zip) | 955433 | `64d6f78c534b94bb1a33740ce85f45f238f4540fe8f07c67e97d32832ff701d5` | The ROM repository's `pico_sdk` submodule at both commits: `git archive` of pico-sdk `26653ea` (tag `1.0.0`). |

## Licence

The RP2040 boot ROM is Copyright (c) 2020 Raspberry Pi (Trading) Ltd. and is
licensed under the BSD-3-Clause licence in `LICENSE.TXT`, except
`bootrom/mufplib.S` and `bootrom/mufplib-double.S`, Copyright (c) 2020 Mark
Owen. Raspberry Pi licenses those two files for use only on a Raspberry Pi
RP2040 device, and their notice states that they are also available from the
copyright owner under GPLv2. A browser emulator is not an RP2040 device, so
Breadboard redistributes these ROM images under the GNU General Public License,
version 2 (`GPL-2.0.txt`). You may copy, modify and redistribute them under
those terms. The complete corresponding source is in this folder.

The ROM is a separate program that runs inside the emulated chip. Breadboard's
own software only loads it as data and is not distributed under these terms.

The SDK archive is the unchanged pico-sdk 1.0.0 tree (BSD-3-Clause). Its
unused files keep their own notices, for example
`src/rp2_common/pico_double/double_v1_rom_shim.S` (Mark Owen, the same notice
as the mufplib files) and the Bison-generated parser of the host tool
`pioasm`. Neither is compiled into the ROM.

## Provenance

- Upstream repository: <https://github.com/raspberrypi/pico-bootrom-rp2040>
  (formerly `raspberrypi/pico-bootrom`).
- Source commit: `00a4a19114195e20fb817bdfbca1165e157eef37`, "B1 changes"
  (Graham Sanderson, 2020-11-27). The ROM records this revision as
  `GIT_REV` `0x00a4a191` at address `0x50`. The tree of this commit equals
  tag `b1` (`ad55537bf35e332503b950d6951c41bcb8a7954f`) except `README.md`.
- The `pico_sdk` submodule of both is `26653ea81e340cacee55025d110c3e014a252a87`
  (pico-sdk `1.0.0`). The ROM build compiles `hardware_claim/claim.c`,
  `hardware_sync/sync.c`, `pico_platform/platform.c` and SDK headers from it.
- Breadboard first received these bytes as the rp2040js demo ROM, which states
  "built from https://github.com/raspberrypi/pico-bootrom, revision: B1
  (00a4a19114195e20fb817bdfbca1165e157eef37)".
- Raspberry Pi's later `b1.elf` release asset is a different build (revision
  word `0x0b1c5546`, `DMB ISH` instead of `DMB SY` at three places and one
  branch displacement). The upstream README describes these build differences.
  This folder serves the image that the source above reproduces exactly.

## B2 provenance

- Image: the `PT_LOAD` segment at physical address `0x0` (16,384 bytes) of
  Raspberry Pi's official release asset `b2.elf` (release `B2`, tag `b2`,
  published 2022-05-16,
  <https://github.com/raspberrypi/pico-bootrom-rp2040/releases/download/b2/b2.elf>,
  231,324 bytes, SHA-256
  `3a3c4c617d83bc9b910a6fa7bfdffa11ce26ff89370271d861507be821cc49aa`).
  The segment is byte-equal to `rp2040-bootrom-b2.bin`.
- Source: tag `b2`, commit `ef22cd8ede5bc007f81d7f2416b48db90f313434`
  ("B2 changes", Graham Sanderson, 2021-09-22). Its `pico_sdk` submodule is
  the same `26653ea81e340cacee55025d110c3e014a252a87` (pico-sdk `1.0.0`) as
  B1, so `pico-sdk-1.0.0-source.zip` is also the B2 SDK source. `LICENSE.TXT`
  is the same blob (`d4cccb7b…`) at both tags, and both mufplib files carry
  the identical notice in `mufplib-NOTICE.txt`.
- Tag `b2`'s `README.md` says the chip image was built in Debug mode with GNU
  Arm Embedded Toolchain 9-2020-q2-update (GCC 9.3.1), that the on-chip
  revision info does not match the branch, and that some `DMB` instructions
  are encoded as `DMB SY` instead of `DMB ISH` when built with current SDKs,
  without functional effect on the RP2040.

## Reproducing the B2 image

Verified on 2026-10-01. The release image and a build of tag `b2` differ in
exactly 7 bytes, both of the kinds the upstream README names:

| Address | Release (`rp2040-bootrom-b2.bin`) | Build of tag `b2` | Meaning |
|---|---|---|---|
| `0x50`–`0x53` | `52 36 78 24` | `8e cd 22 ef` | `GIT_REV` word: `0x24783652` (not a public commit) vs `0xef22cd8e` (the tag) |
| `0x1e08` | `5b` | `5f` | `dmb ish` vs `dmb sy` at `0x1e06` (in `isr_irq5`) |
| `0x20e8` | `5b` | `5f` | `dmb ish` vs `dmb sy` at `0x20e6` (in `async_task_worker`) |
| `0x2104` | `5b` | `5f` | `dmb ish` vs `dmb sy` at `0x2102` (in `async_task_worker`) |

Every other byte is equal. The build output has SHA-256
`98dc3ce0800962b36168681df03cce8896947860a43bb619f29756017487d49a`.

1. Toolchain: GNU Arm Embedded Toolchain 9-2020-q2-update (GCC 9.3.1
   20200408), as tag `b2`'s `README.md` names. The aarch64 Linux archive
   `gcc-arm-none-eabi-9-2020-q2-update-aarch64-linux.tar.bz2` (152,221,158
   bytes) has SHA-256
   `1f4165c25e2cff80e29870f409862487ba470afd436e245ba3c743108e17b8ac` (MD5
   `000b0888cbe7b171e2225b29be1c327c`). CMake 3.12 or later, Python 3,
   `make` and a host C compiler are also needed.
2. Source: a git checkout of commit `ef22cd8e` with pico-sdk `26653ea` in
   `pico_sdk/` (`git fetch https://github.com/raspberrypi/pico-bootrom-rp2040 ef22cd8ede5bc007f81d7f2416b48db90f313434`).
3. Build: `mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make bootrom`.
   The output is `build/bootrom.bin`.

## Reproducing the B1 image

Verified on 2026-10-01; the result is byte-identical to `rp2040-bootrom-b1.bin`.

1. Toolchain: GNU Arm Embedded Toolchain 9-2019-q4-major (GCC 9.2.1 20191025),
   the version that commit's `README.md` names. The aarch64 Linux archive
   `gcc-arm-none-eabi-9-2019-q4-major-aarch64-linux.tar.bz2` has SHA-256
   `1f5b9309006737950b2218250e6bb392e2d68d4f1a764fe66be96e2a78888d83`.
   You also need CMake 3.12 or later, Python 3, `make` and a host C compiler.
2. Source: a git checkout of commit `00a4a191` with the SDK archive's
   contents in `pico_sdk/`. The build reads the revision with
   `git rev-parse --short=8 HEAD` and depends on `.git/index`, so it needs a
   git checkout. GitHub serves the commit by its full hash:
   `git fetch https://github.com/raspberrypi/pico-bootrom-rp2040 00a4a19114195e20fb817bdfbca1165e157eef37`.
   A build of the zip contents committed to a new repository differs only in
   the 4-byte revision word.
3. Build: `mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make bootrom`.
   The output is `build/bootrom.bin`.

Building tag `b1` instead gives the same image except the revision word at
`0x50` (`0xad55537b`).
