2021-01-14 05:38 AM
Hi,
i have a question regarding to the IPCC Communication and the OPENAMP_check_for_message(); function. For example iam sending data from A7 to the M4. So the A7 will cause an RXO Interrupt at the M4. Now my Question ist when this Interrupts is cleared with the TXF Interrupt. Is it straight cleared when the RXO Interrupt occured and the data will only put to a Queue and the Queue of Data is read out via the OPENAMP_check_for_message() Function. Or is it like this that the A7 cant Send Data anymore as long the OPENAMP_check_for_message() didnt get a call, because this Function will trigger the TXF Interrupt.
From my understanding it would be more efficient when the Interrupt is cleared straight and the data is enqueued in a Queue.
2021-01-15 01:41 AM
Hi,
The IPCC is working as a "door" bell to indicate that there is a new message in Virtio ring buffer(Vring). So yes, on RXO interrupt we clear the flag to allow the other core to send a new RXO. The IPCC in not in charge of the Rpmsg itself. This is handled by the RPMsg framework relying on the Virtio.
The vrings are a queue of messages, the size of the Vrings are customizable in the resource table
2021-01-23 05:30 AM
Hi,
first thank you for the answer.
I had a deeper look in the Echo Example with the virtualUART and i made few tests with it to look if the rpmsg framework is stable and it seems to work very good. Iam not loosing any messages, even if i write message from A7 much faster than calling the OpenAMPcheckforMessage() Function. And exactly this makes me a bit confused. In my understanding i can write as much messages as defined in the size of the Queue from vrings (As long Tx Buffer is free). If its not free iam waiting for it that the buffer is freed from the other side or i get an timeout error. This is what i read from the rpmsg_send function.
In the OpenAMPcheckforMessage() Function there is flag which is set as soon i get an Interrupt that a new message is available. And this is my actual question if i call this function and the flag is set, do I only read one buffer out or multiple in the case there are written more buffers, because iam writing faster than iam reading. If iam reading out multiple buffers then i should only transmit the last buffer i read out in the echo example in my understanding.
If i dont procced multiple buffer i should lose buffers in my understanding. If i write for example 5 times and readout only 1 time, i only procced one buffer and the Flag is set to reset so that for another call of the OpenAMPcheckforMessage() function no buffer will be handled.
Iam sorry for this long question, i just try to get the right understanding of procceding the Buffers and how it is managed that i dont lose any buffers.
2021-01-25 12:54 AM
Hi,
When OPENAMP_check_for_message is called with flag set, the OpenAMP lib will process all RPMsg buffers until the vring queue is empty ( see rpmsg_virtio_rx_callback for detail).