S32K148 CAN

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

S32K148 CAN

2,569 次查看
gravity_one
Contributor III

hi,dear

i new build can_pal_s32k148 example (sdk3.0),i replace (can_pal1.c) CAN_NORMAL_MODE to CAN_LOOPBACK_MODE,i press button(sw3 sw4), led0 or led1 not toggle;

use hardware:s32k148evb-q176

please help me!

0 项奖励
回复
3 回复数

2,274 次查看
gravity_one
Contributor III

hi,

how to add CAN ID filter?

uint32_t id_filter_table[]={0x001,0x002,0x003,0x004,0x022};
void CAN_id_filter(uint8_t instance)
{
for(int i=0;i<sizeof(id_filter_table);i++)
FLEXCAN_DRV_SetRxMbGlobalMask(instance,FLEXCAN_MSG_ID_STD,id_filter_table[i]);
}

is right?

I test,it receive all can ID,why?

0 项奖励
回复

2,274 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi, 

you can refer to below example

https://community.nxp.com/docs/DOC-343091 

it shows usage of RXFIFO and ID table in the SDK.

BR, Petr

0 项奖励
回复

2,274 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

this example configures 1 TX MB and 1 RX MB with different IDs, exact match is expected. If you set loopback mode, message is received, but does not match with configured ID, so it is not stored into RX MB and no LED can be toggled.

Try to simple configure same ID for both MBs, for example use

#define RX_MSG_ID   (1UL)

BR, Petr

0 项奖励
回复