The previous version made me come a little bit further, however it will still stop, but for another reason. Maybe the last change will fix that?
I seems my problem now has to do with the queue. The queue is shared between both CAN-busses: Can1 (500kbit) and can2 (100kbit).
The RxCallback sometimes handles multiple can-frames from can2 in one «queue»-entry. Which means it can take quite a long time to finish. At that time the much faster can1 fills the rest of the queue. At the next interrupt, the queue is full and the RxCallback on can2 won’t be called.
The flags on mcp2515 won’t be cleared and no more interrupts will occur.
I wonder if we should have one queue per can and in CAN_rxtask we could check m_rxqueue1, m_rxqueue2 and m_rxqueue in a round robin fashion.
I think it is quick to test, so if your latest changes won’t fix this, I will try with separate queues.
Geir