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

app_uart getting started

I've modified the simple_uart example to use app_uart instead but I cannot get any data transmitting. I know the connections are correct because it works fine under normal simple_uart testing.

Here is my init code which also sends a character and a string. When I debug it always makes it through to NRF_SUCCESS case, but never transmits 'T'

uart_buffers.rx_buf = rx_buffer;
uart_buffers.rx_buf_size = sizeof(rx_buffer);
uart_buffers.tx_buf = tx_buffer;
uart_buffers.tx_buf_size = sizeof(tx_buffer);

comm_params.rx_pin_no = rxd_pin_number;
comm_params.tx_pin_no = txd_pin_number;
comm_params.cts_pin_no = cts_pin_number;
comm_params.rts_pin_no = rts_pin_number;
comm_params.baud_rate = 9600;
comm_params.use_parity = false;
comm_params.flow_control = APP_UART_FLOW_CONTROL_DISABLED;

uint32_t res = app_uart_init(&comm_params, &uart_buffers, &app_uart_handler, APP_IRQ_PRIORITY_HIGH, comm_uuid);

if(res == NRF_SUCCESS)
{
	app_uart_put('T');
	simple_uart_putstring("Test 1\r\n");
	return;
}
Parents
  • Has anyone had trouble with app_uart in 5.1.0? My app craps out with the first call to app_uart_put.

    By the way, my favorite Nordic #define is officially UART_BAUDRATE_BAUDRATE_Baud38400

    From the ministry of redundancy ministry... :-)

  • I definitely agree that it's funny, I just wanted to point out that there is a reason it's the way it is. :)

    I don't really have any great suggestions for you, but I'd recommend you to verify that you don't end up in app_error_handler or in the HardFault_Handler.

    Anyway, it really sounds to me as if this is an unrelated problem to the original here, so if you could post a question with this separately, I'd be happy to take a look. If you could supply the complete project you're working with, that would make it easy for me to try reproducing your problem.

Reply
  • I definitely agree that it's funny, I just wanted to point out that there is a reason it's the way it is. :)

    I don't really have any great suggestions for you, but I'd recommend you to verify that you don't end up in app_error_handler or in the HardFault_Handler.

    Anyway, it really sounds to me as if this is an unrelated problem to the original here, so if you could post a question with this separately, I'd be happy to take a look. If you could supply the complete project you're working with, that would make it easy for me to try reproducing your problem.

Children
No Data
Related