Skip to content

Updates nrf sdk to latest + new devices + removed vendored devices#325

Open
eyJhb wants to merge 7 commits intojfedor2:masterfrom
eyJhb:bump-sdk-nrf
Open

Updates nrf sdk to latest + new devices + removed vendored devices#325
eyJhb wants to merge 7 commits intojfedor2:masterfrom
eyJhb:bump-sdk-nrf

Conversation

@eyJhb
Copy link
Copy Markdown

@eyJhb eyJhb commented Dec 17, 2025

This PR does the following:

  • Init a west repository, with the latest nrf-sdk v3.2.0
  • Updated prj.conf
    • Removed deprecated options
    • Changed options to new names
  • Fixed bug in read report map over BT which was introduced by update
    • Seems like the buffer was not big enough. The changes made fixes that. Unsure if there is a better way
  • Removes vendored devices, and use upstream instead
  • Adds support for nrf52840dongle/nrf52840 as well as nrf52840_mdk_usb_dongle
  • Actions updated to use newest image from Zephyr project
  • Actions builds newly added devices

Supersedes #322 , however, documentation needs to be added.

Commit history is a mess, but I would like to get some comments on these changes, and if you @jfedor2 would like to have it incorporated in the repo. I have only teested the new devices, as I don't own any of the existing devices. But I assume they should work just fine.

Artifacts can be downloaded from this workflow: https://github.com/eyJhb/hid-remapper/actions/runs/20307694412

TODO (will only look at once I get commits/suggestions/go-ahead)

@eyJhb
Copy link
Copy Markdown
Author

eyJhb commented Dec 17, 2025

@scatterthought you might be interested in this. There are a prebuilt image for the MDK nrf52840 in the link above that should work :)

@scatterthought
Copy link
Copy Markdown

Thanks! I actually ordered a SEEED XIAO from AliExpress, but the package tracking has shown the dreaded "cleared customs, awaiting courier pickup" message for a week, which means that I'll probably never see it.

@ATMakersBill
Copy link
Copy Markdown

@eyJhb Thank you for your work on this! We have a (special needs) Center School in FL that needs to be able to move a trial device between iPads without having to unpair/repair/etc all day and I'm pretty sure HID-Remapper + the Switch Interface will work very well.

I am trying to do this with the MDBT50Q-CX (USB-C) version of the dongle. I suspect that it will have very few differences from the -RX USB-A version. However, I've been unable to make much headway.

I followed instructions from the Mfg to use NRF-Connect to try to load a new firmware, but got nowhere trying to install the Adafruit UF2 bootloader. I think (now) that it doesn't let you replace the bootloader w/o a JLink. So, I am hoping that your build will load on the device without replacing the bootloader. However, the NRF-Connect won't burn the .zip file, so I think I need to setup a full nrfutils toolchain (?).

I've always used UF2s for this type of work, so I'd love any advice. I'll keep banging on this but have work in the morning :-/

Thanks again

@ATMakersBill
Copy link
Copy Markdown

ATMakersBill commented Feb 16, 2026

Couldn't give up yet :-)

I flashed the firmware to my Raytac MDBT50Q-CX successfully but the device doesn't enumerate on USB. Wireshark shows USB URB_BULK packets but no Windows device appears. I suspect DCDC is enabled - does the nrf52840dongle build have DCDC disabled? The Raytac dongle doesn't have the external LC filter. Can you provide a build with DCDC disabled or instructions on how to rebuild it?

Or maybe someone's seen this and has another option?

Update: According to Claude, disabling DCDC isn't that hard:

The fix should be to add a board overlay file at firmware-bluetooth/boards/nrf52840dongle_nrf52840.overlay with:

&reg1 {
    regulator-initial-mode = <NRF5X_REG_MODE_LDO>;
};

&reg0 {
    regulator-initial-mode = <NRF5X_REG_MODE_LDO>;
};

This will disable DCDC for the Raytac dongle.

This also makes some changes to prj.conf in firmware-bluetooth, as
some options has changed name, and a new USB Device Stack was
implemented.

Besides this, the BT_ATT_TX_COUNT needed to be increased, so that we
can read the device report map
This removes the custom overlays, and uses the upstream ones in the
nrf zephyr repository instead. Also removed USE_DT_CODE_PARTITIONS as
that  should not be needed anymore. Testing required.
Support with default bootloader as well
@eyJhb
Copy link
Copy Markdown
Author

