This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software:
Dear,
I'm sending consequently 3 messages to MCAN using the following code.
When I step through it, all 3 messages appear on the CAN bus.
When is it running (short time between calling this routing), only one meassage is appearing on the CAN bus.
I tried several things like checking if the msg was added (tested using DL_MCAN_TXBufAddReq return value == 0).
Code:
bool canTxFifo(union MESSAGE *txMessage)
{
DL_MCAN_TxEventFIFOStatus fifoStatus;
bool ret;
DL_MCAN_getTxEventFIFOStatus(MCAN0_INST, &fifoStatus);
if (!fifoStatus.fifoFull)
{
txMsg.id = txMessage->can.id << 18U;
for (uint32_t i = 0; i < 8; i++) txMsg.data[i] = txMessage->can.data[i];
DL_MCAN_writeMsgRam(MCAN0_INST, DL_MCAN_MEM_TYPE_FIFO, 0, &txMsg);
DL_MCAN_TXBufAddReq(MCAN0_INST, 0);
return true;
}
else
return false;
}
Many thanks for help!
You need to send the second package before your last package be send out successfully. You can try to add delay between different package.
Thank you for help!
If I add delay 1ms, it works.
Is there a flag that shows me when I can send the next package?