I'm using several TX buffers to send bursts of CAN messages. The messages are being sent to the bus and the TXBTO bits are being set accordingly to the used TX buffer. The problem is in the number of generated Transmit Complete interrupts. If 3 messages are sent "simultaneously" it will generate just one TC interrupt and it completely breaks the SDK mcan behaviour (one buffer will be marked as free and the other two will be forever busy, unless something looks to the TXBTO and clear the busy buffers.)
So, is it supposed to have an interrupt per sent message or shall I look to the TXBTO every time I get a TC interrupt?
And by the way, I think there is a bug in here:
void MCAN_TransferAbortSend(CAN_Type *base, mcan_handle_t *handle, uint8_t bufferIdx)
/* Assertion. */
assert(bufferIdx <= 63U);
/* Disable Buffer Interrupt. */
/* Cancel send request. */
/* Un-register handle. */
handle->bufferFrameBuf[bufferIdx] = 0x0;
handle->bufferState[bufferIdx] = kMCAN_StateIdle;
When using more than one TX buffer, the first TC interrupt will disable the TC interrupts (MCAN_DisableInterrupts(base, CAN_IE_TCE_MASK)) and the remaining transmit buffers will not get their interrupts being generated.
MCAN driver version 2.0.1