我在SRR的代码中加入CAN发送功能。
CAN的发送程序CAN_transmitData放在MmwDemo_mboxReadTask中
当我发送某一个固定的CAN ID时,可以正常工作。
当我参考论坛的参考代码准备实现不同ID发送时,进行如下配置:
CAN_MsgObjHandle txMsgObjHandle[0x0f]
Can_Initialize()
{
..
appDcanTxcfgParams.msgIdentifier = 0x300
txMsgObjHandle[1] = CAN_creatMsgObject(canHandle,1,&appDcanTxcfgParams,&errCode);
appDcanTxcfgParams.msgIdentifier = 0x400
txMsgObjHandle[2] = CAN_creatMsgObject(canHandle,2,&appDcanTxcfgParams,&errCode);
appDcanTxcfgParams.msgIdentifier = 0x500
txMsgObjHandle[3] = CAN_creatMsgObject(canHandle,3,&appDcanTxcfgParams,&errCode);
..
}
然后我在MmwDemo_mboxReadTask中发送CAN
当只发送CAN_transmitData(txMsgObjHandle[1],&appDcanTxData,&errCode)时,可以正常工作。
当只发送CAN_transmitData(txMsgObjHandle[2],&appDcanTxData,&errCode)时,会报错
当只发送CAN_transmitData(txMsgObjHandle[3],&appDcanTxData,&errCode)时,也会报错
错误提示如下:
ti.sysbios.gates.GateMutex:line 99:assertion failure:A_BadContext:bad calling context.See GateMutex API doc for details.xdc.runtime.Error.raise:terminating excution
请问哪里出问题了,为什么只能发送txMsgObjHandle[1]的信息~~