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

Serial port on the nRF52840 Dongle

Hi I am trying to init the serial on the nRF52840 Dongle but there are some defines missing in the boards/pca10069.h

I run this on the nRF52840 DK and it works fine.

NRF_SERIAL_DRV_UART_CONFIG_DEF(m_uart0_drv_config,
    RX_PIN_NUMBER, TX_PIN_NUMBER,
    RTS_PIN_NUMBER, CTS_PIN_NUMBER,
    NRF_UART_HWFC_ENABLED, NRF_UART_PARITY_EXCLUDED,
    NRF_UART_BAUDRATE_115200,
    UART_DEFAULT_CONFIG_IRQ_PRIORITY);

file: boards/pca10056.h

#define RX_PIN_NUMBER  8
#define TX_PIN_NUMBER  6
#define CTS_PIN_NUMBER 7
#define RTS_PIN_NUMBER 5
#define HWFC           true

Parents
  • Hi,

    There is no UART to USB bridge on the nRF52840 Dongle (the Segger debugger chip is used for that on the Development Kits), and therefore there is no default UART pins. 

    You can use any pins for the UART peripheral, but it is recommended to stay away from the pins marked "low frequency I/O only" in the ball assignment documentation.

    Also make sure that you choose some pins that is not used by other peripherals/components on the dongle, for instance P0.06 and P0.08 is used for LEDs.

    If you are communicating with a PC, you can also setup the dongle with USB CDC ACM to send data through virtual USB COM port. There is an example available in the SDK.

    Best regards,
    Jørgen

  • Hi,

    I'm interested in doing something similar to the original question here with an nRF52840 Dongle where I'd like to stream data over the dongle's USB connection and read it from a computer via /dev/ttyACMx. I've tried to compile the usbd_cdc_acm example to use as a template but it seems to rely on TX_PIN_NUMBER and RX_PIN_NUMBER constants that aren't defined for pca10059.

    Is this kind of setup possible with pca10059? Is usbd_cdc_acm the right example to use (it doesn't have a pca10059 subfolder)?

  • This works for both my dev board and the dongle.

  • Hey Jimmy,

    I'm trying to run this sample on a nr52840 dongle, and I can't seem to find a definition for the rts struct. Any chance you'd know?

  • The struct is not part of Nordic SDK its part of our source. 

    typedef struct serial_command_hdr
    {
        zb_uint16_t size;
        zb_uint8_t command; // serial_command_t
    } serial_command_hdr_t;

  • Running into something similar on the cb_command_handler/cb_port_status_handler. If this is part of a larger framework, let me know.

  • typedef void (*cb_command_handler)(char*);
    void serial_set_command_handler(cb_command_handler cb);
    typedef void (*cb_port_status_handler)(bool);
    void serial_set_port_status_handler(cb_port_status_handler cb);

    -----

    void handle_serial_command(char *tmp)
    {
        serial_command_hdr_t *hdr = (serial_command_hdr_t *)tmp;

Reply
  • typedef void (*cb_command_handler)(char*);
    void serial_set_command_handler(cb_command_handler cb);
    typedef void (*cb_port_status_handler)(bool);
    void serial_set_port_status_handler(cb_port_status_handler cb);

    -----

    void handle_serial_command(char *tmp)
    {
        serial_command_hdr_t *hdr = (serial_command_hdr_t *)tmp;

Children
No Data