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

UART not working in debug mode

Hi. I'm currently working on a project using nrfx_uart driver. I'm using the project template for SES provided in the examples folder. 

My Issue is that my code only works properly when i use the "Build and run mode" instead of "Build and debug". I'm tracing the UART event handler function when the tx is done. In debug mode it doesn't print anything. Is this any debug configuration error? Here its my UART config code and the event handler function.

Note: I've disabled app_uart in sdk_config.h file.

nrfx_uart_t huart1;

void uart_event_handler(nrfx_uart_event_t * p_event, void* p_context){
      switch (p_event->type)
    {
        case NRFX_UART_EVT_TX_DONE:
          SEGGER_RTT_WriteString(0, "UART TX DONE");
        default:
            break;
    }
}
void config_uart()
{
        nrfx_err_t err;
	nrfx_uart_config_t huart1_config = NRFX_UART_DEFAULT_CONFIG;

	huart1_config.pseltxd = NRF_GPIO_PIN_MAP(1, 2);
	huart1_config.pselrxd = NRF_GPIO_PIN_MAP(1, 1);

	huart1_config.hwfc = NRF_UART_HWFC_DISABLED;
	huart1_config.parity = NRF_UART_PARITY_EXCLUDED;
	huart1_config.baudrate = NRF_UART_BAUDRATE_9600;
	huart1_config.interrupt_priority = 7;
        huart1.p_reg = NRFX_CONCAT_2(NRF_UART, 0);             
        huart1.drv_inst_idx = NRFX_CONCAT_3(NRFX_UART, 0, _INST_IDX);
	err = nrfx_uart_init(&huart1, &huart1_config, uart_event_handler);

}

Thanks for your help

Related