Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Missing serial port library on sdk 17.0.2

Hello everyone,

i would like to update the sdk of an existing project from 15.3 to the newest 17.0.2. I am developing for the NRF52840.

I am using the serial port library with these macros:

NRF_SERIAL_DRV_UART_CONFIG_DEF(m_uarte0_drv_config,
    NRF_GPIO_PIN_MAP(0, 24), NRF_GPIO_PIN_MAP(0, 22),
    RTS_PIN_NUMBER, CTS_PIN_NUMBER,
    NRF_UART_HWFC_DISABLED, NRF_UART_PARITY_EXCLUDED,
    NRF_UART_BAUDRATE_38400,
    UART_DEFAULT_CONFIG_IRQ_PRIORITY);

NRF_SERIAL_DRV_UART_CONFIG_DEF(m_uarte1_drv_config,
    NRF_GPIO_PIN_MAP(0, 15), NRF_GPIO_PIN_MAP(0, 17),
    RTS_PIN_NUMBER, CTS_PIN_NUMBER,
    NRF_UART_HWFC_DISABLED, NRF_UART_PARITY_EXCLUDED,
    NRF_UART_BAUDRATE_38400,
    UART_DEFAULT_CONFIG_IRQ_PRIORITY);

#define SERIAL_FIFO_TX_SIZE 1024
#define SERIAL_FIFO_RX_SIZE 1024

NRF_SERIAL_QUEUES_DEF(serial0_queues, SERIAL_FIFO_TX_SIZE, SERIAL_FIFO_RX_SIZE);
NRF_SERIAL_QUEUES_DEF(serial1_queues, SERIAL_FIFO_TX_SIZE, SERIAL_FIFO_RX_SIZE);

#define SERIAL_BUFF_TX_SIZE 1
#define SERIAL_BUFF_RX_SIZE 1

NRF_SERIAL_BUFFERS_DEF(serial0_buffs, SERIAL_BUFF_TX_SIZE, SERIAL_BUFF_RX_SIZE);
NRF_SERIAL_BUFFERS_DEF(serial1_buffs, SERIAL_BUFF_TX_SIZE, SERIAL_BUFF_RX_SIZE);

void My_cdc_acm_user_ev_handler_UART0(app_usbd_class_inst_t const *p_inst,
    nrfx_uarte_event_t event);

void My_cdc_acm_user_ev_handler_UART1(app_usbd_class_inst_t const *p_inst,
    nrfx_uarte_event_t event);

NRF_SERIAL_CONFIG_DEF(serial0_config, NRF_SERIAL_MODE_DMA,
    &serial0_queues, &serial0_buffs, My_cdc_acm_user_ev_handler_UART0, sleep_handler);

NRF_SERIAL_CONFIG_DEF(serial1_config, NRF_SERIAL_MODE_DMA,
    &serial1_queues, &serial1_buffs, My_cdc_acm_user_ev_handler_UART1, sleep_handler);

NRF_SERIAL_UART_DEF(serial0_uarte, 0);
NRF_SERIAL_UART_DEF(serial1_uarte, 1);

It seems that in sdk 17.0.2 they are no longer available? I did not find the serial port library in the 17.0.2 documentation anymore but no hint why or what the official replacement would be...

Can anyone give me a hint?

Update: With this macros I am able to use two UARTS...

Thanks!

Andreas

  • Hi,

    The serial library was "replaced" with libuarte, which is a better solution. For instance serial library does not handle uart errors well, you would need to re-init the serial library on uart errors. That said, if you are familiar and have good experience with serial library, then there should be no problem to take the implementation from older nRF5 SDK and use it in the latest.

    Kenneth

Related