I'm trying to enable the UART module. The function calls follow:
nrf_init -> nrf_drv_uart_init -> nrfx_uart_init
Here we see that nrfx_uart_init() is called with
result = nrfx_uart_init(&p_instance->uart, │ rx_secondary_buffer_length = 0,
(nrfx_uart_config_t const *)&config, │ tx_counter = 0,
event_handler ? uart_evt_handler : NULL);
With nrf_drv_uart_t m_uart = NRF_DRV_UART_INSTANCE(0); Note that in this macro inst_idx is set to 0. However, later on this field is not used, but uart->drv_inst_idx.
In nrfx_uart_init the id for p_instance->drv_inst_idx is not 0 however.
uart_control_block_t * p_cb = &m_cb[p_instance->drv_inst_idx];
This means that not m_cb[0] is used, but something irrelevant (it's here a CONCAT3 resulting in NRFX_UART0_INST_IDX). Is it not the idea to use?
uart_control_block_t * p_cb = &m_cb[*(int*)p_config->p_context];
Why else is inst_idx first placed into the p_context field?