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.

AWR1642: Problems in DCAN in continous send mode.

Part Number: AWR1642
Other Parts Discussed in Thread: MMWAVE-SDK

Hi,

     I tried to send CAN data over DCAN module in SDK version 2.0.0.4 for awr1642. But I found a bug. 

     I want to continous send at least 50 CAN frames over DCAN as soon as possible. I call hal_CanSendByte() function 50times in a simple for loop. Here is my code in function hal_CanSendByte():

    do{
        sErrCode = mcal_CanSendByte(bCanIndex,pCanMsgObj->uMsgId,The_Standard_Frame,pCanMsgObj->uMsgDataLen,pCanMsgObj->aMsgData);
        sErrCount++;
        if(sErrCount > sDelayNum){
            break;
        }
    }while(sErrCode == ERR_CAN_INUSE);

     in HAL Layer. And in function mcal_CanSendByte() has the key code:

			if(CAN_transmitData(s_pDCanTxMsgHandleObj[uDCanTxObjIdx].hDCanHandle, &stTxData, &errCode) < 0)
			{
				switch(errCode){
				case CAN_EINUSE:
					retErrCode = ERR_CAN_INUSE;
					break;
				case CAN_EINVAL:
					retErrCode = ERR_CAN_INVAL;
					break;
				case CAN_EOK:
					retErrCode = CAN_OK;
					break;
				default:
					retErrCode = ERR_CAN_INVAL;
					break;
				}
			}else{
				retErrCode = CAN_OK;
			}

  

   I found the return value of CAN_transmitData() has never been below 0! so the first 49 frames cannot be sent out correctly. 

   Is there any bugs in DCAN driver, thank you!

  • Hi,
    Are you using MCAL library on the device?
    Could you try same experiment with mmWave-SDK CAN/CANFD driver test application (dcanTrasnmitTest function).

    Regards,
    Jitendra
  • Hi:

            CAN-FD drivers works well with the return value of CANFD_transmitData() function. I tested the dcanTrasnmitTest function, CAN_transmitData() always return 0(never printf the message "Error: CAN transmit data for iteration %d failed [Error code %d]"), even though bus load percent is 100%. which I thought it should return -1 when the previous message is not sent.