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

UARTE lost a byte after uarte disable and enable again.

Hi,all~

uint32_t drv_uart_enable(  )
{
	nrf_uarte_enable( NRF_UARTE0 );
	return NRF_SUCCESS;
}


uint32_t drv_uart_disable(  )
{
	nrf_uarte_disable( NRF_UARTE0 );
	return NRF_SUCCESS;
}

void gpio_evt_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{
    switch (pin_no)
    {
        case   PIN_NRF_SLEEP:
        {
            if(! nrf_gpio_pin_read(PIN_NRF_SLEEP) )
            {
                drv_uart_enable();
                app_master_led_state_change(LED_ON);
            }else{
                drv_uart_disable();
                app_master_led_state_change(LED_OFF);
            }
        }
        default:
            break;
    }
}

The program runs on nRF52833.The SDK version is NRF5_SDK_17.0.2_D674DDE. At the beginning, MCU sends data to nRF52833 through serial port, and the data can be received correctly(see pic one). When I use THE GPIO control module to disable and enable the serial port again(see code), the MCU is sending data, you can see that the UARTE0 register is missing the seventh byte of data(see pic two). What causes this???

pic one:

pic two:

MCU send log:

Thank you at all~

Related