ECOM disabling interrupts

Hello,

I have a question about ECOM-Comm. In TLT-0652 figure 3.1, it shows the expected output:

LLCOMM_BUFFERED_CONNECTION_IMPL_enableRXDeviceInterrupt
Simulating RX interrupt for port 1
[LOG] Read data: A
LLCOMM_BUFFERED_CONNECTION_IMPL_disableRXDeviceInterrupt
LLCOMM_BUFFERED_CONNECTION_IMPL_enableRXDeviceInterrupt
Simulating RX interrupt for port 1
[LOG] Read data: B
LLCOMM_BUFFERED_CONNECTION_IMPL_disableRXDeviceInterrupt
  1. Why is the interrupt disabled on receiving a byte? There is a buffer that can store additional bytes.
  2. I believe this is causing dropped bytes in our application when data is transferred at a high rate. Is there a way to guarantee Rx data won’t be missed?

Lyle

Hi Lyle,

The interrupt is disabled because we need to synchronize with the Virtual Machine that is reading the circular buffer populated when the Rx interrupt occurs. We can buffer more than one byte. It is indeed a simple implementation and it can drop bytes. In order to have data assurance on the link you need to use flow control on the UART (usually at the expense of speed).

What is your use case so that I understand more of the context, because the implementation we are talking about here is good enough up to 115200. Do you want to go further?

Gaëtan

Hello Gaëtan,

For our application:

  • We have several UARTs that operate at different speeds, commonly 115,200.
  • Custom sandboxed apps may need higher baud rates.
  • We do not have flow control on most UARTs.

Would using LLCOMM_CUSTOM_CONNECTION make any difference?

Could we buffer the data in our own queues, and push the Rx data to the VM using disableRXDeviceInterrupt and enableRXDeviceInterrupt as signals for when the VM will accept data?

Thank you,
Lyle

Yes you could with a custom connection implement a double-buffered UART or use a circular buffer without a critical section that would allow performance to be better (but keep in mind you cannot ensure that the data will be read once the buffer is full, causing bytes to also be dropped). I will see if we did something like that already.

Gaëtan

Thank you, Gaëtan. That would be an acceptable solution for us. If the buffer is full, it is okay to lose data. We just don’t want to lose data before the buffer is full.
Lyle