How to use NUS samples with 52840 dongle?

Hello.

I'd like to use NUS shell to implement a simple UART bridge between an app running on my pc (with a connected nrf52840 dongle) and another nrf52840 dongle (let's call it target). I've read through the docs and it's unclear to me which sample app to load onto the dongles or how this should work.

For the target side, I build NRF Connect 2.6.1, nrf/samples/bluetooth/peripheral_uart, configured for 52840dongle, loaded it onto the dongle with the stand-alone programmer and powered on.

For the PC side, I built NRF Connect 2.6.1, nrf/samples/bluetooth/shell_bt_nus, configured for 52840dongle, loaded it onto the dongle with the stand-alone programmer. I see a green and blue led. Running bt_nus_shell.py --com COM13 and connecting Putty to 127.0.0.1:8889 leads to the following:

Socket created
Socket bind complete
Socket now listening
Successfully opened COM13. Baud rate: 1000000. Flow control: none. Parity: none.
Starting BLESerial failed. Error: Failed to open. Error code: NRF_ERROR_TIMEOUT
SOCKET CLOSED

Am I running the correct sample apps?

I read somewhere that the apps will automatically connect to each other. Is that true? If not, how do I make them connect?

I don't have the JTAG connector yet, so RTT isn't going to help. I tried to enabled LOG_BACKEND_UART and gathering log data from the physical UART like I did with the v17.1 SDK, but there is something wrong with the configuration preventing it from being enabled.

What am I missing? I had assumed this would be fairly straight forward.

Thanks,

Chris

  • A little more info. Target seems to be running. When I attach putty to the usb/serial port, I get the full shell cli. 

    I added more debug info to bt_nus_shell.py. It fails self.adapter.driver.open() with Starting BLESerial failed. Error: Failed to open. Error code: NRF_ERROR_TIMEOUT.

    Another question: it looks like bt_nus_shell.py will automatically upload firmware if you provide the Segger handle, etc. Which firmware is it uploading?

  • Hi Chris

    I think the connectivity_bridge sample might be a better place to start in this case. This project allows you to use the nRF52840 as a CDC to UART bridge, which sounds like what you are trying to do. 

    Please note it is only officially supported for the thingy91_nrf52840 board, but it should be relatively easy to adapt to run on the 52840 dongle instead. 

    Best regards
    Torbjørn

Related