主题:SysConfig 中讨论的其他器件
工具/软件:
TI 团队大家好:
我的工程。 只 能接收等于 0x757、0x2F6 的标准 ID。 我想使用 3 个接受过滤器来 过滤这些标准 ID 此外、将标准 ID 为 0x757 的 CAN 消息存储在 RX FIFO0 中、将标准 ID 为 0x2F6 的 CAN 消息存储在 RX FIFO1 或专用的 RX 缓冲区中。 以下是我的配置 1:


stCanRxDiagMsgObj.direction = CANFD_Direction_RX; stCanRxDiagMsgObj.msgIdType = CANFD_MCANXidType_11_BIT; stCanRxDiagMsgObj.args = (uint8_t*) Can_au8RxDiagData; stCanRxDiagMsgObj.startMsgId = 0x757; stCanRxDiagMsgObj.endMsgId = 0; stCanRxDiagMsgObj.rxElement = 0; stCanRxDiagMsgObj.dataLength = 64; stCanRxDiagMsgObj.rxMemType = MCAN_MEM_TYPE_FIFO; status = CANFD_createMsgObject (gCanfdHandle[CONFIG_MCAN0], &stCanRxDiagMsgObj); u32FilterNum++; stCanRxTimeSyncMsgObj.direction = CANFD_Direction_RX; stCanRxTimeSyncMsgObj.msgIdType = CANFD_MCANXidType_11_BIT; stCanRxTimeSyncMsgObj.args = (uint8_t*) Can_au8RxTimeSyncData; stCanRxTimeSyncMsgObj.startMsgId = 0x2F6; stCanRxTimeSyncMsgObj.endMsgId = 0; stCanRxTimeSyncMsgObj.rxElement = 0; /** buffer num */ stCanRxTimeSyncMsgObj.dataLength = 64; stCanRxTimeSyncMsgObj.filterConfig; stCanRxTimeSyncMsgObj.rxMemType = MCAN_MEM_TYPE_BUF;
滤波器工作正常。 但具有标准 ID 0x2F6 的 CAN 消息存储在 FIFO0 中、而不是专用的 Rx 缓冲区中。 所有消息均使用 stCanRxDiagMsgObj 接收。 对象 stCanRxTimeSyncMsgObj 无意义。
根据上述内容、 添加另一个配置:
uint32_t u32BaseAddr = 0U;
uint32_t u32FilterNum = 1;
MCAN_StdMsgIDFilterElement stStdMsgIdFilter;
u32BaseAddr = stCanRxDiagMsgObj.canfdHandle->object->regBaseAddress;
/**ID */
stStdMsgIdFilter.sfid1 = 0x2F6;
stStdMsgIdFilter.sfid2 = 0;
/* store in rx buffer */
stStdMsgIdFilter.sfec = MCAN_STD_FILT_ELEM_BUFFER;
/**< Dual ID filter for SFID1 or SFID2, will be ignore in buffer mode. */
stStdMsgIdFilter.sft = MCAN_STD_FILT_TYPE_DUAL;
MCAN_addStdMsgIDFilter(u32BaseAddr, u32FilterNum, &stStdMsgIdFilter);
在此配置中、 标准 ID 为 0x2F6 的 CAN 消息可以触发接收中断。 但无法获取正确的 CAN ID 和消息数据。
那么、您能帮助 修改滤波器配置以满足我的要求吗? 谢谢!
另一个问题:
SFID2 已 在蓝色框中进行了说明、 那么如何理解红色框中的描述呢?





