Skip to content

feat(dfu_ble): add possibility to flash Pico W and nRF52840 via BLE - #998

Draft
Schievel1 wants to merge 1 commit into
rmk-rs:mainfrom
Schievel1:dfu-ble
Draft

feat(dfu_ble): add possibility to flash Pico W and nRF52840 via BLE#998
Schievel1 wants to merge 1 commit into
rmk-rs:mainfrom
Schievel1:dfu-ble

Conversation

@Schievel1

@Schievel1 Schievel1 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Overview

This adds firmware updates over the air for nRF52840 and Pico W.
We do this by utilizing the embassy-boot setup with ACTIVE and DFU partitions of the flash, we write new firmware into the DFU partitions during a running RMK firmware and after a reboot the embassy-boot bootloader swaps ACTIVE and DFU and then boots the new firmware.

It uses nrf_dfu_target for the protocol which is a Rust implementation of the Nordic nRF DFU protocol . This doesn't mean this PR is limited to nRF chips, I just wanted to use a battle tested and proven protocol instead of inventing my own.
This also means that it is possible to use some of nRF's tooling. I tested with the DFU app on my phone and it went smooth. (although my phones bluetooth chip seems to be very very slow) However, the problem with most of those tools is, that they expect the nrf mcuboot bootloader to be preset. They want to reboot the device into this bootloader to flash the firmware. We don't do that here, so every tool that is expecting the mcuboot bootloader to answer won't work. Some listen for a specific UUID and such. Only the sloppy tools, that don't care if they got the device into the bootloader, work. As you can imagine this is all very brittle.
So I made my own instead, B.O.L.T (Bluetooth OTA Loading Tool)
Bolt is using nrf_dfu_target to load firmware into the bootloader. It can also create zip files that the nRF DFU protocol expects from firmware files like ELF and .bin. I will also create those zip files on the fly, so you can feed it .bin files and even ELF files.
If this PR goes well I would like to merge bolt into rmk at a later point.

Split keyboards

Normal keyboards and split keyboard's centrals just have an additional bluetooth service, bolt connects to them, sends firmware data, mark as updated for embassy-boot, device reboots, embassy-boot does the rest.
Split keyboard's peripherals don't advertise in bluetooth normally, so instead they have to be brought into "BLE DFU mode". They do so if they started up and cannot find their central for ten seconds. Then they start advertising as "$PRODUCT_NAME perN", where N is the number of the peripheral. So "My RMK Keyboard per0" for example.
They can then be flashed using bolt like the central and non split keyboards.

Security

Obviously this can be used to flash a keyboard without the user noticing. Keyboards still need to be paired with the host but with JustWorks pairing that doesn't require key input this is rather a inconvenience than an barrier.
It is rather unlikely this is a problem for you but if the feds are after you you shouldn't be using this. Maybe you shouldn't be using a quirky custom keyboard anyway.
However, dfu_lock still works for this, so if it's active the firmware can only be flashed when the keyboard is unlocked.
To unlock you try to send the firmware once using bolt. Then the normal 10s unlock window opens. You press the keys to unlock, the LED (if configured) starts flashing D F U in Morse. The you have 10s to start another firmware send.

For added security, embassy-boot also supports compiling in your own public key and it then refuses to load any firmware that isn't signed by your private key. This is just a tip, I have no plans an implementing this, so you have to roll your own bootloader.

Speed

Speed wise this is at 6.5kb/s which could be better. I already switch to faster (more power hungry) bluetooth settings during the transmission of the firmware data. I think the flash writes themselves are the bottleneck now. Tips on how to speed this up are always welcome.
Effectively, with connection handshake and everything factored, in you can flash a typical 400kb firmware with this in about a minute.

@Schievel1
Schievel1 force-pushed the dfu-ble branch 4 times, most recently from 6378017 to d5517f3 Compare July 26, 2026 08:52
@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown

Size Report

