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?

  • Hi

    Please check out this thread, which has quite a few suggestions on how you can use the nRF52 Dongle as a serial port.

    Best regards,

    Simon

  • I tried it on Windows 10 - it's just a one big trouble generator, so I tried to do this on Ubuntu 20.04.



    Once I tried to:

    cmake -G Ninja .. 

    An error occurs:

    So I tried to install Ninja (because some Stack Overflow thread claimed that might be reason):

    sudo apt install ninja-build

    After this, I tried again to cmake:

    cmake -G Ninja .. 

    But yet another complex error occured:

    What might be the reason? I don't want to randomly follow each possible forum's tips, because I'm under impression it's gonna just mix everything up. Anyway I tried once, and it didn't help. I thought everything is gonna work fine if only I had followed the steps.

  • Anyway I tried it my way - to install some things according to tips from forums. Then occured an error: 
    I fixed it with: (because there was a Python script with no .py extension).

    /bin$ sudo cp run-clang-tidy run-clang-tidy.py

    But these were another files: run-clang-tidy-10 and run-clang-tidy-10.py. Maybe they were proper ones because another error occured:

    Maybe I should rather replace it with this file: 

    https://github.com/llvm-mirror/clang-tools-extra/blob/master/clang-tidy/tool/run-clang-tidy.py

    Anyway, problem seems to be with no ASIO_INCLUDE_DIR. 

  • 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 

Related