I am trying to implement a simple uart echo test using nRF21540 DB board, but I always get NRFX_ERROR_FORBIDDEN when trying to transmit.
This is the initialization code:
nrfx_uarte_t uarteInstance = NRFX_UARTE_INSTANCE( 1 );
uarteConfig.pseltxd = nRF52Host_TX_DBG;
uarteConfig.pselrxd = nRF52Host_RX_DBG;
uarteConfig.pselcts = NRF_UARTE_PSEL_DISCONNECTED;
uarteConfig.pselrts = NRF_UARTE_PSEL_DISCONNECTED;
uarteConfig.p_context = NULL;
uarteConfig.baudrate = NRF_UARTE_BAUDRATE_9600;
uarteConfig.interrupt_priority = NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY;
uarteConfig.hal_cfg.hwfc = NRF_UARTE_HWFC_DISABLED;
uarteConfig.hal_cfg.parity = NRF_UARTE_PARITY_EXCLUDED;
uarteConfig.hal_cfg.stop = NRF_UARTE_STOP_ONE;
uarteConfig.skip_gpio_cfg = false;
uarteConfig.skip_psel_cfg = false;
if (nrfx_uarte_init(&uarteInstance, &uarteConfig, NULL) == NRFX_SUCCESS)
{
printf("success\r\n");
}
then trying to transmit using this call, is always returning error:
static uint8_t test_bytes[4] = {0xA5, 0xA6, 0xA7, 0xA8};
nrfx_uarte_tx(&uarteInstance, test_bytes, 4);
Is there some configuration I am missing?