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!