Hi.
Here’s the scenario - I need to synchronize the clocks on multiple nodes on a CAN bus. The uavcan.time.Synchronization protocol looks like the right approach.
To implement the protocol, it is necessary to determine precisely when the time master’s sync message has been delivered to the bus. Using a SPI-connected CAN controller downstream of a buffered SPI controller, the only practical way to do this is via an interrupt that is raised when the CAN controller has finished sending the message.
But I only really want this interrupt to occur for uavcan.time.Synchronization messages - that way I can use the interrupt signal itself to latch a counter that is keeping track of system time - no software latency involved. The good news is that the Microchip MCP2518FD I’m using has 32 FIFOs that can be configured individually as TX or RX buffers, and each buffer’s priority and interrupt sources can be selected, as well.
If I designate one FIFO as a highest-priority TX FIFO, and enable the “TX buffer empty” interrupt for only that FIFO, I have exactly the setup I need.
Except that when I pop a frame out of UAVCAN (in the form of libcanard), the information that this is a uavcan.time.Synchronization message has been obscured, and I don’t know to which FIFO to send it. I can of course parse the “extended id” to extract the message priority, but that relies on non-public features of the protocol.
Is there a better way to do this?
Thanks,
-Nick