Skip to content

fix: match physical layout include order with blecorne board - #31

Merged
perrwa merged 1 commit into
perrwa/add-cx40-zmk04-changesfrom
perrwa/fix-physical-layout-index-mismatch
May 20, 2026
Merged

fix: match physical layout include order with blecorne board#31
perrwa merged 1 commit into
perrwa/add-cx40-zmk04-changesfrom
perrwa/fix-physical-layout-index-mismatch

Conversation

@perrwa

@perrwa perrwa commented May 20, 2026

Copy link
Copy Markdown
Owner

Fixes the key position scramble when using blecorne halves as BLE peripherals to the Raytac dongle central.

Root cause: The dongle overlay included 5column.dtsi before 6column.dtsi, but the blecorne board definition includes them in the opposite order. ZMK enumerates physical layouts by DTS definition order, so when the central sends its selected layout index to peripherals via SET_PHYSICAL_LAYOUT, the peripheral resolves a different layout—selecting the 5-col transform (stride 10) instead of 6-col (stride 12), which scrambles every position.

Fix: Swap the include order in the dongle overlay to match blecorne (6col first, 5col second). Now both sides have layouts[0]=6col, layouts[1]=5col.

⚠️ After flashing, clear BLE bonds/settings on both dongle and peripherals—the previously-persisted layout index will be stale.

The dongle overlay included 5column.dtsi before 6column.dtsi, while the
blecorne board definition includes them in the opposite order. ZMK's
physical layout system enumerates layouts by DTS definition order, so
when the central sends its selected layout INDEX to peripherals, the
peripheral resolves a different layout.

Dongle (was): layouts[0]=5col, layouts[1]=6col → selects 6col → sends idx 1
Blecorne:     layouts[0]=6col, layouts[1]=5col → receives idx 1 → selects 5col!

This caused the peripheral to use the 5-column transform (stride 10)
instead of the 6-column transform (stride 12), scrambling every key
position sent to the central.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@perrwa perrwa self-assigned this May 20, 2026
@perrwa perrwa added bug Something isn't working firmware Firmware configuration changes do not merge Not ready — do not merge labels May 20, 2026
@perrwa
perrwa changed the base branch from main to perrwa/add-cx40-zmk04-changes May 20, 2026 16:09
@perrwa
perrwa merged commit b50576a into perrwa/add-cx40-zmk04-changes May 20, 2026
14 checks passed
@perrwa
perrwa deleted the perrwa/fix-physical-layout-index-mismatch branch May 20, 2026 16:09
@perrwa perrwa removed the do not merge Not ready — do not merge label May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working firmware Firmware configuration changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant