S32K348 CAN FD Receive filter set

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

S32K348 CAN FD Receive filter set

Jump to solution
985 Views
youngkin
Contributor III

Hello:

I have studied this example( https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K358-FlexCAN-TXRX-ISR-S32DS35-RTD400-500...), receive can message:

I want to set canid  filter, as sample i want to receive the message from  canid (0x123) 

and I  write code as follow:

youngkin_0-1761568701636.png

but  now  I can not receive any message.

Please take a moment to help answer, thank you!

 

0 Kudos
Reply
1 Solution
947 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@youngkin

FlexCAN_Ip_SetRxIndividualMask_Privileged(INST_FLEXCAN_0, RX_MB_IDX, 0x7FF); // Exact match for standard ID
 
  • For standard ID (11-bit), use 0x7FF for full match.
  • For extended ID (29-bit), use a 29-bit mask like 0x1FFFFFFF.

View solution in original post

0 Kudos
Reply
2 Replies
948 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@youngkin

FlexCAN_Ip_SetRxIndividualMask_Privileged(INST_FLEXCAN_0, RX_MB_IDX, 0x7FF); // Exact match for standard ID
 
  • For standard ID (11-bit), use 0x7FF for full match.
  • For extended ID (29-bit), use a 29-bit mask like 0x1FFFFFFF.

0 Kudos
Reply
945 Views
youngkin
Contributor III
thanks!resolve it
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2193524%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K348%20%20CAN%20FD%20%20Receive%20filter%20set%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2193524%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%3A%3C%2FP%3E%3CP%3EI%20have%20studied%20this%20example%EF%BC%88%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FExample-S32K358-FlexCAN-TXRX-ISR-S32DS35-RTD400-500%2Fta-p%2F1981987%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FExample-S32K358-FlexCAN-TXRX-ISR-S32DS35-RTD400-500...%3C%2FA%3E%EF%BC%89%2C%20receive%20can%20message%3A%3C%2FP%3E%3CP%3EI%20want%20to%20set%20canid%26nbsp%3B%20filter%2C%20as%20sample%20i%20want%20to%20receive%20the%20message%20from%26nbsp%3B%20canid%20(0x123)%26nbsp%3B%3C%2FP%3E%3CP%3Eand%20I%26nbsp%3B%20write%20code%20as%20follow%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22youngkin_0-1761568701636.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22youngkin_0-1761568701636.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F362723i929EE64FA10762BF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22youngkin_0-1761568701636.png%22%20alt%3D%22youngkin_0-1761568701636.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Ebut%26nbsp%3B%20now%26nbsp%3B%20I%20can%20not%20receive%20any%20message.%3C%2FP%3E%3CP%3EPlease%20take%20a%20moment%20to%20help%20answer%2C%20thank%20you%EF%BC%81%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2193932%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K348%20%20CAN%20FD%20%20Receive%20filter%20set%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2193932%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Ethanks%EF%BC%81resolve%20it%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2193894%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K348%20%20CAN%20FD%20%20Receive%20filter%20set%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2193894%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3Eyoungkin%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3C!--ScriptorStartFragment--%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3E%3C!--ScriptorStartFragment--%3EFlexCAN_Ip_SetRxIndividualMask_Privileged(INST_FLEXCAN_0%2C%20RX_MB_IDX%2C%200x7FF)%3B%20%2F%2F%20Exact%20match%20for%20standard%20ID%3C!--ScriptorEndFragment--%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%0A%3CUL%3E%0A%3CLI%3EFor%20%3CSTRONG%3Estandard%20ID%20(11-bit)%3C%2FSTRONG%3E%2C%20use%20%3CCODE%3E0x7FF%3C%2FCODE%3E%20for%20full%20match.%3C%2FLI%3E%0A%3CLI%3EFor%20%3CSTRONG%3Eextended%20ID%20(29-bit)%3C%2FSTRONG%3E%2C%20use%20a%2029-bit%20mask%20like%20%3CCODE%3E0x1FFFFFFF%3C%2FCODE%3E.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FDIV%3E%0A%3CP%3E%3CLI-WRAPPER%3E%3CSPAN%3E%3C!--ScriptorEndFragment--%3E%3C%2FSPAN%3E%3C%2FLI-WRAPPER%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E