Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

app_uart_put() dropping some packets of data on UART

I am working on a project where we are using a nordic bluetooth chip and connecting it to a RS485 Bus using UART with Baudrate 115200. The messages sent from the Bluetooth App should be assembled in the BUS message and should be sent using UART. For this purpose I am using app_uart_fifo.c with the TX_BUFFER_SIZE and RX_BUFFER_SIZE of 1024.

The problem is that I have to send 16 Bytes of data for every Message Frame and as I have checked with the Oscilloscope, there have been only 12 Bytes being sent by the UART Tx channel.

In order to find the problem, I have simply taken the UART example project from Nordic SDK 13.0 version and implemented the example project with a small change. That is, whenever I send anything on Rx characteristic of the nordic nus service, 16 Bytes should be sent on the UART Tx line. To my surprise, it was sending only 12 or 13 bytes everytime I try to send 16 bytes.

Even though the FIFO is 256 Bytes large, why are the Bytes at the end i.e from 13 to 16 being missed. The Baudrate in the example is also set at 115200.

If your Suggestion is to increase the Baud rate, unfortunately I can't because the RS485 Bus is operated at 115200 and supposed to send data at the same speed.

I am literally stuck with this problem and unable to continue with my project. Any Suggestions would be of great help.

Thanks and regards,

Kumar

Parents Reply
  • Hello Kenneth,

    Thankyou for your Reply! I found the problem. It lies somewhere else. I have ben using two timers with different timings to generate events on the same hardware pin. The second timer event seemed to disturb the first timer event, thereby distorting my UART tx channel on this common pin. I now have a single timer event for both the cases so that the timer is started at different instances of time.

    Regards,

    Kumar

Children
No Data
Related