MCAN message buffering
Posted: Mon May 31, 2021 5:02 am
Hi,
I am using the MODM7AE70 and try to understand how MCAN message buffering actually works with the Netburner API.
Regarding message reception, this part of the Simple CAN example code makes the RTOS block and wait for a new CAN message:
It passes a reference to a CanFifo which seems to be an RTOS object and is defined as:
But I don't find the size of this FIFO defined anywhere. So how does this work? Or is it somehow referring to the hardware FIFO of the CAN controller? Sorry, I am confused as I don't understand if incoming messages are already buffered and how deep the buffer is.
BTW, what is exactly the difference between a FIFO and a Queue in NBRTOS? It is not clear to me where to use which.
Regarding sending CAN messages this looks like this:
As far as I understand this is not buffering anything but uses busy polling until there is room for the message to send. Is this correct?
Thanks in advance,
Anguel
I am using the MODM7AE70 and try to understand how MCAN message buffering actually works with the Netburner API.
Regarding message reception, this part of the Simple CAN example code makes the RTOS block and wait for a new CAN message:
Code: Select all
CanRxMessage can_msg(&CanFifo);
Code: Select all
OS_FIFO CanFifo;
BTW, what is exactly the difference between a FIFO and a Queue in NBRTOS? It is not clear to me where to use which.
Regarding sending CAN messages this looks like this:
Code: Select all
mcan_instance.send_message(ExtToNbId(0x1234), (uint8_t *) "ETESTR", 6);
Thanks in advance,
Anguel