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

UART problem. Always reboot system.

Hi!

I have a problem with UART. SDK15. S132 6.0, nRF52832

I added UART to my project and watching strange behavior: when I attempt to send anything to UART

	for (uint32_t i = 0; i < length; i++)
		while(app_uart_put(p_data[i]) != NRF_SUCCESS);

project reboots.

I see that problem in a nrfx_uart.c file in the string 318:

while (!nrf_uart_event_check(p_instance->p_reg, NRF_UART_EVENT_TXDRDY))

always in cycle while. After that I have reboot.

What possible reason?

init code:

void uart_init(void)
{
	uint32_t err_code;
    const app_uart_comm_params_t comm_params =
    {
        RX_PIN_NUMBER,
        TX_PIN_NUMBER,
        RTS_PIN_NUMBER,
        CTS_PIN_NUMBER,
        APP_UART_FLOW_CONTROL_ENABLED,
        false,
        UART_BAUDRATE_BAUDRATE_Baud38400
    };

    APP_UART_FIFO_INIT(&comm_params,
                       UART_RX_BUF_SIZE,
                       UART_TX_BUF_SIZE,
                       uart_event_handler,
                       APP_IRQ_PRIORITY_LOWEST,
                       err_code);
    APP_ERROR_CHECK(err_code);
}

Parents
  • Hello,

    Do you have logging enabled in your project? Can you try to add "DEBUG" to your preprocessor defines? The application doesn't restart by itself, so my bet is that you are hitting the error handler, which causes a reboot. Adding DEBUG to your preprocessor defines tells the nRF to log the cause of the issue before it reboots.

    is NRF_LOG_ENABLED defined to 1 in sdk_config?

    Best regards,

    Edvin

Reply
  • Hello,

    Do you have logging enabled in your project? Can you try to add "DEBUG" to your preprocessor defines? The application doesn't restart by itself, so my bet is that you are hitting the error handler, which causes a reboot. Adding DEBUG to your preprocessor defines tells the nRF to log the cause of the issue before it reboots.

    is NRF_LOG_ENABLED defined to 1 in sdk_config?

    Best regards,

    Edvin

Children
Related