I’m confused about how the multi-frame reception works. Specifically what happens if in between two contiguous multi-frame messages with the same CANID (i.e file Write) appears another message with a different CANID ( i.e the heartbeat of another node ). How should I handle the transfer object?
Each RX session holds an independent state which makes the protocol immune to transfer preemption. I don’t think there is any other sensible way to design a real-time protocol, really.
Are you building a custom implementation of a UAVCAN transport?
I’m working with the file write uavcan.file.Write service. It works most of the time, however, the RX session suddenly restarts in between two consecutive messages, so the full payload is never received. The solution is to retry the message a few times or change the Transfer ID, but I don’t understand why.
Make sure the CAN driver does not alter the ordering of the frames. Details here: UAVCAN/CAN: tx buffer management in CAN (FD) controllers
Transfer-ID shall always be different for consecutive transfers. Reusing the same value is an error until the counter is wrapped over.