UART communication on NRF52840 Dongle

I recently buy a NRF52840 dongle. I quickly find out that UART communication is not accessible by default . How sad ! I wanted to interact with another board trough uart protocol and the dongle is small meaning perfect to do the job. I am really disapointed as I figured out there is no such example in the sdk for the dongle.

I use the SDK version17 with VS Code but without NRF connect for VS code. Does somebody face same problem ? I will have to reallocate the UART pins to makes it works obviously because the default UART pins are connected to LEDS ...   Why ??? 

Parents
  • Hi,

    The nRF52840 Dongle differs from the DK in several ways, most importantly that it does not have an onboard debugger. The debugger is also used as a USB-UART bridge, so this means that it is not possible to demosntrate UART with the dongle by itself, and therefore there are no examples.

    That said, UART works just as well with the dongle as with any other nRF52840 board, you just need to connect the pins ans adjust the configuration accordingly. If you refer to the UART example,  you can see how the pin numbers are provided defines. These does not exits in the board file for the nRF52840 Dongle, but you can replace with your of definitions or simply insert the number of the pins you have chosen.

    Regarding how to adapt the project to the dongle, you can take a look at the nRF52840 Dongle Programming Tutorial (the most important here is to adjust the flash and RAM start addresses).

Reply
  • Hi,

    The nRF52840 Dongle differs from the DK in several ways, most importantly that it does not have an onboard debugger. The debugger is also used as a USB-UART bridge, so this means that it is not possible to demosntrate UART with the dongle by itself, and therefore there are no examples.

    That said, UART works just as well with the dongle as with any other nRF52840 board, you just need to connect the pins ans adjust the configuration accordingly. If you refer to the UART example,  you can see how the pin numbers are provided defines. These does not exits in the board file for the nRF52840 Dongle, but you can replace with your of definitions or simply insert the number of the pins you have chosen.

    Regarding how to adapt the project to the dongle, you can take a look at the nRF52840 Dongle Programming Tutorial (the most important here is to adjust the flash and RAM start addresses).

Children
  • Done ! thanks a lot Einar. It took me some times to figure out that the solution you propose was not working 100% right. I affect Rx to pin 29 and Tx to pin 31. Sending a string with printf will work great, no problem with that. However , If I try to run the UART example, as it is, app uart_get and app_uart_put functions will send me straight to the UART error handler. 

    those lines of code :

    while (app_uart_get(&cr) != NRF_SUCCESS);
    while (app_uart_put(cr) != NRF_SUCCESS);

    Any idea what is happening ? 

Related