-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NRF52840 USB Dongle and general NRF5x support #89
Comments
Interesting thoughts. |
This is something that I'm interested in too. I actually ordered this nrf52840 dongle the other day to play with.
A while ago I used the nrf24 ESB library to get some basic matrix scanning + nrf24 RF working. It seems pretty straight forward to get it working. Haven't got any USB/BT stuff going yet. That code is a bit old (I was using the preview dev kit), but I try clean it up and get something committed to the repo soon.
The MIT license is compatible with Nordics 5-clause license, so no worries there.
The way keyplus is designed, you can configure it via USB. So most people can just flash a pre-compiled binary which includes the softdevice. |
Awesome. While my nrf52 dongle arrives in the next 20-60 days, is atmega32u4 support working? I would like to get the nrf51 communicating with nrf24 modules but only have a couple of pro micros available. |
Hi there, This is a really great project! Just see this for a while, and must say something about nrf52840 because I am working on it. See trkeyboard.com and nine-fox.com, nine-fox.com/pad
Anyway, this is really a great chip and you can implement a lot of keyboard using it. Good luck with it! Thanks, |
@bezmi Hey made a lot of progress on this now. The nrf52840 dongle code now is basically equivalent to the nRF24LU1+ version. Here's some pre-compile code if you want to give it a go: keyplus-f9a0f8c.tar.gz. The hex file was compiled for the Nordic nRF52840 dongle and you can flash it easily with nRFconnect. I'm not sure if it will run on the Holyiot dongle without modification since it expects a bootloader/mbr to be in place. Do you know if the Holyiot dongle comes flashed with a bootloader? I looked at the store page and it breaks out the SWD pins, but it'd be annoying for people if that's required to flash it. I've also made a lot of progress on BLE. I've got multi-protocol BLE and ESB working. Right now I'm using my two Xmega+nRF24 and unifying mouse with a nRF58204-DK relaying the keystrokes/mouse over BLE. The performance seems to be pretty good for the keyboards. You can notice that the latency of the mouse is bit higher, but it's still usable. The main things left to do now are combine the different modes (USB+ESB-rx, BLE+ESB-rx, ESB-tx) so that they will work all together. And there's a couple of things that still don't work over BLE yet (layout updates, mouse pairing). I might start look into making a PCB for an nRF52840 board too. |
@nine-fox 3. The code runs on a few different chips already, so it's modular enough to support both AVR/ARM without too much difficulty. 5. Yeah BLE is more convenient. I'm going to try and support both ESB and BLE since they both have there advantages. Also, in my firmware you can remap the mouse buttons of Logitech Unifying mice like a keyboard with the ESB firmware, so it's nice to have both options. |
That's awesome! Unfortunately I'm super busy with my final semester of uni until mid June, so i won't be able to do much testing until then. The HolyIOT dongle doesn't come with a bootloader, but the casing is easy enough to remove for access to the SWD pins. Obviously this isn't ideal for the average keyboard builder, but I purchased it solely based on the compactness. This gives me more motivation to work on ESB compatibility for my nrf51 keyboard, because I should now have a device that will work with keyplus for testing. How is the current draw over BLE? I've assumed it would be a little too much for the coin cells, so was envisioning a scenario where we could have the split transmitters (esb tx) communicating to PC via nrf52840 (esb rx + USB), with the nrf52840 dongle also able to relay keystrokes to secondary devices over BLE. |
Yeah, BLE+ESB will probably use about ~10mA when it's in use since it needs to leave the RF receiver on to listen for ESB packets. So too much for a coin cell. You could get this lower by using BLE for inter-keyboard communication like I think nine-fox is doing, but I think there'd be some extra complications especially if you have more than 2 devices. Wake-up receivers might allow for a really low power version, but they're still being developed/researched so not viable at the moment. However, they are being considered for WiFi (802.11ba), so they'll probably make their way to Bluetooth chips too. |
the Holyiot store on Aliexpress has some nice compact NRF52840 usb dongles. They also expressed interest in releasing a "nano" version of the dongle if there was enough of an order quantity.
I have bought this dongle and intend to integrate with my mitosis style keyboard and do away with the pro-micro style receiver, and I'd like to contribute to keyplus if development is going to be picked up again.
There are two approaches I see to adding nrf51/nrf52 support. The first would be to use Nordic's ESB libraries - which would allow backwards compatibility with nrf24 based designs. The Nordic SDK has allowed redistribution of SDK files from v12 onward, however, the ESB library is released under a restricted 5-clause BSD license that might not be compatible with the MIT license of this firmware. I'm not sure about the legalities of reverse engineering the protocol and writing our own ESB library.
The other option would be to write a custom link layer via the free nrfx drivers. This would obviously be a lot more work and there would be no backwards compatibility with nrf24 devices.
I have also thought about the BLE implementation (nrf51 peripherals and nrf52/PC host), but my 16kB nrf51 boards do not seem to be enough to run FOSS BLE implementations like mynewt or zephyr for anything but the most basic BLE beacon examples without security. The Nordic s130 softdevice will work with a 16kB nrf51822 and leave enough RAM for a basic application, but the majority of Keyplus would have to be implemented on the central/host side. 32kB devices should have no problem either way.
How should we approach this? It would be simpler to use the Nordic ESB library and softdevices. It would also allow implementation of concurrent ESB and BLE connections. Obviously for the softdevice, people would have to download it from the Nordic website and flash it themselves/copy it into the Keyplus directory. The ESB library should be okay to distribute with the source, provided we can work with the 5-clause Nordic license. Apologies for the large post, just putting my thoughts on this matter down.
The text was updated successfully, but these errors were encountered: