Skip to content

feat(dfu): Embassy boot and dfu flashing#877

Merged
HaoboGu merged 7 commits into
HaoboGu:mainfrom
Schievel1:embassy-boot
Jul 3, 2026
Merged

feat(dfu): Embassy boot and dfu flashing#877
HaoboGu merged 7 commits into
HaoboGu:mainfrom
Schievel1:embassy-boot

Conversation

@Schievel1

@Schievel1 Schievel1 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

This PR adds DFU (Device Firmware Upgrade) support via embassy-boot for RP2040-based and NRF52840-based keyboards. Once set up, firmware updates can be done over USB with dfu-util — no need to press BOOTSEL/ RESET or use a debug probe.

What's implemented

rmk crate — new dfu_rp feature gate:

  • dfu.rs: init_flash() initializes the blocking flash with configurable partition offsets and returns a storage partition for RMK's keymap storage
  • set_led() / mark_booted() — optional DFU activity LED and boot-success signaling to prevent bootloader rollback
  • register_dfu_interface() — registers a USB DFU class (embassy-usb-dfu) with a handler that blinks the LED during transfers
  • DfuLock (behind dfu_lock feature) — physical key unlock for DFU: pressing the configured matrix keys unlocks DFU for 10 s, with Morse "DFU" LED blinking
  • Automatic DFU interface registration in UsbTransport::new() when the manager is initialized

