Skip to content

feat: per-split-board chip selection and chip-specific config overrides#897

Draft
drindr wants to merge 1 commit into
HaoboGu:mainfrom
drindr:rmk-elytra
Draft

feat: per-split-board chip selection and chip-specific config overrides#897
drindr wants to merge 1 commit into
HaoboGu:mainfrom
drindr:rmk-elytra

Conversation

@drindr

@drindr drindr commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator
  • Add chip option to SplitBoardConfig so split peripherals can use a

    different chip than the top-level keyboard.

  • Resolve [chip.<name>] overrides into Hardware.chip_configs.

  • Thread explicit ChipModel/ChipConfig through chip_init, flash_init,

    watchdog, and split peripheral code generation.

- Add `chip` option to `SplitBoardConfig` so split peripherals can use a

  different chip than the top-level keyboard.

- Resolve `[chip.<name>]` overrides into `Hardware.chip_configs`.

- Thread explicit `ChipModel`/`ChipConfig` through chip_init, flash_init,

  watchdog, and split peripheral code generation.
@github-actions

Copy link
Copy Markdown

Size Report

Example main PR Diff .text .data .bss
use_config/nrf52832_ble 373.8 KiB 373.8 KiB +0.00% 0 0 0
use_config/nrf52840_ble 422.8 KiB 422.8 KiB +0.00% ⬆️ +8 0 0
use_config/nrf52840_ble_split (central) 498.5 KiB 498.5 KiB +0.00% ⬆️ +4 0 0
use_config/nrf52840_ble_split (peripheral) 323.0 KiB 323.0 KiB +0.00% ⬆️ +4 0 0
use_config/pi_pico_w_ble 660.3 KiB 660.3 KiB +0.00% ⬆️ +4 0 0
use_config/rp2040 148.5 KiB 148.5 KiB +0.00% 0 0 0
use_config/rp2040_split (central) 162.1 KiB 162.1 KiB +0.00% ⬇️ -12 0 0
use_config/rp2040_split (peripheral) 27.8 KiB 27.8 KiB +0.00% 0 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 361.3 KiB 361.3 KiB +0.00% ⬆️ +8 0 0
use_rust/nrf52840_ble 418.7 KiB 418.7 KiB +0.00% ⬆️ +4 0 0
use_rust/nrf52840_ble_split (central) 507.4 KiB 507.4 KiB +0.00% ⬇️ -8 0 0
use_rust/nrf52840_ble_split (peripheral) 319.7 KiB 319.7 KiB +0.00% ⬆️ +4 0 0
use_rust/pi_pico_w_ble 660.8 KiB 660.8 KiB +0.00% 0 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% 0 0 0
use_rust/rp2040_split (peripheral) 28.1 KiB 28.1 KiB +0.01% ⬆️ +4 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 — 373.8 KiB → 373.8 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 342892	   5256	  34616	 382764	  5d72c	rmk-nrf52832

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 342892	   5256	  34616	 382764	  5d72c	rmk-nrf52832

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +464  [ = ]       0    .debug_info
  +0.0%    +247  [ = ]       0    .debug_str
  +0.3%     +26  [ = ]       0    .debug_abbrev
  +0.0%     +19  [ = ]       0    .debug_line
  +0.0%    +756  [ = ]       0    TOTAL
use_config/nrf52840_ble — 422.8 KiB → 422.8 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 376400	   5264	  51264	 432928	  69b20	rmk-nrf52840

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 376392	   5264	  51264	 432920	  69b18	rmk-nrf52840

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +151  [ = ]       0    .debug_info
  +0.0%     +22  [ = ]       0    .debug_str
  +0.0%      +8  +0.0%      +8    .text
 -18.3%     -11  [ = ]       0    [Unmapped]
  -0.0%     -74  [ = ]       0    .debug_line
  +0.0%     +96  +0.0%      +8    TOTAL
use_config/nrf52840_ble_split (central) — 498.5 KiB → 498.5 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 456800	   6588	  47080	 510468	  7ca04	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 456796	   6588	  47080	 510464	  7ca00	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +505  [ = ]       0    .debug_info
  +0.0%     +75  [ = ]       0    .debug_line
  +0.0%     +32  [ = ]       0    .debug_loc
  +0.2%     +15  [ = ]       0    .debug_abbrev
  +0.0%      +4  +0.0%      +4    .text
  -1.8%      -1  [ = ]       0    [Unmapped]
  -0.0%    -182  [ = ]       0    .debug_str
  +0.0%    +448  +0.0%      +4    TOTAL