Example main PR Diff .text .data .bss
use_config/nrf52832_ble 397.2 KiB 397.4 KiB +0.04% ⬆️ +176 0 +8
use_config/nrf52840_ble 447.3 KiB 447.4 KiB +0.03% ⬆️ +144 0 +8
use_config/nrf52840_ble_split (central) 500.2 KiB 500.2 KiB -0.01% ⬇️ -68 0 +8
use_config/nrf52840_ble_split (peripheral) 320.5 KiB 323.6 KiB +0.95% ⬆️ +3096 0 +24
use_config/pi_pico_w_ble 671.3 KiB 671.3 KiB +0.00% ⬇️ -36 0 +8
use_config/rp2040 150.4 KiB 150.4 KiB +0.00% ⬇️ -4 0 0
use_config/rp2040_split (central) 164.3 KiB 164.3 KiB +0.00% 0 0 0
use_config/rp2040_split (peripheral) 27.8 KiB 27.8 KiB +0.00% 0 0 0
use_config/stm32f1 63.6 KiB 63.6 KiB +0.00% ⬆️ +4 0 0
use_config/stm32h7 101.9 KiB 101.9 KiB +0.00% 0 0 0
use_rust/nrf52832_ble 385.8 KiB 385.8 KiB +0.00% ⬆️ +28 0 +8
use_rust/nrf52840_ble 440.8 KiB 440.8 KiB +0.00% ⬇️ -20 0 +8
use_rust/nrf52840_ble_split (central) 507.0 KiB 506.8 KiB -0.03% ⬇️ -196 0 +8
use_rust/nrf52840_ble_split (peripheral) 318.2 KiB 321.4 KiB +1.00% ⬆️ +3240 0 +24
use_rust/pi_pico_w_ble 671.6 KiB 671.6 KiB +0.00% ⬇️ -36 0 +8
use_rust/rp2040 150.2 KiB 150.2 KiB +0.00% ⬇️ -4 0 0
use_rust/rp2040_split (central) 162.7 KiB 162.7 KiB +0.00% ⬇️ -4 0 0
use_rust/rp2040_split (peripheral) 28.2 KiB 28.2 KiB +0.00% 0 0 0
use_rust/stm32f1 63.5 KiB 63.5 KiB +0.00% 0 0 0
use_rust/stm32h7 121.8 KiB 121.8 KiB +0.00% ⬇️ -4 0 0
use_config/nrf52832_ble — 397.2 KiB → 397.4 KiB (+0.04% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 363400	   8620	  34888	 406908	  6357c	rmk-nrf52832

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 363224	   8620	  34880	 406724	  634c4	rmk-nrf52832

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0% +1.31Ki  [ = ]       0    .debug_str
  +0.0%    +701  [ = ]       0    .debug_info
  +0.1%    +645  [ = ]       0    .debug_loc
  +0.2%    +328  [ = ]       0    .debug_ranges
  +0.1%    +251  [ = ]       0    .debug_line
  +0.1%    +164  +0.1%    +164    .text
  +0.0%     +12  +0.0%     +12    .rodata
   +23%     +11  [ = ]       0    [Unmapped]
  [ = ]       0  +0.0%      +8    .bss
  -0.0%     -16  [ = ]       0    .debug_aranges
  -0.1%     -32  [ = ]       0    .debug_frame
  -0.0%     -50  [ = ]       0    .strtab
  -0.1%     -96  [ = ]       0    .symtab
  +0.0% +3.18Ki  +0.0%    +184    TOTAL
use_config/nrf52840_ble — 447.3 KiB → 447.4 KiB (+0.03% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 396552	   8628	  53008	 458188	  6fdcc	rmk-nrf52840

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 396408	   8628	  53000	 458036	  6fd34	rmk-nrf52840

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.2% +1.29Ki  [ = ]       0    .debug_loc
  +0.0%   +1003  [ = ]       0    .debug_str
  +0.0%    +744  [ = ]       0    .debug_info
  +0.1%    +216  [ = ]       0    .debug_line
  +0.0%    +128  +0.0%    +128    .text
  +0.5%     +39  [ = ]       0    .debug_abbrev
  +0.0%     +16  +0.0%     +16    .rodata
  [ = ]       0  +0.0%      +8    .bss
 -28.6%     -20  [ = ]       0    [Unmapped]
  -0.1%     -32  [ = ]       0    .debug_aranges
  -0.1%     -64  [ = ]       0    .debug_frame
  -0.0%     -64  [ = ]       0    .debug_ranges
  -0.0%     -66  [ = ]       0    .strtab
  -0.1%    -128  [ = ]       0    .symtab
  +0.0% +3.02Ki  +0.0%    +152    TOTAL
use_config/nrf52840_ble_split (central) — 500.2 KiB → 500.2 KiB (-0.01% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 453644	   8684	  49848	 512176	  7d0b0	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 453712	   8684	  49840	 512236	  7d0ec	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +4.34Ki  [ = ]       0    .debug_str
  +0.1% +1.50Ki  [ = ]       0    .debug_info
  +0.1%    +939  [ = ]       0    .debug_loc
  +0.0%     +46  [ = ]       0    .debug_line
  +0.0%     +16  +0.0%     +16    .rodata
  [ = ]       0  +0.0%      +8    .bss
  -0.1%     -48  [ = ]       0    .debug_aranges
  -0.0%     -64  [ = ]       0    .symtab
  -0.1%     -80  [ = ]       0    .debug_frame
  -0.0%     -84  -0.0%     -84    .text
  -0.0%     -95  [ = ]       0    .strtab
  -0.1%    -128  [ = ]       0    .debug_ranges
  +0.1% +6.32Ki  -0.0%     -60    TOTAL
use_config/nrf52840_ble_split (peripheral) — 320.5 KiB → 323.6 KiB (+0.95% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 295344	   8500	  27472	 331316	  50e34	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 292248	   8500	  27448	 328196	  50204	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.4% +13.3Ki  [ = ]       0    .debug_str
  +0.7% +11.1Ki  [ = ]       0    .debug_info
  +0.9% +5.16Ki  [ = ]       0    .debug_loc
  +1.1% +2.84Ki  +1.1% +2.84Ki    .text
  +0.9% +2.34Ki  [ = ]       0    .strtab
  +0.8% +1.80Ki  [ = ]       0    .debug_line
  +1.0% +1.02Ki  [ = ]       0    .symtab
  +0.6%   +1008  [ = ]       0    .debug_ranges
  +1.0%    +348  [ = ]       0    .debug_frame
  +0.6%    +192  +0.6%    +192    .rodata
  +0.3%    +136  [ = ]       0    .debug_aranges
  [ = ]       0  +0.1%     +24    .bss
  +1.3%      +8  [ = ]       0    .defmt
 -33.8%     -23  [ = ]       0    [Unmapped]
  +0.6% +39.1Ki  +1.0% +3.05Ki    TOTAL
use_config/pi_pico_w_ble — 671.3 KiB → 671.3 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 633288	      0	  54144	 687432	  a7d48	rmk-pi-pico-w

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 633324	      0	  54136	 687460	  a7d64	rmk-pi-pico-w

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +2.40Ki  [ = ]       0    .debug_str
  +0.0%    +977  [ = ]       0    .debug_info
  +0.1%    +128  [ = ]       0    .debug_ranges
  +0.0%    +111  [ = ]       0    .debug_line
  +0.0%     +16  +0.0%     +16    .rodata
  [ = ]       0  +0.0%      +8    .bss
  -0.0%     -10  [ = ]       0    .strtab
 -44.3%     -31  [ = ]       0    [Unmapped]
  -0.0%     -52  -0.0%     -52    .text
  -0.1%     -64  [ = ]       0    .symtab
  -0.1%    -706  [ = ]       0    .debug_loc
  +0.0% +2.76Ki  -0.0%     -28    TOTAL
use_config/rp2040 — 150.4 KiB → 150.4 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 138376	      0	  15644	 154020	  259a4	rmk-rp2040

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 138380	      0	  15644	 154024	  259a8	rmk-rp2040

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +72  [ = ]       0    .debug_str
  +0.0%      +8  [ = ]       0    .strtab
  -0.0%      -4  -0.0%      -4    .text
  -0.0%      -9  [ = ]       0    .debug_info
 -39.4%     -26  [ = ]       0    [Unmapped]
  -0.0%     -49  [ = ]       0    .debug_line
  -0.0%      -8  -0.0%      -4    TOTAL
use_config/rp2040_split (central) — 164.3 KiB → 164.3 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 151688	      0	  16508	 168196	  29104	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 151688	      0	  16508	 168196	  29104	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +2.00Ki  [ = ]       0    .debug_str
  +0.2%    +268  [ = ]       0    .strtab
  -0.0%     -12  [ = ]       0    .debug_loc
  +0.1% +2.25Ki  [ = ]       0    TOTAL
use_config/rp2040_split (peripheral) — 27.8 KiB → 27.8 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  25616	     60	   2796	  28472	   6f38	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  25616	     60	   2796	  28472	   6f38	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1%    +589  [ = ]       0    .debug_str
  +0.1%     +31  [ = ]       0    .strtab
  +0.0%      +1  [ = ]       0    .debug_line
  -2.7%      -1  [ = ]       0    [Unmapped]
  +0.0%    +620  [ = ]       0    TOTAL
use_config/stm32f1 — 63.6 KiB → 63.6 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  57588	     28	   7488	  65104	   fe50	rmk-stm32f1

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  57584	     28	   7488	  65100	   fe4c	rmk-stm32f1

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +137  [ = ]       0    .debug_str
  +0.0%      +5  [ = ]       0    .strtab
  +0.0%      +4  +0.0%      +4    .text
  -5.8%      -4  [ = ]       0    [Unmapped]
  -0.0%      -6  [ = ]       0    .debug_line
  +0.0%    +136  +0.0%      +4    TOTAL
use_config/stm32h7 — 101.9 KiB → 101.9 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  94304	    264	   9736	 104304	  19770	rmk-stm32h7

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  94304	    264	   9736	 104304	  19770	rmk-stm32h7

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  -0.3%    -188  [ = ]       0    .strtab
  -0.1% -1.23Ki  [ = ]       0    .debug_str
  -0.0% -1.41Ki  [ = ]       0    TOTAL
use_rust/nrf52832_ble — 385.8 KiB → 385.8 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 351540	   8620	  34944	 395104	  60760	rmk-nrf52832

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 351512	   8620	  34936	 395068	  6073c	rmk-nrf52832

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0% +1.22Ki  [ = ]       0    .debug_str
  +0.2% +1.17Ki  [ = ]       0    .debug_loc
  +0.3%    +616  [ = ]       0    .debug_ranges
  +0.1%     +20  +0.1%     +20    .rodata
  [ = ]       0  +0.0%      +8    .bss
  +0.0%      +8  +0.0%      +8    .text
   +13%      +6  [ = ]       0    [Unmapped]
  +0.0%      +3  [ = ]       0    .strtab
  -0.0%     -32  [ = ]       0    .symtab
  -0.0%     -77  [ = ]       0    .debug_info
  -1.1%     -88  [ = ]       0    .debug_abbrev
  -0.0%     -90  [ = ]       0    .debug_line
  +0.0% +2.75Ki  +0.0%     +36    TOTAL
use_rust/nrf52840_ble — 440.8 KiB → 440.8 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 395724	   8628	  47064	 451416	  6e358	rmk-nrf52840

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 395744	   8628	  47056	 451428	  6e364	rmk-nrf52840

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.3% +2.40Ki  [ = ]       0    .debug_loc
  +0.0%    +985  [ = ]       0    .debug_str
  +0.0%    +652  [ = ]       0    .debug_info
  +0.0%     +20  +0.0%     +20    .rodata
  [ = ]       0  +0.0%      +8    .bss
  +0.0%      +8  [ = ]       0    .debug_ranges
  +0.0%      +8  [ = ]       0    .strtab
 -24.2%     -15  [ = ]       0    [Unmapped]
  -0.0%     -40  -0.0%     -40    .text
  -0.0%     -56  [ = ]       0    .debug_line
  +0.0% +3.93Ki  -0.0%     -12    TOTAL
use_rust/nrf52840_ble_split (central) — 507.0 KiB → 506.8 KiB (-0.03% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 456424	   8684	  53848	 518956	  7eb2c	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 456620	   8684	  53840	 519144	  7ebe8	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +1.13Ki  [ = ]       0    .debug_loc
  +0.0%    +305  [ = ]       0    .debug_str
  +0.0%    +290  [ = ]       0    .debug_info
  +0.1%    +192  [ = ]       0    .symtab
  +0.0%    +136  [ = ]       0    .strtab
  +0.1%     +80  [ = ]       0    .debug_frame
  +0.0%     +47  [ = ]       0    .debug_line
  +0.1%     +32  [ = ]       0    .debug_aranges
  +0.0%     +20  +0.0%     +20    .rodata
  [ = ]       0  +0.0%      +8    .bss
  +5.3%      +3  [ = ]       0    [Unmapped]
  -0.1%    -200  [ = ]       0    .debug_ranges
  -0.1%    -216  -0.1%    -216    .text
  +0.0% +1.80Ki  -0.0%    -188    TOTAL
use_rust/nrf52840_ble_split (peripheral) — 318.2 KiB → 321.4 KiB (+1.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 293400	   8500	  27240	 329140	  505b4	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 290160	   8500	  27216	 325876	  4f8f4	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.4% +13.0Ki  [ = ]       0    .debug_str
  +0.7% +10.4Ki  [ = ]       0    .debug_info
  +1.4% +7.65Ki  [ = ]       0    .debug_loc
  +1.2% +2.98Ki  +1.2% +2.98Ki    .text
  +0.9% +2.21Ki  [ = ]       0    .strtab
  +0.7% +1.65Ki  [ = ]       0    .debug_line
  +0.6% +1.02Ki  [ = ]       0    .debug_ranges
  +0.8%    +848  [ = ]       0    .symtab
  +0.8%    +268  [ = ]       0    .debug_frame
  +0.6%    +192  +0.6%    +192    .rodata
  +0.2%     +96  [ = ]       0    .debug_aranges
  [ = ]       0  +0.1%     +24    .bss
   +40%     +19  [ = ]       0    [Unmapped]
  +1.3%      +8  [ = ]       0    .defmt
  +0.6% +40.3Ki  +1.0% +3.19Ki    TOTAL
use_rust/pi_pico_w_ble — 671.6 KiB → 671.6 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 633344	      0	  54336	 687680	  a7e40	rmk-pi-pico-w

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 633380	      0	  54328	 687708	  a7e5c	rmk-pi-pico-w

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +2.35Ki  [ = ]       0    .debug_str
  +0.0% +1.05Ki  [ = ]       0    .debug_info
  +0.0%    +167  [ = ]       0    .debug_line
  +0.0%     +96  [ = ]       0    .debug_ranges
  +0.4%     +39  [ = ]       0    .debug_abbrev
  +0.0%     +17  [ = ]       0    .strtab
  +0.0%     +16  +0.0%     +16    .rodata
  [ = ]       0  +0.0%      +8    .bss
   +19%      +8  [ = ]       0    [Unmapped]
  -0.0%     -52  -0.0%     -52    .text
  -0.1%     -64  [ = ]       0    .symtab
  -0.1%    -929  [ = ]       0    .debug_loc
  +0.0% +2.72Ki  -0.0%     -28    TOTAL
use_rust/rp2040 — 150.2 KiB → 150.2 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 138196	      0	  15564	 153760	  258a0	rmk-rp2040

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 138200	      0	  15564	 153764	  258a4	rmk-rp2040

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +72  [ = ]       0    .debug_str
  +0.0%     +10  [ = ]       0    .debug_loc
  +0.0%      +8  [ = ]       0    .strtab
  +3.4%      +2  [ = ]       0    [Unmapped]
  -0.0%      -4  -0.0%      -4    .text
  -0.0%      -9  [ = ]       0    .debug_info
  -0.0%     -47  [ = ]       0    .debug_line
  +0.0%     +32  -0.0%      -4    TOTAL
use_rust/rp2040_split (central) — 162.7 KiB → 162.7 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 150300	      0	  16340	 166640	  28af0	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 150304	      0	  16340	 166644	  28af4	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +10  [ = ]       0    .debug_loc
   +14%      +7  [ = ]       0    [Unmapped]
  -0.0%      -1  [ = ]       0    .strtab
  -0.0%      -4  -0.0%      -4    .text
  -0.0%     -49  [ = ]       0    .debug_info
  -0.0%     -71  [ = ]       0    .debug_str
  -0.1%    -152  [ = ]       0    .debug_line
  -0.0%    -260  -0.0%      -4    TOTAL
use_rust/rp2040_split (peripheral) — 28.2 KiB → 28.2 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  25716	     60	   3060	  28836	   70a4	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  25716	     60	   3060	  28836	   70a4	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +6.5%      +4  [ = ]       0    [Unmapped]
  +0.0%      +1  [ = ]       0    .debug_line
  -0.0%      -1  [ = ]       0    .debug_str
  +0.0%      +4  [ = ]       0    TOTAL
use_rust/stm32f1 — 63.5 KiB → 63.5 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  57536	     28	   7504	  65068	   fe2c	rmk-stm32f1

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  57536	     28	   7504	  65068	   fe2c	rmk-stm32f1

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [ = ]       0  [ = ]       0    TOTAL
use_rust/stm32h7 — 121.8 KiB → 121.8 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 108516	    320	  15852	 124688	  1e710	rmk-stm32h7

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 108520	    320	  15852	 124692	  1e714	rmk-stm32h7

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1%    +124  [ = ]       0    .debug_line
  +0.0%    +101  [ = ]       0    .debug_str
  +0.0%     +37  [ = ]       0    .debug_info
   +12%      +5  [ = ]       0    [Unmapped]
  +0.0%      +1  [ = ]       0    .strtab
  -0.0%      -4  -0.0%      -4    .text
  +0.0%    +264  -0.0%      -4    TOTAL

@Schievel1
Schievel1 force-pushed the dfu-ble branch 4 times, most recently from b1c191a to d580030 Compare July 29, 2026 07:35
@Schievel1
Schievel1 marked this pull request as ready for review July 29, 2026 07:35
Comment thread rmk/src/ble/ble_server.rs Outdated
@HaoboGu

HaoboGu commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

I'm not sure about the BOLT. I prefer to use general apps. Otherwise, like the bootloader, I'd like to include it in RMK project so that it can be maintained better. The ultimate goal is to make RMK easy to use for both users and developers.

@Schievel1

Copy link
Copy Markdown
Contributor Author

I understand, and I tried to use only the nRF tools in the first place as well. The problem is, unlike USB-DFU, DFU via bluetooth doesn't really have an industry standard and every company ships it's own. And they coin everything towards their own 'walled garden' of course.
The nRF protocol is the only one that you could barely call the industry standard, so I used this. But many of their tools expect their mcuboot bootloader to answer. But their bootloader won't work chip-agnostic. Then again, nRF Connect doesn't work with normal bluetooth adapter at all and it expects their nRF dongle.

If we decide to keep bolt I will integrate it in RMK. As long as this PR is not ready and merged, I think it's better to wait with that. Maybe I need to change a thing or two in bolt still.

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
@HaoboGu

HaoboGu commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

If so, I'd like to create RMK's own bootloader + BLE OTA system, follow existing work. Maybe integrate it into the new Rynk system.

@Schievel1

Schievel1 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Yes, this is what we are doing here I thought.
Not sure about rynk though, because the nrf protocol is already well established and tested. No need to reinvent the wheel I think.

Bolt as a CLI app is only the beginning. I want to add a GUI app and also a web application if possible. So you can build the firmware on a server and also flash it from there.

@HaoboGu

HaoboGu commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Ah I agree! This is fully aligned with the goal of Rynk. It's designed to manage the keyboard from the host via CLI, GUI, etc.

@Schievel1
Schievel1 marked this pull request as draft August 4, 2026 06:01
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