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 DFU partition size follows embassy-boot guidelines, the additional page is used for status information during flashing.
106
+
88
107
All `[dfu]` fields are optional. The partition values are auto-calculated from `flash_size` and `page_size` using the bootymcbootface formula. If you supply any of `state_offset`, `state_size`, `dfu_offset`, or `dfu_size` directly, auto-calculation is disabled and your values are used as-is.
89
108
90
109
Your `memory.x` must match this partition layout — see the [flashing guide](../user_guide/flash_firmware/use_embassy_boot.mdx) for details.
Copy file name to clipboardExpand all lines: docs/docs/main/docs/user_guide/flash_firmware/use_embassy_boot.mdx
+16-14Lines changed: 16 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ You need the [bootymcbootface](https://codeberg.org/Schievel/bootymcbootface/) b
21
21
-`bootymcbootface_8MB.uf2` – for 8 MB flash
22
22
-`bootymcbootface_16MB.uf2` – for 16 MB flash
23
23
24
-
The **2 MB version works with larger flash chips too** (e.g. 4 MB or 8 MB). It only uses the first 2 MB of flash, the rest remains unused. If you want to use the full flash, pick the matching variant.
24
+
The **2 MB version works with larger flash chips too** (e.g. 4 MB or 8 MB). It only uses the first 2 MB of flash, the rest remains unused. Since RMK is not so big, a flash of 2MB is sufficient most of the times. (But keep in mind when using embassy-boot, the flash is partitioned into ACTIVE and DFU and the firmware has to fit into the ACTIVE partition. Which is only 512K on a 2MB RP2040 then.) If you want to use the full flash, pick the matching variant.
25
25
26
26
### Compile RMK with DFU support
27
27
@@ -31,8 +31,8 @@ When using `rmkit init`, you will be asked whether you want to use embassy-boot
31
31
32
32
If configuring manually, ensure:
33
33
34
-
-`Cargo.toml` uses the `dfu_rp` feature instead of `rp2040`
35
-
-`keyboard.toml` has `[storage]` and `[dfu]`sections
34
+
-`Cargo.toml` uses the `dfu_rp` feature
35
+
-`keyboard.toml` has `[dfu]`section
36
36
- The flash partitioning in `memory.x` matches your bootloader and flash size (see `rmk/examples/use_rust/rp2040_embassy_boot/`)
37
37
38
38
**Important:** The bootymcbootface version and the RMK compilation must use the **same flash size**. Example: bootymcbootface 2 MB → RMK with 2 MB flash configuration.
@@ -43,6 +43,10 @@ You can still flash firmware via UF2 or probe-rs — as long as it was built wit
43
43
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**.
44
44
:::
45
45
46
+
::: tip
47
+
the embassy-boot bootloader and RMK will never overwrite the RP2040’s uf2 bootloader. It exists in ROM and can not be overwritten
48
+
:::
49
+
46
50
## Step-by-step guide
47
51
48
52
### First-time flashing
@@ -57,13 +61,11 @@ The first time, you need to flash the bootloader first, then RMK.
57
61
3. Copy the matching `bootymcbootface_<size>.uf2` to the drive
58
62
4. The RP2040 reboots – the bootloader is now active
59
63
60
-
*(If an LED is configured, it will turn on during a DFU transfer and turn off when done.)*
61
-
62
64
**Method B – via debug probe (probe-rs):**
63
65
```shell
64
-
probe-rs run --chip RP2040 bootymcbootface_<size>.elf
66
+
probe-rs run --chip RP2040 bootymcbootface_<size> (elf)
65
67
# or
66
-
cargo run --release
68
+
cargo run --release // in the bootymcbootface project directory
67
69
```
68
70
(Make sure your project targets the bootloader binary)
69
71
@@ -72,7 +74,7 @@ cargo run --release
72
74
Now flash the actual RMK firmware. The bootloader stays in place.
73
75
74
76
**Method A – via UF2:**
75
-
The embassy-boot bootloader also provides a UF2 mode. Put the board into bootloader mode (double-tap reset or BOOTSEL, depending on the board), then copy the RMK firmware `.uf2` file to the drive.
77
+
Put the board into bootloader mode (hold BOOTSEL button, plug in USB, release), then copy the RMK firmware `.uf2` file to the appearing `RPI-RP2` drive.
(Requires a `Makefile.toml` with a `bin` task — the generated template already includes one.)
101
+
(Requires a `Makefile.toml` with a `bin` task — the generated template from `rmkit`already includes one.)
100
102
101
103
#### Flash via dfu-util
102
104
@@ -116,28 +118,28 @@ Find your device's VID:PID via `lsusb` on Linux or Device Manager (under "Univer
116
118
- macOS: `brew install dfu-util`
117
119
- Windows: Download from [dfu-util.sourceforge.net](https://dfu-util.sourceforge.net/)
118
120
119
-
`dfu-util` will automatically detect the board — the RMK firmware exposes a DFU USB interface on every boot. No need to press BOOTSEL or trigger a special mode. (With the optional `dfu_lock` feature, DFU downloads start in a locked state and require a physical key press to unlock — see below.)
121
+
`dfu-util` will automatically detect the board — the RMK firmware exposes a DFU USB interface at runtime. No need to press BOOTSEL or trigger a special mode. (With the optional `dfu_lock` feature, DFU downloads require a physical key press to unlock — see below.)
120
122
121
123
#### Unlocking DFU (optional, dfu_lock)
122
124
123
-
If your firmware was compiled with the `dfu_lock` feature, DFU starts in a **locked** state. To unlock:
125
+
If your RMK was compiled with the `dfu_lock` feature, DFU starts in a **locked** state. To unlock:
124
126
125
127
1. Run `dfu-util -D your-firmware.bin` — the download will be rejected, but this signals the keyboard to open the unlock window
126
128
2. The DFU LED turns **solid on** — you have **10 seconds** to press the `unlock_keys` combination configured in `keyboard.toml` (e.g. `[[0, 0], [1, 1]]`)
127
129
3. Once the keys are pressed, the LED blinks **"D F U"** in Morse code (`-.. ..-. ..-`) — the DFU lock is released for another **10 seconds**
128
-
4. Re-run `dfu-util -D your-firmware.bin` — this time the download proceeds, the LED stays on, and the firmware is updated
130
+
4. Re-run `dfu-util -D your-firmware.bin` — this time the download proceeds, the LED flickers, and the firmware is updated
129
131
5. After the update completes, the LED turns off and the board reboots
130
132
131
133
If you don't press the unlock keys within the first 10 seconds, the window closes and the LED turns off. If no DFU download starts within the unlocked 10 seconds, the lock re-engages automatically. In both cases just repeat from step 1.
132
134
133
135
#### LED behavior during DFU transfer (optional)
134
136
135
-
If an LED pin is configured in `keyboard.toml` (`[dfu] led = "PIN_25"`):
137
+
If an LED pin is configured in `keyboard.toml` (default PIN_25, if not `[dfu] led = "none"`):
136
138
137
139
| State | LED behavior |
138
140
|---|---|---|
139
141
| Unlock window open (waiting for keys) | Solid on |
140
142
| DFU unlocked (ready for dfu-util) | Blinks Morse "D F U" |
141
143
| DFU download started | On |
142
-
| Writing data blocks | Toggles on each block |
144
+
| Writing data blocks | Toggles on each block (flickers) |
0 commit comments