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
  • This is so obvious... I have been closing uart too soon. Still it sends "0x00" at the beginning, which is a bug - works the same for fifo. But the last byte was cut because not "guard" for uart close is done in app_uart_close or my app. I needed to add "tx ready" event in uart_cb and close uart after TX is finished. The "0" at the begining is not an issue form at this moment.

Reply
  • This is so obvious... I have been closing uart too soon. Still it sends "0x00" at the beginning, which is a bug - works the same for fifo. But the last byte was cut because not "guard" for uart close is done in app_uart_close or my app. I needed to add "tx ready" event in uart_cb and close uart after TX is finished. The "0" at the begining is not an issue form at this moment.

Children
No Data
Related