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:
Hi,
we're working on a CAN-design using the MSPM0G series microcontrollers. We're facing an issue where the CAN peripheral will transmit the same message multiple times in rapid succession. I've managed to reduce the problem to a reproducible example on a Launchpad devboard.
#include "ti/devices/msp/m0p/mspm0g350x.h" #include "ti/devices/msp/peripherals/hw_mcan.h" #include "ti/driverlib/dl_common.h" #include "ti/driverlib/dl_mcan.h" #include "ti_msp_dl_config.h" void send_msg(uint8_t order_id) { DL_MCAN_TxBufElement tx_msg; DL_MCAN_TxFIFOStatus tx_fifo_status; tx_msg.id = (0x01 << 10); tx_msg.rtr = 0; tx_msg.xtd = 1; tx_msg.esi = 0; tx_msg.dlc = 1; tx_msg.brs = 1; tx_msg.fdf = 1; tx_msg.efc = 1; tx_msg.mm = 0xAA; DL_MCAN_getTxFIFOQueStatus(CANFD0, &tx_fifo_status); tx_msg.data[0] = order_id; DL_MCAN_writeMsgRam(MCAN0_INST, DL_MCAN_MEM_TYPE_FIFO, tx_fifo_status.putIdx, &tx_msg); DL_MCAN_TXBufAddReq(MCAN0_INST, tx_fifo_status.putIdx); } void init() { SYSCFG_DL_init(); while (DL_MCAN_OPERATION_MODE_NORMAL != DL_MCAN_getOpMode(MCAN0_INST)) { __WFE(); } } int main(void) { init(); uint8_t count = 0; while (1) { send_msg(count); count++; DL_Common_delayCycles(320000); } }
This results in occasional repetitions of the transmitted message on the bus:
I would expect, given the successful acknowledgement by another CAN-controller present (the ACK-bit is indeed the correct length, and not an error frame), that the MSPM0 wouldn't retransmit the message. In addition, I cannot discern any difference in the last message that would lead to the controller then suddenly stopping to transmit?
As an added twist, this happens even when the "Messages will only be sent once" checkbox is ticked in the SysConfig. As I understand it, this should absolutely stop the CAN controller from retransmitting any message?
I've included a count field in the message, which confirms that this is indeed the exact same message transmitted multiple times.
Anything obvious I am missing here?
Thank you for your help, if there's anything more I can share to clarify what might be happening here please tell me.
Cheers,
Fabian
Are you using a CAN analyzer? Is there any other CAN node on the CAN bus?
If there is only M0 on this CAN bus, then it will keep sending. If you add one more node, then it will disappear.
But you mean you enable "Messages will only be sent once" but it still keeps sending?