use_config/nrf52840_ble_split (peripheral) — 323.0 KiB → 323.0 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 297236	   5920	  27592	 330748	  50bfc	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 297232	   5920	  27592	 330744	  50bf8	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +672  [ = ]       0    .debug_info
  +0.0%     +98  [ = ]       0    .debug_line
  +0.0%     +20  [ = ]       0    .debug_str
  +0.0%      +4  +0.0%      +4    .text
  -3.1%      -2  [ = ]       0    [Unmapped]
  +0.0%    +792  +0.0%      +4    TOTAL
use_config/pi_pico_w_ble — 660.3 KiB → 660.3 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 620500	      0	  55652	 676152	  a5138	rmk-pi-pico-w

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 620496	      0	  55652	 676148	  a5134	rmk-pi-pico-w

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +785  [ = ]       0    .debug_str
  +0.0%    +323  [ = ]       0    .debug_info
  +0.0%     +14  [ = ]       0    .debug_line
  +0.0%      +4  +0.0%      +4    .text
  +0.0%      +1  [ = ]       0    .strtab
  -7.7%      -5  [ = ]       0    [Unmapped]
  -0.0%     -10  [ = ]       0    .debug_loc
  -0.2%     -20  [ = ]       0    .debug_abbrev
  +0.0% +1.07Ki  +0.0%      +4    TOTAL
use_config/rp2040 — 148.5 KiB → 148.5 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 136524	      0	  15540	 152064	  25200	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%     +40  [ = ]       0    .debug_str
  -2.8%      -1  [ = ]       0    [Unmapped]
  -0.0%     -28  [ = ]       0    .debug_line
  -0.0%     -42  [ = ]       0    .debug_loc
  -0.0%     -57  [ = ]       0    .debug_info
  -0.0%     -88  [ = ]       0    TOTAL
use_config/rp2040_split (central) — 162.1 KiB → 162.1 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 149568	      0	  16388	 165956	  28844	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 149580	      0	  16388	 165968	  28850	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +1.01Ki  [ = ]       0    .debug_str
  +0.0%    +271  [ = ]       0    .debug_info
  +0.0%     +32  [ = ]       0    .debug_loc
   +36%     +14  [ = ]       0    [Unmapped]
  -0.0%     -12  -0.0%     -12    .text
  -0.1%    -120  [ = ]       0    .debug_line
  +0.0% +1.19Ki  -0.0%     -12    TOTAL
use_config/rp2040_split (peripheral) — 27.8 KiB → 27.8 KiB (+0.00%)

cargo size (PR):

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

cargo size (main):

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

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [ = ]       0  [ = ]       0    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%    +177  [ = ]       0    .debug_str
  +0.0%     +16  [ = ]       0    .debug_line
  -1.8%      -1  [ = ]       0    [Unmapped]
  +0.0%    +192  [ = ]       0    TOTAL
use_config/stm32h7 — 100.0 KiB → 100.0 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  92404	    268	   9760	 102432	  19020	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%     +15  [ = ]       0    .debug_str
  +0.0%      +4  +0.0%      +4    .text
 -11.1%      -6  [ = ]       0    [Unmapped]
  -0.0%    -121  [ = ]       0    .debug_info
  -0.1%    -144  [ = ]       0    .debug_line
  -0.0%    -252  +0.0%      +4    TOTAL
use_rust/nrf52832_ble — 361.3 KiB → 361.3 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 331156	   5256	  33600	 370012	  5a55c	rmk-nrf52832

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 331148	   5256	  33600	 370004	  5a554	rmk-nrf52832

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +803  [ = ]       0    .debug_str
  +0.0%     +43  [ = ]       0    .debug_info
  +0.0%      +8  +0.0%      +8    .text
 -13.3%      -8  [ = ]       0    [Unmapped]
  -0.4%     -35  [ = ]       0    .debug_abbrev
  -0.0%    -111  [ = ]       0    .debug_line
  +0.0%    +700  +0.0%      +8    TOTAL
