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

NRF52480 Dongle and communication over serial

Experts,

I'm trying to use NRF52480 Dongle to communicate over UART serial port. On the forum I found that pins 1.10 & 1.13 are used for TX/RX. I learned that flow control may be disabled and default speed is 115200 bps. Having this information I compiled and flashed few examples to talk to terminal running in my PC. Unfortunately, all the data sent from NRF52480 Dongle to PC is a garbage. Looks like total misalignment of serial port parameters. 

The only correct result was achieved with examples\ble_central_and_peripheral\experimental\ble_app_interactive, following advices shared here: https://devzone.nordicsemi.com/f/nordic-q-a/43871/ble_app_interactive-code-for-nrf52840-dongle After migration from pce10056 to pce10059 Dongle started reporting to PC terminal (over serial) problem with memory settings. This is the only moment when Dongle correctly transmits data over UART; after fixing memory settings, the program again started transmitting only garbage.

What am I doing wrong?

Could you share exemplary code which writes "Hello world!" to serial port over pins 1.10 & 1.13 to be read by terminal running on PC?

Thanks,
Ryszard

  • For me the examples\peripheral\usbd_cdc_acm demo works on my PCA10056 board.  I can use the UART (on pins 6 and 8) and the USB port, and the CLI works (on the uart interface) and the USB demo also works at the same time. See:

    https://imgur.com/gallery/c4ZbCeZ

    I think you should be able to change main.c, line 227 to match your hardware and test it out:

    static void init_cli(void)
    {
      ret_code_t ret;
      ret = bsp_cli_init(bsp_event_callback);
      APP_ERROR_CHECK(ret);
      nrf_drv_uart_config_t uart_config = NRF_DRV_UART_DEFAULT_CONFIG;
      uart_config.pseltxd = TX_PIN_NUMBER;  // Change this to NRF_GPIO_PIN_MAP(1,10) ?
      uart_config.pselrxd = RX_PIN_NUMBER; // Change this to NRF_GPIO_PIN_MAP(1, 3)  ?
      uart_config.hwfc = NRF_UART_HWFC_DISABLED;
      ret = nrf_cli_init(&m_cli_uart, &uart_config, true, true, NRF_LOG_SEVERITY_INFO);
      APP_ERROR_CHECK(ret);
      ret = nrf_cli_start(&m_cli_uart);
      APP_ERROR_CHECK(ret);
    }

  • If you are using this demo with a dongle and not using jtag, I *think* you will need to change the ORG (start of program space) to 0x1000 (from the default 0x0) so that you can load it with the nRFConnect app using the boot loader.  But someone with more experience with that part of the nordic ecosystem will have to explain it (I am new to the dongles)

  • If you're getting any data in your UART terminal, although scrambled, it's either the baud rate, stop/parity, or HW flow control settings that are wrong. Also, note that your terminal might use auto-settings that incorrectly sets the baud rate for your terminal. 

    I recommend using one of the examples that have been tested for the dongle as a base project, f.ex. the bla_app_blinky or blinky examples.

Related