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

SDK12 app_uart.c issue

Hi, I have such code:

static buf[9] = {initializers};
for(i =0;i <9;i++){
		while(app_uart_put(buf[i]));
}

I always get "0" before the actual buf content and the last byte isn't sent; In need to add manually:

while(app_uart_put(buf[8]));

to print out the last byte.

If I repeat the loop - printouts will start with the last byte from the first loop and again the last byte won't be sent.

Is this a bug or I don't understand how does this f-n work?

regards

Parents
  • I use SDK12_145cde0, no fifo (I'll try today). UART: 19200, no parity, flow control disabled. I use also SoftDevice and this function is called between APP timer init and StackBLE init.

    My whole function is like this (RTT3 is dbg over SWD, doesn't change anything):

    APP_UART_INIT(&comm_params, uart_cb, APP_IRQ_PRIORITY_LOW, err_code);
    RTT3("Frame:");
    for(i =0;i <9;i++){
    		RTT3("0x%02X ",frame[i]);
    		while(app_uart_put(frame[i]));
    }
        //workaround
    while(app_uart_put(frame[8]));
    app_uart_close();
    
Reply
  • I use SDK12_145cde0, no fifo (I'll try today). UART: 19200, no parity, flow control disabled. I use also SoftDevice and this function is called between APP timer init and StackBLE init.

    My whole function is like this (RTT3 is dbg over SWD, doesn't change anything):

    APP_UART_INIT(&comm_params, uart_cb, APP_IRQ_PRIORITY_LOW, err_code);
    RTT3("Frame:");
    for(i =0;i <9;i++){
    		RTT3("0x%02X ",frame[i]);
    		while(app_uart_put(frame[i]));
    }
        //workaround
    while(app_uart_put(frame[8]));
    app_uart_close();
    
Children
No Data
Related