S32K148 CAN

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K148 CAN

1,470 Views
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 Kudos
3 Replies

1,175 Views
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 Kudos

1,175 Views
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 Kudos

1,175 Views
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 Kudos