use_rust/nrf52840_ble — 418.7 KiB → 418.7 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 376748	   5264	  46752	 428764	  68adc	rmk-nrf52840

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 376744	   5264	  46752	 428760	  68ad8	rmk-nrf52840

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +912  [ = ]       0    .debug_str
  +0.0%     +32  [ = ]       0    .debug_ranges
  +0.0%     +32  [ = ]       0    .symtab
  +0.0%     +26  [ = ]       0    .strtab
  +0.0%     +20  [ = ]       0    .debug_frame
  +0.0%      +8  [ = ]       0    .debug_aranges
  +0.0%      +4  +0.0%      +4    .text
  -8.8%      -5  [ = ]       0    [Unmapped]
  -0.2%     -15  [ = ]       0    .debug_abbrev
  -0.1%    -335  [ = ]       0    .debug_line
  -0.1% -1.03Ki  [ = ]       0    .debug_loc
  -0.1% -2.58Ki  [ = ]       0    .debug_info
  -0.0% -2.95Ki  +0.0%      +4    TOTAL
use_rust/nrf52840_ble_split (central) — 507.4 KiB → 507.4 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 460140	   6588	  52824	 519552	  7ed80	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 460148	   6588	  52824	 519560	  7ed88	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +295  [ = ]       0    .debug_info
  +0.0%    +111  [ = ]       0    .debug_line
  +0.0%     +32  [ = ]       0    .debug_loc
   +16%     +10  [ = ]       0    [Unmapped]
  -0.0%      -8  -0.0%      -8    .text
  -0.0%     -32  [ = ]       0    .debug_str
  +0.0%    +408  -0.0%      -8    TOTAL
use_rust/nrf52840_ble_split (peripheral) — 319.7 KiB → 319.7 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 295624	   5360	  26360	 327344	  4feb0	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 295620	   5360	  26360	 327340	  4feac	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +21  [ = ]       0    .debug_line
  +0.0%      +4  +0.0%      +4    .text
 -12.5%      -8  [ = ]       0    [Unmapped]
  -0.0%     -32  [ = ]       0    .debug_loc
  -0.0%    -169  [ = ]       0    .debug_info
  -0.0% -1.02Ki  [ = ]       0    .debug_str
  -0.0% -1.20Ki  +0.0%      +4    TOTAL
use_rust/pi_pico_w_ble — 660.8 KiB → 660.8 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 620872	      0	  55796	 676668	  a533c	rmk-pi-pico-w

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 620872	      0	  55796	 676668	  a533c	rmk-pi-pico-w

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +176  [ = ]       0    .debug_str
  +0.0%    +102  [ = ]       0    .debug_line
  +0.0%     +15  [ = ]       0    .debug_info
   +14%      +5  [ = ]       0    [Unmapped]
  -0.0%      -2  [ = ]       0    .debug_loc
  -0.2%     -24  [ = ]       0    .debug_abbrev
  +0.0%    +272  [ = ]       0    TOTAL
use_rust/rp2040 — 148.0 KiB → 148.0 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 136180	      0	  15412	 151592	  25028	rmk-rp2040

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 136188	      0	  15412	 151600	  25030	rmk-rp2040

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +596  [ = ]       0    .debug_str
  +0.1%    +558  [ = ]       0    .debug_info
  +7.3%      +4  [ = ]       0    [Unmapped]
  -0.0%      -8  -0.0%      -8    .text
  -0.1%    -150  [ = ]       0    .debug_line
  +0.0%   +1000  -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
 148452	      0	  16172	 164624	  28310	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%    +612  [ = ]       0    .debug_str
  +0.0%    +335  [ = ]       0    .debug_info
  +0.0%      +4  [ = ]       0    .debug_line
  +2.2%      +1  [ = ]       0    [Unmapped]
  +0.0%    +952  [ = ]       0    TOTAL
use_rust/rp2040_split (peripheral) — 28.1 KiB → 28.1 KiB (+0.01% ⬆️)

cargo size (PR):

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

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  25652	     60	   3060	  28772	   7064	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1%      +4  +0.1%      +4    .rodata
  -1.6%      -1  [ = ]       0    [Unmapped]
  -0.0%      -3  [ = ]       0    .debug_str
  [ = ]       0  +0.0%      +4    TOTAL
use_rust/stm32f1 — 62.9 KiB → 62.9 KiB (+0.00% ⬆️)

cargo size (PR):

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

cargo size (main):

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

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +300  [ = ]       0    .debug_str
  +0.0%    +135  [ = ]       0    .debug_info
  +0.0%      +4  +0.0%      +4    .text
  -5.2%      -3  [ = ]       0    [Unmapped]
  +0.0%    +436  +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%    +110  [ = ]       0    .debug_str
  +0.0%     +27  [ = ]       0    .debug_line
  +0.0%      +9  [ = ]       0    .debug_info
  -0.0%     -10  [ = ]       0    .debug_loc
  +0.0%    +136  [ = ]       0    TOTAL

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.

1 participant