This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to use USB in nRF52840 Dongle as UART?

Hi,

I want to develop simple app that receives data via BLE and send it through UART so I could gather them to file or draw a real-time chart in SerialPlot.

As far as I know, the dongle doesn't have debugger that's used in "NRF_LOG" functions' family and UART RX/TX pins aren't connected anywhere outside.

Anyway, there must be some way (nRF Connect programs the dongle somehow). How to do this in my application? Maybe there's some example that I didn't find?

Or maybe some crazy idea - what if I soldered UART's RX/TX to USB's RX/TX?

Parents Reply Children
  • Hi,

     

    Is there a specific reason why you're building from source?

    Precompiled binaries are available here:

    https://github.com/NordicSemiconductor/pc-ble-driver/releases

     

    Kind regards,

    Håkon

  • I wasn't aware of precompiled binaries, because I was on "master" branch, and they are available only in "relase-x.y" ones.
    Anyway, I programmed my dongle with it ("connectivity_4.1.4_usb_with_s140_6.1.1.hex"), and seems that my COM14 has 2 VCOMs - 0 and 1:

    As I expected VCOM1 to be for USB-UART feature, I tried to read data from it, but no matter which baudrate I set, I always receive same sign set (that seems to be some kind of special frame that signals trying to connect somewhere, I guess). I'm kinda confused, because I was pretty sure that Dongle would appear as COM1, not "sub-COM" of COM14.

    And there's another riddle to solve. Well, I see two examples available - the Heart Rate Collector seems to be the one I need (because I want to redirect some data from BLE characteristic to UART, so I just need to simply edit this one). How am I supposed to compile that particular project? If I undertand correctly, GItHub instructions refer to just bare "pc-ble-driver" compilation.

    In my opinion, all that "pc-ble-driver" stuff is kinda chaotic or just not described simple enough, that makes me spend much time understanding what this thing is, how works, and how to use it for my own project. In perfect world, I would make no forum thread for it, and just be satisfied with instructions. But maybe I'm the one who's not as clever as most of Nordic's users :D 

  • Hi,

     

    Kubek said:
    How am I supposed to compile that particular project? If I undertand correctly, GItHub instructions refer to just bare "pc-ble-driver" compilation.

    My apologies, you're right, this was a behavior change when we introduced usage of vcpkg. we do not have examples on how to link in with precompiled libs. For building on windows, you need quite a lot of deps sorted out, as described here:

    https://github.com/NordicSemiconductor/pc-ble-driver#installing-dependencies-on-windows

    https://github.com/NordicSemiconductor/pc-ble-driver#compiling-pc-ble-driver-on-windows

     

    On linux, you need to install these deps:

    https://github.com/NordicSemiconductor/pc-ble-driver#compiling-pc-ble-driver-on-ubuntu-linux-or-macos

     

    Alternatively, you can omit using vcpkg and install the deps via apt:

    apt install libasio-dev libspdlog-dev catch2 cmake build-essential

     

    An alternative can also be to use pc-ble-driver-py or pc-ble-driver-js.

     

    Kubek said:
    In my opinion, all that "pc-ble-driver" stuff is kinda chaotic or just not described simple enough, that makes me spend much time understanding what this thing is, how works, and how to use it for my own project. In perfect world, I would make no forum thread for it, and just be satisfied with instructions.

    I agree with you that we can definitely improve in this matter. I'll have a chat with the team related to this topic.

     

    Kind regards,

    Håkon

Related