Hi
nrf52833 SDK16
The following code works fine on UART 0 but not on UART 1
nrf_drv_uart_t SER_UART = NRF_DRV_UART_INSTANCE(1); nrf_drv_uart_config_t config = NRF_DRV_UART_DEFAULT_CONFIG; config.baudrate = 1200; config.hwfc = NRF_UART_HWFC_DISABLED; config.interrupt_priority = APP_IRQ_PRIORITY_HIGH; config.parity = NRF_UART_PARITY_EXCLUDED; config.pselrxd = IO_UART_RX; config.pseltxd = IO_UART_TX; APP_ERROR_CHECK(nrf_drv_uart_init(&SER_UART, &config, SER_UART_Interrupt));
The problem seems to come from nrfx_uart.c
#if NRFX_CHECK(NRFX_PRS_ENABLED) static nrfx_irq_handler_t const irq_handlers[NRFX_UART_ENABLED_COUNT] = { #if NRFX_CHECK(NRFX_UART0_ENABLED) nrfx_uart_0_irq_handler, #endif }; if (nrfx_prs_acquire(p_instance->p_reg, irq_handlers[p_instance->drv_inst_idx]) != NRFX_SUCCESS) { err_code = NRFX_ERROR_BUSY; NRFX_LOG_WARNING("Function: %s, error code: %s.", __func__, NRFX_LOG_ERROR_STRING_GET(err_code)); return err_code; } #endif // NRFX_CHECK(NRFX_PRS_ENABLED)
There is no support for a UART1, so nrf_prs_acquire() will fail on the
NRFX_ASSERT(p_base_addr);
Also nrf_uart.c lacks support for uart 1 in the irq_handler section:
#if NRFX_CHECK(NRFX_UART0_ENABLED) void nrfx_uart_0_irq_handler(void) { uart_irq_handler(NRF_UART0, &m_cb[NRFX_UART0_INST_IDX]); } #endif
How am I meant to get two uarts working with this part? id nrfx a bad option?
Many thanks