This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52840 Dongle as ble central device recognized as an HID keyboard

Hello,

I am working on developing a program where the nRF52840 dongle is a central device and recognized as an HID keyboard to the computer.

I played around with the peripheral HID composite example and integrated it into my modified rscs central example. I have modified the rscs central example to be used as cycling cadence instead of running. I have got my entire example working and I am able to send a keyboard up arrow when ever the cadence sensor makes a complete rotation with the bicycle cranks.

I developed this on my nRF52840 DK and now am trying to push it to a dongle.

I followed the directions nRF52840 Dongle Programming Tutorial where it stated for an example with a soft device all I was to do was to change the Preprocessor Definitions to BOARD_PCA10059 instead of  BOARD_PCA10056. I then found out quickly that there was no TX, RX, CTS, or RTS pins mapped on the dongle in pca10059.h.

So I added these definitions:

 

#define RX_PIN_NUMBER  NRF_GPIO_PIN_MAP(0,10)
#define TX_PIN_NUMBER  NRF_GPIO_PIN_MAP(0, 9)
#define CTS_PIN_NUMBER NRF_GPIO_PIN_MAP(0,24)
#define RTS_PIN_NUMBER NRF_GPIO_PIN_MAP(0,22)

My program now compiles and uploads through nRF connect.

The next issue was it seemed as the dongle was getting hung up in executing the code as all LEDs were flashing very fast and were super dim. After some research I found this post. I commented out all the code with INIT_BSP_ASSIGN_RELEASE_ACTION, as I didn't need to use the on board buttons. However, the button is still setup to re-initialize ble advertising. 

Now LD1 flashes like it is advertising and the dongle shows up as an HID keyboard on my computer. But, when my cadence sensor is advertising its UUID the dongle doesn't seem to recognize it. And like I said this program works perfectly on the development kit without the above modifications.

 

In this post the issue was resolved by tying RX pin high. I have tried this but to no success.

Thank you for your assistance!

Parents Reply
  • I never ended up trying your recommendation to attach an external debugger. But, I ran into the same problem again with my program on the Laird dongle which I purchased.

    To fix the probem all I had to do was set "*p_erase_bonds = true" in my function that initializes my buttons and leds instead of "*p_erase_bonds = (startup_event == BSP_EVENT_CLEAR_BONDING_DATA)."

    With that fix, both the nRF52840 Dongle and Laird Connectivity dongle work.

    Thanks for your help.

Children
No Data
Related