rmk-config crate — new [dfu] TOML section:

  • flash_size, page_size — auto-calculate partition addresses using the bootymcbootface formula (state at 0x6000, active at 0x7000, DFU slot follows) (bootymcbootface (https://codeberg.org/Schievel/bootymcbootface/) is the matching bootloader for this, but people could roll their own and use whatever partitioning suits them)
  • led — optional GPIO pin for DFU activity
  • unlock_keys — matrix positions for dfu_lock
  • Manual override of state_offset, state_size, dfu_offset, dfu_size for custom layouts

flash formula

embassy-boot needs a DFU and an ACTIVE partition. ACTIVE is where the actual firmware sits, DFU is where we can put firmware using dfu-utils for example and embassy-boot then copies DFU to ACTIVE.
Apart from that me have:

  • BOOT2, where the RP2040 bootloader lives, address 0x10000000 (beginning of flash), length fixed 0x100 (for nRF52840 this does not exist and the embassy-boot partition is expanded to start at 0x0)
  • embassy-boot, where embassy-boots code lives, after BOOT2, address fixed 0x10000100, length fixed to 24K-0x100
  • BOOTLOADER_STATE, where embassy-boot puts it's own state, and where we set a flag from RMK that we want to update DFU to ACTIVE, after embassy-boot, address fixed 0x10006000, length fixed 4K
  • ACTIVE, where the currently running RMK lives, address fixed 0x10007000, variable length
  • DFU, where we put the firmware we want embassy-boot to flash, address variable (depends on ACTIVE length), length = ACTIVE length + 1 page
  • STORAGE, address variable (depends on ACTIVE + DFU), length fixed 128K

As a diagram:

 ┌─────────────────────────────────┐
 │ 0x10000000                      │
 │  +───────────────+  0x10000100  │
 │  │ BOOT2 (256B)  │              │
 │  +───────────────+  0x10000100  │
 │  │               │              │
 │  │ EMBASSY-BOOT  │              │
 │  │ (24K - 256B)  │              │
 │  │               │              │
 │  +───────────────+  0x10006000  │
 │  │ BOOTLOADER    │              │
 │  │ STATE (4K)    │              │
 │  +───────────────+  0x10007000  │
 │  │               │              │
 │  │ ACTIVE        │              │
 │  │ (variable)    │              │
 │  │               │              │
 │  ├───────────────┤  ACTIVE_END  │
 │  │               │              │
 │  │ DFU           │              │
 │  │ (ACTIVE+4K)   │              │
 │  │               │              │
 │  ├───────────────┤  DFU_END     │
 │  │               │              │
 │  │ STORAGE       │              │
 │  │ (128K)        │              │
 │  │               │              │
 │  +───────────────+  STORAGE_END │
 │ FLASH_END                       │
 └─────────────────────────────────┘

In order to partition the flash I use the following constraints:

  • we want ACTIVE partition to be a big as possible while also allowing a bit of storage
  • DFU needs to be as big as active + 1 page that embassy-boot uses for the state during flashing. This way it known where it was after continuing after a power loss and can continue flashing DFU to ACTIVE
  • the partitions before ACTIVE (BOOT2, embassy-boot, BOOTLOADER_STATE) have fixed addresses and lengths. Therefore ACTIVE has a fixed address as well. (but not a fixed length
  • since ACTIVE has a variable length, the address of DFU must be calculatd.
  • STORAGE comes after ACTIVE and DFU, which have a variable length, therefore the address of STORAGE must be calculated.

To calculate the length of ACTIVE, I calculate the remaining flash after subtracting all the fixed size partitions (BOOT2, EMBASSY-BOOT, BOOTLOADER-STATE, STORAGE):
remaining = flash_size - 28K (BOOT2, EMBASSY-BOOT, BOOTLOADER-STATE) - 128K (STORAGE size)
The remaining flash must then be equally sized between ACTIVE and DFU, where DFU gets one more page:
ACTIVE size = (remaining - 4K (page size)) / 2
DFU size = ACTIVE size + 4K (page size)

Then we only need to get the start addresses of DFU and storage:
DFU offset = ACTIVE offset (always 0x10007000) + ACTIVE size
and
STORAGE offset = DFU offset + DFU size

Examples:

  • examples/use_rust/rp2040_embassy_boot/ — full Rust-API example
  • Example configs updated for use_config path

Documentation:

  • New user_guide/flash_firmware/use_embassy_boot.mdx with setup guide (bootymcbootface, compilation, step-by-step flashing, DFU usage, dfu_lock, LED behavior)
  • RP2040 + embassy-boot section in configuration/chip_config.mdx with partition table and TOML/Rust tabs

Feature flags

  • dfu — base DFU support (USB DFU interface)
  • dfu_rp — RP2040-specific DFU with embassy-boot (implies dfu + rp2040)
  • dfu_lock — physical key unlock for DFU (implies dfu_rp + host_security)

Usage flow

  1. Flash bootymcbootface (once, via UF2 or probe-rs)
  2. Compile RMK with dfu_rp feature and matching flash size
  3. Flash RMK firmware (via UF2 or probe-rs)
  4. All future updates: cargo make bin && dfu-util -D firmware.bin

Perspective / Roadmap

Since embassy-boot is agnostic towards how the updated firmware gets into the DFU partition, this PR lays the foundation for future features like flashing via bluetooth or flashing the peripheral from the central using the serial connection between them.
I think the next steps after merging this should be:

Needs:

Optional:

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Size Report

Example main PR Diff .text .data .bss
use_config/nrf52832_ble 394.8 KiB 394.8 KiB +0.00% ⬇️ -4 0 0
use_config/nrf52840_ble 443.3 KiB 443.3 KiB +0.00% ⬇️ -4 0 0
use_config/nrf52840_ble_split (central) 492.5 KiB 492.5 KiB +0.00% ⬆️ +4 0 0
use_config/nrf52840_ble_split (peripheral) 316.9 KiB 316.9 KiB +0.00% ⬆️ +8 0 0
use_config/pi_pico_w_ble 667.9 KiB 667.9 KiB +0.00% ⬇️ -32 0 0
use_config/rp2040 148.5 KiB 148.5 KiB +0.00% ⬆️ +4 0 0
use_config/rp2040_split (central) 162.1 KiB 162.1 KiB +0.00% 0 0 0
use_config/rp2040_split (peripheral) 27.8 KiB 27.8 KiB +0.01% ⬆️ +4 0 0
use_config/stm32f1 63.0 KiB 63.0 KiB +0.00% 0 0 0
use_config/stm32h7 100.0 KiB 100.0 KiB +0.00% ⬇️ -4 0 0
use_rust/nrf52832_ble 382.2 KiB 382.2 KiB +0.00% ⬇️ -8 0 0
use_rust/nrf52840_ble 438.6 KiB 438.6 KiB +0.00% ⬆️ +8 0 0
use_rust/nrf52840_ble_split (central) 501.8 KiB 501.8 KiB +0.00% ⬆️ +4 0 0
use_rust/nrf52840_ble_split (peripheral) 313.3 KiB 313.3 KiB +0.00% ⬆️ +8 0 0
use_rust/pi_pico_w_ble 668.2 KiB 668.2 KiB +0.00% ⬇️ -24 0 0
use_rust/rp2040 148.0 KiB 148.0 KiB +0.00% ⬆️ +8 0 0
use_rust/rp2040_split (central) 160.8 KiB 160.8 KiB +0.00% ⬆️ +4 0 0
use_rust/rp2040_split (peripheral) 28.1 KiB 28.1 KiB +0.00% 0 0 0
use_rust/stm32f1 62.9 KiB 62.9 KiB +0.00% ⬇️ -4 0 0
use_rust/stm32h7 122.3 KiB 122.3 KiB +0.00% 0 0 0
use_config/nrf52832_ble — 394.8 KiB → 394.8 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 364956	   4588	  34760	 404304	  62b50	rmk-nrf52832

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 364960	   4588	  34760	 404308	  62b54	rmk-nrf52832

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +565  [ = ]       0    .debug_str
  +0.0%      +9  [ = ]       0    .strtab
  +1.4%      +1  [ = ]       0    [Unmapped]
  -0.0%      -4  -0.0%      -4    .text
  -0.0%     -21  [ = ]       0    .debug_line
  -0.0%    -906  [ = ]       0    .debug_info
  -0.0%    -356  -0.0%      -4    TOTAL
use_config/nrf52840_ble — 443.3 KiB → 443.3 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 397912	   4596	  51416	 453924	  6ed24	rmk-nrf52840

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 397916	   4596	  51416	 453928	  6ed28	rmk-nrf52840

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +517  [ = ]       0    .debug_info
  +0.0%    +176  [ = ]       0    .debug_str
  +0.0%     +54  [ = ]       0    .debug_line
  +4.8%      +3  [ = ]       0    [Unmapped]
  -0.0%      -4  -0.0%      -4    .text
  -0.0%      -8  [ = ]       0    .debug_ranges
  -0.0%     -22  [ = ]       0    .strtab
  +0.0%    +716  -0.0%      -4    TOTAL
use_config/nrf52840_ble_split (central) — 492.5 KiB → 492.5 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 452848	   4652	  46808	 504308	  7b1f4	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 452844	   4652	  46808	 504304	  7b1f0	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +27  [ = ]       0    .strtab
  +0.0%     +16  [ = ]       0    .debug_info
  +0.0%      +4  +0.0%      +4    .text
 -10.7%      -6  [ = ]       0    [Unmapped]
  -0.0%     -23  [ = ]       0    .debug_line
  -0.0%     -38  [ = ]       0    .debug_str
  -0.0%     -20  +0.0%      +4    TOTAL
use_config/nrf52840_ble_split (peripheral) — 316.9 KiB → 316.9 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 292936	   4468	  27152	 324556	  4f3cc	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 292928	   4468	  27152	 324548	  4f3c4	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%      +8  +0.0%      +8    .text
  -0.0%      -1  [ = ]       0    .strtab
 -15.9%     -10  [ = ]       0    [Unmapped]
  -0.0%    -377  [ = ]       0    .debug_info
  -0.1% -1.71Ki  [ = ]       0    .debug_str
  -0.0% -2.08Ki  +0.0%      +8    TOTAL
use_config/pi_pico_w_ble — 667.9 KiB → 667.9 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 629340	      0	  54604	 683944	  a6fa8	rmk-pi-pico-w

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 629372	      0	  54604	 683976	  a6fc8	rmk-pi-pico-w

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  -1.9%      -1  [ = ]       0    [Unmapped]
  -0.0%     -23  [ = ]       0    .strtab
  -0.0%     -32  -0.0%     -32    .text
  -0.0%    -104  [ = ]       0    .debug_ranges
  -0.0%    -204  [ = ]       0    .debug_line
  -0.0%    -633  [ = ]       0    .debug_str
  -0.1%    -856  [ = ]       0    .debug_loc
  -0.1% -1.45Ki  [ = ]       0    .debug_info
  -0.0% -3.26Ki  -0.0%     -32    TOTAL
use_config/rp2040 — 148.5 KiB → 148.5 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 136528	      0	  15540	 152068	  25204	rmk-rp2040

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 136524	      0	  15540	 152064	  25200	rmk-rp2040

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +324  [ = ]       0    .debug_info
  +0.1%    +117  [ = ]       0    .debug_line
  +0.0%     +92  [ = ]       0    .debug_str
   +81%     +30  [ = ]       0    [Unmapped]
  +0.0%      +9  [ = ]       0    .strtab
  +0.0%      +4  +0.0%      +4    .text
  +0.0%    +576  +0.0%      +4    TOTAL
use_config/rp2040_split (central) — 162.1 KiB → 162.1 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 149572	      0	  16388	 165960	  28848	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 149572	      0	  16388	 165960	  28848	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +24  [ = ]       0    .strtab
  +0.0%     +10  [ = ]       0    .debug_loc
  -2.3%      -1  [ = ]       0    [Unmapped]
  -0.1%    -104  [ = ]       0    .debug_line
  -0.0%    -465  [ = ]       0    .debug_info
  -0.0%    -680  [ = ]       0    .debug_str
  -0.0% -1.19Ki  [ = ]       0    TOTAL
use_config/rp2040_split (peripheral) — 27.8 KiB → 27.8 KiB (+0.01% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  25596	     60	   2796	  28452	   6f24	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  25592	     60	   2796	  28448	   6f20	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +22  [ = ]       0    .debug_str
  +0.0%      +5  [ = ]       0    .strtab
  +0.1%      +4  +0.1%      +4    .rodata
  +1.8%      +1  [ = ]       0    [Unmapped]
  +0.0%     +32  +0.0%      +4    TOTAL
use_config/stm32f1 — 63.0 KiB → 63.0 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  56956	     28	   7520	  64504	   fbf8	rmk-stm32f1

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  56956	     28	   7520	  64504	   fbf8	rmk-stm32f1

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%      +3  [ = ]       0    .debug_line
  +3.6%      +2  [ = ]       0    [Unmapped]
  -0.0%    -124  [ = ]       0    .debug_info
  -0.1%    -377  [ = ]       0    .debug_str
  -0.0%    -496  [ = ]       0    TOTAL
use_config/stm32h7 — 100.0 KiB → 100.0 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  92396	    268	   9760	 102424	  19018	rmk-stm32h7

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  92400	    268	   9760	 102428	  1901c	rmk-stm32h7

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +327  [ = ]       0    .debug_str
  +0.1%    +154  [ = ]       0    .debug_line
  +0.0%    +129  [ = ]       0    .debug_info
   +12%      +6  [ = ]       0    [Unmapped]
  -0.0%      -4  -0.0%      -4    .text
  +0.0%    +612  -0.0%      -4    TOTAL
use_rust/nrf52832_ble — 382.2 KiB → 382.2 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 353016	   4588	  33744	 391348	  5f8b4	rmk-nrf52832

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 353024	   4588	  33744	 391356	  5f8bc	rmk-nrf52832

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +91  [ = ]       0    .debug_str
  +0.0%      +1  [ = ]       0    .strtab
  -0.0%      -8  -0.0%      -8    .text
  -0.2%     -18  [ = ]       0    .debug_abbrev
 -37.1%     -26  [ = ]       0    [Unmapped]
  -0.1%    -156  [ = ]       0    .debug_line
  -0.0%    -880  [ = ]       0    .debug_info
  -0.0%    -996  -0.0%      -8    TOTAL
use_rust/nrf52840_ble — 438.6 KiB → 438.6 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 397588	   4596	  46904	 449088	  6da40	rmk-nrf52840

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 397580	   4596	  46904	 449080	  6da38	rmk-nrf52840

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
   +50%     +25  [ = ]       0    [Unmapped]
  +0.0%     +15  [ = ]       0    .strtab
  +0.0%     +10  [ = ]       0    .debug_loc
  +0.0%      +8  +0.0%      +8    .text
  -0.0%     -36  [ = ]       0    .debug_line
  -0.6%     -55  [ = ]       0    .debug_abbrev
  -0.0%    -220  [ = ]       0    .debug_str
  -0.0%    -343  [ = ]       0    .debug_info
  -0.0%    -596  +0.0%      +8    TOTAL
use_rust/nrf52840_ble_split (central) — 501.8 KiB → 501.8 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 456684	   4652	  52552	 513888	  7d760	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 456680	   4652	  52552	 513884	  7d75c	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +404  [ = ]       0    .debug_str
  +0.1%    +234  [ = ]       0    .debug_line
  +0.0%     +26  [ = ]       0    .strtab
  +0.0%     +12  [ = ]       0    .debug_loc
  +0.0%      +4  +0.0%      +4    .text
 -14.5%      -9  [ = ]       0    [Unmapped]
  -0.0%    -411  [ = ]       0    .debug_info
  +0.0%    +260  +0.0%      +4    TOTAL
use_rust/nrf52840_ble_split (peripheral) — 313.3 KiB → 313.3 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 290920	   4468	  25400	 320788	  4e514	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 290912	   4468	  25400	 320780	  4e50c	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +12  [ = ]       0    .debug_loc
  +0.0%      +8  +0.0%      +8    .text
  -0.0%      -1  [ = ]       0    .strtab
 -10.3%      -6  [ = ]       0    [Unmapped]
  -0.0%     -89  [ = ]       0    .debug_info
  -0.0%    -552  [ = ]       0    .debug_str
  -0.0%    -628  +0.0%      +8    TOTAL
use_rust/pi_pico_w_ble — 668.2 KiB → 668.2 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 629504	      0	  54748	 684252	  a70dc	rmk-pi-pico-w

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 629528	      0	  54748	 684276	  a70f4	rmk-pi-pico-w

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
 -10.9%      -6  [ = ]       0    [Unmapped]
  -0.0%     -23  [ = ]       0    .strtab
  -0.0%     -24  -0.0%     -24    .text
  -0.0%    -104  [ = ]       0    .debug_ranges
  -0.1%    -273  [ = ]       0    .debug_line
  -0.1%    -824  [ = ]       0    .debug_loc
  -0.0%    -850  [ = ]       0    .debug_info
  -0.0%    -904  [ = ]       0    .debug_str
  -0.0% -2.94Ki  -0.0%     -24    TOTAL
use_rust/rp2040 — 148.0 KiB → 148.0 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 136184	      0	  15412	 151596	  2502c	rmk-rp2040

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 136176	      0	  15412	 151588	  25024	rmk-rp2040

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1%    +109  [ = ]       0    .debug_line
  +0.0%      +9  [ = ]       0    .strtab
  +0.0%      +8  +0.0%      +8    .text
  -9.7%      -6  [ = ]       0    [Unmapped]
  -0.0%     -22  [ = ]       0    .debug_loc
  -0.0%    -176  [ = ]       0    .debug_info
  -0.0%    -386  [ = ]       0    .debug_str
  -0.0%    -464  +0.0%      +8    TOTAL
use_rust/rp2040_split (central) — 160.8 KiB → 160.8 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 148456	      0	  16172	 164628	  28314	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 148452	      0	  16172	 164624	  28310	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +70  [ = ]       0    .debug_str
  +0.0%     +24  [ = ]       0    .strtab
  +0.0%      +4  +0.0%      +4    .text
  -8.9%      -4  [ = ]       0    [Unmapped]
  -0.1%    -119  [ = ]       0    .debug_line
  -0.0%    -451  [ = ]       0    .debug_info
  -0.0%    -476  +0.0%      +4    TOTAL
use_rust/rp2040_split (peripheral) — 28.1 KiB → 28.1 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  25656	     60	   3060	  28776	   7068	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  25656	     60	   3060	  28776	   7068	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +19  [ = ]       0    .debug_str
  +0.0%      +5  [ = ]       0    .strtab
  +0.0%     +24  [ = ]       0    TOTAL
use_rust/stm32f1 — 62.9 KiB → 62.9 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  56892	     28	   7496	  64416	   fba0	rmk-stm32f1

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  56896	     28	   7496	  64420	   fba4	rmk-stm32f1

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
   +11%      +6  [ = ]       0    [Unmapped]
  -0.0%      -4  -0.0%      -4    .text
  -0.0%     -31  [ = ]       0    .debug_line
  -0.1%    -400  [ = ]       0    .debug_info
  -0.1%    -455  [ = ]       0    .debug_str
  -0.1%    -884  -0.0%      -4    TOTAL
use_rust/stm32h7 — 122.3 KiB → 122.3 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 109188	    324	  15692	 125204	  1e914	rmk-stm32h7

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 109188	    324	  15692	 125204	  1e914	rmk-stm32h7

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%      +4  [ = ]       0    .strtab
  +0.0%      +2  [ = ]       0    .debug_line
  -9.8%      -4  [ = ]       0    [Unmapped]
  -0.0%     -28  [ = ]       0    .debug_info
  -0.0%    -598  [ = ]       0    .debug_str
  -0.0%    -624  [ = ]       0    TOTAL

@Schievel1 Schievel1 force-pushed the embassy-boot branch 4 times, most recently from 0c23f04 to 9363725 Compare June 11, 2026 14:55
@Schievel1 Schievel1 marked this pull request as ready for review June 11, 2026 22:43
@Schievel1 Schievel1 force-pushed the embassy-boot branch 2 times, most recently from c2c5d32 to 074f4d5 Compare June 11, 2026 23:10
@Schievel1

Copy link
Copy Markdown
Contributor Author

please review the addresses part thoroughly. I find the flash partitioning and the addressing (inside and outside the partition) quite confusing, as you can see with my bugfix commit for the storage start address.

@Schievel1 Schievel1 changed the title Embassy boot and dfu flashing feat(dfu): Embassy boot and dfu flashing Jun 12, 2026
@Schievel1 Schievel1 marked this pull request as draft June 12, 2026 18:30
@Schievel1 Schievel1 force-pushed the embassy-boot branch 5 times, most recently from 06ccea8 to b1dcd26 Compare June 12, 2026 22:46
@Schievel1 Schievel1 force-pushed the embassy-boot branch 10 times, most recently from 58c3290 to 60c5ea6 Compare June 19, 2026 20:01
@Schievel1 Schievel1 force-pushed the embassy-boot branch 16 times, most recently from ea5197d to 1dd85ce Compare July 2, 2026 20:24
Schievel1 added 7 commits July 2, 2026 22:27
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
update example cargo.locks

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
@Schievel1 Schievel1 requested a review from HaoboGu July 2, 2026 20:28

@HaoboGu HaoboGu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thanks for your effort!

Comment thread docs/docs/main/docs/user_guide/flash_firmware/use_embassy_boot.mdx
Comment thread docs/docs/main/docs/user_guide/flash_firmware/use_embassy_boot.mdx

@HaoboGu HaoboGu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks great now

@HaoboGu HaoboGu merged commit a04a5ca into HaoboGu:main Jul 3, 2026
51 checks passed
@HaoboGu

HaoboGu commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Thanks again for your effort! Having DFU support is great

@Schievel1

Copy link
Copy Markdown
Contributor Author

Great, thanks for reviewing and merging. I am preparing the follow up with dfu_split support now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants