大家好、
关于 MCAN、我们有两个问题。
Q1. LP-AM263是否有相同问题? (AWRL6432:关于 CAN 中的距离滤波器)
我们尝试更改为 FIFO 模式、但无法接收任何消息。 (ID 0xC0-0xC4)
这是我的 FIFO 设置、
/* Allocate Message RAM memory section to filter elements, buffers, FIFO */
/* Maximum STD Filter Element can be configured is 128 */
#define APP_MCAN_STD_ID_FILTER_CNT (5U)
/* Maximum EXT Filter Element can be configured is 64 */
#define APP_MCAN_EXT_ID_FILTER_CNT (0U)
/* Maximum TX Buffer + TX FIFO, combined can be configured is 32 */
#define APP_MCAN_TX_BUFF_CNT (0U)
#define APP_MCAN_TX_FIFO_CNT (32U)
/* Maximum TX Event FIFO can be configured is 32 */
#define APP_MCAN_TX_EVENT_FIFO_CNT (0U)
/* Maximum RX FIFO 0 can be configured is 64 */
#define APP_MCAN_FIFO_0_CNT (64U)
/* Maximum RX FIFO 1 can be configured is 64 and
* rest of the memory is allocated to RX buffer which is again of max size 64 */
#define APP_MCAN_FIFO_1_CNT (0U)
/* Standard Id configured in this app */
#define APP_MCAN_STD_ID (0xC0U)
#define APP_MCAN_STD_ID_MASK (0x7FFU)
#define APP_MCAN_STD_ID_SHIFT (18U)
#define APP_MCAN_EXT_ID_MASK (0x1FFFFFFFU)
static void App_mcanInitStdFilterElemParams(MCAN_StdMsgIDFilterElement *stdFiltElem,
uint32_t bufNum)
{
/* sfid1 defines the ID of the standard message to be stored. */
stdFiltElem->sfid1 = APP_MCAN_STD_ID;
/* As buffer mode is selected, sfid2 should be bufNum[0 - 63] */
stdFiltElem->sfid2 = 0xC4;
/* Store message in buffer */
stdFiltElem->sfec = MCAN_STD_FILT_ELEM_FIFO0;
/* Below configuration is ignored if message is stored in buffer */
stdFiltElem->sft = MCAN_STD_FILT_TYPE_RANGE;
return;
}
问题2. 它是否能够接收包含 BRS 的消息?
我们尝试了三种方法、
1.树莓发送消息到 MCAN -->传递
2.覆盆子发送消息到 MCAN 包括 CANFD -->传递
3.树莓发送消息到 MCAN 包括 CANFD 和 BRS -->失败(不响应)
Raspberry 命令:
1.set CAN:sudo ip link set can0 up type can bitrate 1000000 dbitrate 5000000 restart-ms 1000 fd on
2.send CAN2.0: cansend CAN0 0c0#0011223344556677
3.send CANFD:cansend CAN0 0c0#01AC00A33445566778899AABBCCDDEEFF00112233445566778899AABBCCDDEEFF00112233445566778899AABBCCDDEEFF00233445566778899AABBCCDDEEFF0056778899AABBABBCCDABBCCDDEEFF
4.send CANFD 包含 BRS:
Cansend CAN0 0c0#11AC00A33445566778899AABBCCDDEEFF001122334455667899AABBCCDDEEFF00112233445566778899AABBCCDDEEFF00112233445566778899AABBCCDDEEFF
此致、
路易