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.

CAN messages missed during continuous transmission

Other Parts Discussed in Thread: SYSBIOS

I am sending continuous CAN messages from M3 and monitoring those messages through "IXXAT USB to CAN" which is connected to CAN bus. The problem is only one message is being sent.

If I use the following code inside the Task function in Sysbios project, only 1 message is transmitted:

for (i = 0; i<5; i++)
{
        *(unsigned long *)ucTXMsgData = 0;
	sTXCANMessage.ulMsgID 		= 0x00002102;                       
	sTXCANMessage.ulMsgIDMask 	= 0x00002102;                    	
	sTXCANMessage.ulFlags 		= MSG_OBJ_TX_INT_ENABLE | MSG_OBJ_EXTENDED_ID;     
	sTXCANMessage.ulMsgLen 		= 0;     							
	sTXCANMessage.pucMsgData	= ucTXMsgData;           			// ptr to message content
	CANMessageSet(CAN0_BASE, msgBoxNum, &sTXCANMessage, MSG_OBJ_TYPE_TX);
    
        CANMessageSet(CAN0_BASE, msgBoxNum, &sTXCANMessage, MSG_OBJ_TYPE_TX);
        *(unsigned long *)ucTXMsgData = *(unsigned long *)ucTXMsgData +1;
}

If I put a small delay, after sending each CAN message, then all 5 are transmitted.

for (i = 0; i<5; i++)
{
        *(unsigned long *)ucTXMsgData = 0;
	sTXCANMessage.ulMsgID 		= 0x00002102;                       
	sTXCANMessage.ulMsgIDMask 	= 0x00002102;                    	
	sTXCANMessage.ulFlags 		= MSG_OBJ_TX_INT_ENABLE | MSG_OBJ_EXTENDED_ID;     
	sTXCANMessage.ulMsgLen 		= 0;     							
	sTXCANMessage.pucMsgData	= ucTXMsgData;           			// ptr to message content
	CANMessageSet(CAN0_BASE, msgBoxNum, &sTXCANMessage, MSG_OBJ_TYPE_TX);
    
        CANMessageSet(CAN0_BASE, msgBoxNum, &sTXCANMessage, MSG_OBJ_TYPE_TX);
        Task_sleep(1);
        *(unsigned long *)ucTXMsgData = *(unsigned long *)ucTXMsgData +1;
}

 Why delay is needed and can I remove this delay as I want to send messages one after another as fast as possible?


Board: F28M35H52C1
Sysbios  6.33.05.46

XDC tools: 3.23.03.53