eyJhb commented Feb 16, 2026

Try these files. I just build them with the target raytac_mdbt50q_cx_40_dongle/nrf52840 instead. So maybe they'll work?
If you want to play around with it yourself, then I would suggest just playing with Docker, and looking at the workflow file here. When you're in the project directory of hid-remapper, it boils down to something like (the commands after docker run, should be running inside of docker)..

docker run --rm -it -v (pwd):/workdir zephyrprojectrtos/ci:v0.28.7
west init -l .
west config build.sysbuild False
west update -o=--depth=1 -n
cd firmware-bluetooth
west build -b raytac_mdbt50q_cx_40_dongle/nrf52840

If you want to make an overlay file, then create it as raytac_mdbt50q_cx_40_dongle_nrf52840.overlay (I assume).

Good luck!

raytac_mdbt50q_cx_40_dongle_hidremapper.zip

^ remember to unzip the file, i've included both .uf2 and .hex. I normally flash using something like.

nrfutil pkg generate --hw-version 52 --sd-req=0x00 --application build/zephyr/remapper.hex --application-version 1 build/remapper.zip && nrfutil dfu usb-serial -pkg build/remapper.zip -p /dev/ttyACM0

@ATMakersBill
Copy link
Copy Markdown

That was hugely helpful - thank you!

I was able to flash the device and the config screen works - I can add expressions, save them, load them, etc.

However, I can't get my keyboard or mouse to pair to it. I've tried "Pair New Device" and it does nothing (no error to JS console either). I've tried the button on the device with no luck.

Thoughts?

@ATMakersBill
Copy link
Copy Markdown

Here's a screenshot of NRF Connect after the flash (and back in DFU mode)
image

And I've attached the JSON file from the xport
hid-remapper-config.json

Honestly I'm not sure the SoftDevice is running - I don't see it when my phone scans with NRF Connect

@ATMakersBill
Copy link
Copy Markdown

Turns out there was no SoftDevice there - when I manually install the SoftDevice & then the Application, I'm right back to not enumerating the USB (no LED, no HID Remapper). Here's a snapshot of the NRF Connect
image

@ATMakersBill
Copy link
Copy Markdown

Honestly, I think it would work if you had a .hex/.zip file that had the application as well as the softdevice in it. When I load your .hex it only has the application (but the application works). When I load the softdevice by itself it works... but when I load one then the other it doesn't. And when I try to build a package with both, it won't install via DFU (says incompatible SoftDevice).

Kinda stumped

@ATMakersBill
Copy link
Copy Markdown

Just an update, I have gotten the build env setup & I've made tweaks and changes to debug this thing. At this point, I have the .hex file loading and running with USB and Bluetooth functionality running at the same time (yay!) however I can't pair to any devices (two keyboards & a mouse) (BOO). Here's the debug error I'm getting

[00:03:40.369,293] remapper: main: device_disconnected_callback conn_idx=0
DEBUG: SCAN START trigger received!
Found Device: \▒ C, RSSI: -62 dBm
[00:03:42.465,179] remapper: scan_filter_match: scan_filter_match address: 70:04:1D:CE:0B:06 (public) connectable: yes
[00:03:42.467,559] remapper: scan_connecting:
[00:03:42.571,350] remapper: connected: 70:04:1D:CE:0B:06 (public)
[00:03:42.618,164] remapper: security failed: 70:04:1D:CE:0B:06 (public), level=536920321, err=536920324
[00:03:42.618,316] remapper: 70:04:1D:CE:0B:06 (public), reason 536886020
[00:04:09.655,578] remapper: disconnected: 70:04:1D:CE:0B:06 (public) (reason=8)

At this point, I'm wondering if this is a PKI issue? Anyone seen this?

@ATMakersBill
Copy link
Copy Markdown

Alright, I'm super tempted to take down those posts - I have spent an enormous amount of time finding this and it's just two lines in prj.conf 😊

The dongle needs the following lines added to prj.conf:

CONFIG_BT_SMP_SC_PAIR_ONLY=n
CONFIG_BT_SMP_ENFORCE_MITM=n

Perhaps there's a way to get the Crypto stuff to work and use higher security models, but this allows everything to build, link, and then not have corruption. I'm attaching my .hex file - it works well.

Thanks Again!

This is the zip file packaged up and ready to be sent via DFU
remapper.zip

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.

3 participants