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

UART FIFO example error

image description

Hi there is a problem in github.com/.../nrf51-UART-examples any one can help?

I put empty loop in main, and comment off all ble related int. and I process uart_evt by putting debug string for APP_UART_DATA_READY: which is generated by interrupt when receives input.

However, when test with one byte it works, can print "UART Debug..." when dealing with multiple bytes. the output corrupts... print "UASta›EmE…ÉсQ MQ¹¹rR"

is there any reason for this?

void uart_evt_callback(app_uart_evt_t * uart_evt) { // if(tflag) // uart_putstring("UART interupt to UART");

switch (uart_evt->evt_type)
{
    case APP_UART_DATA:	
					//Data is ready on the UART					
        break;
					
	case APP_UART_DATA_READY:
        //Data is ready on the UART FIFO   
				//this is called during interrupt FIFO got first byte
				   uart_putstring((const uint8_t *)UART_STRING);
        break;
					
    case APP_UART_TX_EMPTY:  //called in action_tx_stop()
		//Data has been successfully transmitted on the UART
			
        break;
					
    default:
        break;
}

}

Related