You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bootloader divides flash into regions. The defaults follow the [bootymcbootface](https://codeberg.org/Schievel/bootymcbootface/) convention and are automatically calculated from `flash_size`:
DFU = ACTIVE + 4K (1 page delta required by embassy-boot swap)
17
17
```
18
18
19
19
The 4K page delta is an **invariant of embassy-boot's swap algorithm**: the DFU slot must always be exactly one erase page larger than the ACTIVE slot. Storage is reserved at the end of flash and **cannot be reconfigured** when using bootymcbootface — it is always 128K (32 sectors × 4K).
@@ -26,8 +26,9 @@ The 4K page delta is an **invariant of embassy-boot's swap algorithm**: the DFU
The size of the ACTIVE Region is what you need to plug in as the flash size in `memory.x`.
29
+
(see also the examples `memory.x` in `rmk/examples/use_rust/rp2040_embassy_boot/` for RP2040 or `rmk/examples/use_rust/nrf52840_embassy_boot/` for nRF)
29
30
30
-
If you override `flash_size` in your `keyboard.toml`'s `[dfu]` section, RMK's auto-calc recomputes the layout on the fly. You never need to manually set `dfu_offset` or `dfu_size` when using bootymcbootface.
31
+
If you override `flash_size` in your `keyboard.toml`'s `[dfu]` section, RMK's auto-calc recomputes the layout on the fly. You never need to manually set the addresses like `dfu_offset` or `dfu_size` when using bootymcbootface.
31
32
32
33
## Prerequisites
33
34
@@ -41,11 +42,13 @@ You need the [bootymcbootface](https://codeberg.org/Schievel/bootymcbootface/) b
41
42
-`bootymcbootface-rp204o-8mb.uf2` – for 8 MB flash
42
43
-`bootymcbootface-rp204o-16mb.uf2` – for 16 MB flash
43
44
45
+
::: tip
46
+
The **2 MB version works with larger flash chips too** (e.g. 4 MB or 8 MB), using only the first 2 MB. On 2 MB you get 944K of ACTIVE space, which is ample for most RMK firmwares. If you need more room (e.g. with large keymaps, displays, RGB, or many features), pick the matching flash size variant — see the table above for exact slot sizes.
47
+
:::
48
+
44
49
**nRF52840:**
45
50
-`bootymcbootface-nrf52840.uf2` – for 1 MB flash
46
-
- or build with `cargo make build-nrf` / `cargo make uf2-nrf`
47
-
48
-
The **2 MB version works with larger flash chips too** (e.g. 4 MB or 8 MB), using only the first 2 MB. On 2 MB you get 944K of ACTIVE space, which is ample for most RMK firmwares. If you need more room (e.g. with large keymaps, Vial, or many features), pick the matching flash size variant — see the table above for exact slot sizes.
51
+
-`bootymcbootface-nrf52840.elf` – for 1 MB flash, for direct flashing via probe-rs
49
52
50
53
::: warning
51
54
When using the nRF52840 with the **Adafruit UF2 bootloader**, flashing bootymcbootface **overwrites** the Adafruit bootloader (even when flashing via UF2). Subsequent UF2 uploads won't work.
@@ -64,10 +67,10 @@ If configuring manually, ensure:
64
67
-`keyboard.toml` has `[dfu]` section
65
68
- The flash partitioning in `memory.x` matches your bootloader and flash size (see `rmk/examples/use_rust/rp2040_embassy_boot/` for RP2040 or `rmk/examples/use_rust/nrf52840_embassy_boot/` for nRF)
66
69
67
-
**Important:** For RP2040 the bootymcbootface version (2MB, 4MB, ...) and the RMK settings must use the **same flash size**. Example: bootymcbootface 2 MB → RMK with 2 MB flash configuration.
70
+
**Important:** For RP2040 the bootymcbootface version (2MB, 4MB, ...) and the RMK settings must use the **same flash size**. Example: bootymcbootface 2 MB → RMK with 2 MB flash configuration. So that means, if you have a RP2040 with bigger flash, you can always use a bootymcbootface and a memory.x in your firmware for a smaller flash size, but the both must be for the same flash size.
68
71
69
72
::: tip
70
-
You can still flash firmware via UF2 or probe-rs — as long as it was built with the correct `memory.x` for the embassy-boot partition layout (i.e. with `dfu_rp` or `dfu_nrf` feature), it will land in the active firmware slot and leave bootymcbootface untouched.
73
+
You can still flash firmware via UF2 (when using RP2040, on nRF52840 the UF2 bootloader was overwritten by bootymcbootface) or probe-rs — as long as it was built with the correct `memory.x` for the embassy-boot partition layout (i.e. with `dfu_rp` or `dfu_nrf` feature), it will land in the active firmware slot and leave bootymcbootface untouched.
71
74
72
75
If you flash a RMK firmware built with a **normal**`memory.x` (without embassy-boot), it will start at flash address `0x0` and **overwrite bootymcbootface**.
73
76
:::
@@ -102,6 +105,8 @@ The first time, you need to flash the bootloader first, then RMK.
102
105
103
106
**Via debug probe (probe-rs):**
104
107
```shell
108
+
# in the bootymcbootface directory
109
+
cargo build --relese
105
110
# RP2040
106
111
probe-rs run --chip RP2040 target/thumbv6m-none-eabi/release/bootymcbootface
107
112
# nRF52840
@@ -121,18 +126,19 @@ Now flash the actual RMK firmware. The bootloader stays in place.
121
126
122
127
**Method B – via debug probe (probe-rs):**
123
128
```shell
129
+
# in your RMK firmware directory
124
130
# RP2040
125
131
probe-rs run --chip RP2040 target/thumbv6m-none-eabi/release/your-firmware
126
132
# nRF52840
127
133
probe-rs run --chip nRF52840_xxAA target/thumbv7em-none-eabihf/release/your-firmware
128
134
129
-
# or for both
135
+
# or (for both RP2040 and nRF52840)
130
136
cargo run --release
131
137
```
132
138
133
139
### All subsequent updates via DFU
134
140
135
-
Once bootymcbootface and the RMK firmware have been flashed once, all future updates can be done **easily over USB via DFU**.
141
+
Once bootymcbootface and the RMK firmware have been flashed once, all future updates can be done **easily over USB via DFU**. (but as stated above, as long as the `memory.x` of your firmware fits, you can still use probe-rs (RP2040 and nRF52840) or the UF2 bootloader (RP2040))
(Requires a `Makefile.toml` with a `bin` task — the generated template from `rmkit` and the examples already include one.)
159
+
(Requires a `Makefile.toml` with a `bin` task — the generated template from `rmkit` and the examples already include one or see embassy-boot examples.)
154
160
155
161
#### Flash via dfu-util
156
162
157
163
```shell
158
164
dfu-util -D your-firmware.bin -R
159
165
```
160
166
161
-
Or with a device ID if multiple devices are connected:
167
+
Or with a device ID if multiple DFU devices are connected:
162
168
```shell
163
-
dfu-util -d 1209:1234 -D your-firmware.bin
169
+
dfu-util -d 4c4b:4643 -D your-firmware.bin
164
170
```
165
171
166
172
Find your device's VID:PID via `lsusb` on Linux or Device Manager (under "Universal Serial Bus devices") on Windows.
@@ -188,10 +194,20 @@ If you don't press the unlock keys within the first 10 seconds, the window close
188
194
189
195
If an LED pin is configured in `keyboard.toml` (default PIN_25, if not `[dfu] led = "none"`):
190
196
191
-
| State | LED behavior |
192
-
|---|---|---|
193
-
| Unlock window open (waiting for keys) | Solid on |
194
-
| DFU unlocked (ready for dfu-util) | Blinks Morse "D F U" |
195
-
| DFU download started | On |
196
-
| Writing data blocks | Toggles on each block (flickers) |
0 commit comments