This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

UART priority

Hello, I am facing many communication error with code 1 when using the UART. Everything is working fine until my client reads long characteristics (in my case it is about 110 bytes long) from the server. The read is fine on the Soft device side but on the server side that is streaming on the uart, I get those com errors. If I understand correctly, this error code means that I don't consume the bytes fast enough. As I use a quite long FIFO of 512 and my UART frames are 102 bytes, I guess, the error code comes from the hardware block so the fifo implementation is useless. (I use the app_uart_fifo.c code) I tried to use higher interrupt priority in the APP_UART_FIFO_INIT but this completely prevents the soft device to operate correctly (this is strange because the priority levels that are defined seem to allow SD coexistence).

What I alos notice is that the APP_UART_TX_EMPTY is fired twice each time I use the dus_data_handler to send my 102 bytes : for (i = 0; i < length; i++) { while(app_uart_put(p_data[i]) != NRF_SUCCESS); }

Is it normal to get those 2 events ? Is it normal to have issues when serving long charactersitics on the BLE ? Is there a way to monitor such reads so that I can handle it in my state machine. Is it normal that other IRQ priorities than LOW prevent correct operation ?

I use 57600 bauds, soft device 130 2.0.0 in SDK11 with nRF51422

Thanks for your help.

Parents
  • I will check deeper the priority thing, thanks for the link. I have no control over the other device and baudrate choice. I can afford loosing data as far as my state machine flags it, but of course, this may affect my overall system performance. However, I have not flagged in my handler that I do some bytewise treatment, not much heavy but with a few function jumps to my state machine. I have to check whether this is a problem or not while this handler has low priority regarding soft device. On the SD side, I also have some memcopies to the characteristic, and maybe the lack of performance comes from here rather than on the long read. In any case, if I can overcome this issue, and when I have checked that my code path are not too heavy, this is not a good sign for the performance of my system that should support more traffic in the future. I must say I also have TWI, with another device, so I am afraid I will get such problems as well.

Reply
  • I will check deeper the priority thing, thanks for the link. I have no control over the other device and baudrate choice. I can afford loosing data as far as my state machine flags it, but of course, this may affect my overall system performance. However, I have not flagged in my handler that I do some bytewise treatment, not much heavy but with a few function jumps to my state machine. I have to check whether this is a problem or not while this handler has low priority regarding soft device. On the SD side, I also have some memcopies to the characteristic, and maybe the lack of performance comes from here rather than on the long read. In any case, if I can overcome this issue, and when I have checked that my code path are not too heavy, this is not a good sign for the performance of my system that should support more traffic in the future. I must say I also have TWI, with another device, so I am afraid I will get such problems as well.

Children
No Data
Related