IMX6ULL flexcan HW CAN ID filtering

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

IMX6ULL flexcan HW CAN ID filtering

510 次查看
gordonjacobs
Contributor I

We are trying to modify the flexcan driver on a specific device to only receive certain CAN IDs. We are able to patch the driver to receive NO CAN IDs, but we are having trouble configuring the registers to only accept a list of certain CAN IDs.

Inside flexcan.c, we were able to find the code that configures the filtering in flexcan_chip_start (starting around line 1687):

/* acceptance mask/acceptance code (accept everything) */
priv->write(0x0, &regs->rxgmask);
priv->write(0x0, &regs->rx14mask);
priv->write(0x0, &regs->rx15mask);

if (priv->devtype_data.quirks & FLEXCAN_QUIRK_DISABLE_RXFG)
    priv->write(0x0, &regs->rxfgmask);

/* clear acceptance filters */
for (i = 0; i < priv->mb_count; i++)
    priv->write(0, &regs->rximr[i]);

This patch is able to prevent us from receiving any CAN IDs, but we want to have a list of specific CAN IDs we receive:

priv->write(0xffffffff, &regs->rxgmask);
priv->write(0xffffffff, &regs->rx14mask);
priv->write(0xffffffff, &regs->rx15mask);
 
if (priv->devtype_data.quirks & FLEXCAN_QUIRK_DISABLE_RXFG)
priv->write(0xffffffff, &regs->rxfgmask);
 
/* clear acceptance filters */
for (i = 0; i < priv->mb_count; i++)
priv->write(0xffffffff, &regs->rximr[i]);

 

We would appreciate any help on this, thanks.

标签 (1)
0 项奖励
回复
1 回复

478 次查看
Bio_TICFSL
NXP TechSupport
NXP TechSupport
0 项奖励
回复