TI中文支持网
TI专业的中文技术问题搜集分享网站

IWR1642: IWR1642的CANFD 可以注册几个接收CAN ID?

Part Number:IWR1642Other Parts Discussed in Thread: SYSBIOS

你好,我使用IWR1642的CAN FD发现,当我只注册了4个及以下的接收CAN ID时,程序可以运行。但我注册了第五个CAN ID后程序就不能执行了~~

注册CAN ID的代码如下,麻烦帮看看有什么问题~~

CANFD_MsgObjHandle          rxMsgObjHandle[5];

/* Setup the receive message object */
{
CANFD_MCANMsgObjCfgParams rxMsgObjectParams;
int32_t errCode = 0;
rxMsgObjectParams.direction = CANFD_Direction_RX;
rxMsgObjectParams.msgIdType = CANFD_MCANXidType_11_BIT;
rxMsgObjectParams.msgIdentifier = 0x100;
rxMsgObjHandle[0] = CANFD_createMsgObject (canHandle, &rxMsgObjectParams, &errCode);
if (rxMsgObjHandle[0] == NULL)
{
System_printf ("Error: CANFD create Rx message object failed [Error code %d]\n", errCode);
return -1;
}
}
{
CANFD_MCANMsgObjCfgParams rxMsgObjectParams;
int32_t errCode = 0;
rxMsgObjectParams.direction = CANFD_Direction_RX;
rxMsgObjectParams.msgIdType = CANFD_MCANXidType_11_BIT;
rxMsgObjectParams.msgIdentifier = 0x200;
rxMsgObjHandle[1] = CANFD_createMsgObject (canHandle, &rxMsgObjectParams, &errCode);
if (rxMsgObjHandle[1] == NULL)
{
System_printf ("Error: CANFD create Rx message object failed [Error code %d]\n", errCode);
return -1;
}
}
{
CANFD_MCANMsgObjCfgParams rxMsgObjectParams;
int32_t errCode = 0;
rxMsgObjectParams.direction = CANFD_Direction_RX;
rxMsgObjectParams.msgIdType = CANFD_MCANXidType_11_BIT;
rxMsgObjectParams.msgIdentifier = 0x300;
rxMsgObjHandle[2] = CANFD_createMsgObject (canHandle, &rxMsgObjectParams, &errCode);
if (rxMsgObjHandle[2] == NULL)
{
System_printf ("Error: CANFD create Rx message object failed [Error code %d]\n", errCode);
return -1;
}
}
{
CANFD_MCANMsgObjCfgParams rxMsgObjectParams;
int32_t errCode = 0;
rxMsgObjectParams.direction = CANFD_Direction_RX;
rxMsgObjectParams.msgIdType = CANFD_MCANXidType_11_BIT;
rxMsgObjectParams.msgIdentifier = 0x400;
rxMsgObjHandle[3] = CANFD_createMsgObject (canHandle, &rxMsgObjectParams, &errCode);
if (rxMsgObjHandle[3] == NULL)
{
System_printf ("Error: CANFD create Rx message object failed [Error code %d]\n", errCode);
return -1;
}
}
// {
// CANFD_MCANMsgObjCfgParams rxMsgObjectParams;
// int32_t errCode = 0;
// rxMsgObjectParams.direction = CANFD_Direction_RX;
// rxMsgObjectParams.msgIdType = CANFD_MCANXidType_11_BIT;
// rxMsgObjectParams.msgIdentifier = 0x500;
// rxMsgObjHandle[4] = CANFD_createMsgObject (canHandle, &rxMsgObjectParams, &errCode);
// if (rxMsgObjHandle[4] == NULL)
// {
// System_printf ("Error: CANFD create Rx message object failed [Error code %d]\n", errCode);
// return -1;
// }
// }

Shine:

请问有报错信息吗?请看一下下面的帖子。https://e2e.ti.com/support/sensors-group/sensors/f/sensors-forum/662919/rtos-awr1642-how-much-can-fd-can-be-declaration-in-mmwave-demo

,

user4861090:

你好,错误信息如下:

[Cortex_R4_0] Debug: Launched the Initialization Task[C674X_0] Heap L1 : size 16384 (0x4000), free 9216 (0x2400)Heap L3 : size 786432 (0xc0000), free 507904 (0x7c000)Heap L2 : size 49152 (0xc000), free 37712 (0x9350)[Cortex_R4_0] Debug: Initialized the mmWave moduleDebug: Synchronized the mmWave moduleDebug: CLI is operationalti.sysbios.heaps.HeapMem: line 221: out of memory: handle=0x800d6e0, size=36ti.sysbios.heaps.HeapMem: line 221: out of memory: handle=0x800d6e0, size=36ti.sysbios.knl.Task: line 418: E_stackOverflow: Task 0x8004f20 stack overflow.xdc.runtime.Error.raise: terminating execution

,

user4861090:

问题解决了,CANFD_createMsgObject中有调用malloc,导致heap溢出了

,

Shine:

感谢分享解决方法!

赞(0)
未经允许不得转载:TI中文支持网 » IWR1642: IWR1642的CANFD 可以注册几个接收CAN ID?
分享到: 更多 (0)

© 2025 TI中文支持网   网站地图 鲁ICP备2022002796号-1