Is it possible to determine whether a received CAN message is a CAN FD or a regular CAN message?

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

Is it possible to determine whether a received CAN message is a CAN FD or a regular CAN message?

436 Views
lua40927
Contributor II

Hello, I'm currently using an S32K312 .

 

I'm currently using the official sample code and have enabled FD for rx_info.

I've tried this configuration and it allows me to receive classic CAN messages (not CAN FD).

What I want to do now is determine whether a received message is a CAN FD message based on the received message.

I noticed that the received message declaration is as follows:

lua40927_0-1767843957135.png

The only status I can view is "cs", but I can't find anything about "cs" in the manual.

If there are other methods to determine this without using "cs", please provide them to me.

Thanks

0 Kudos
Reply
3 Replies

402 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

yes, the "cs" would contain that info, after reception it is loaded with MB's word0. MSB bit indicates if frame is classic CAN on CAN FD one.

PetrS_0-1767857035396.png

BR, Petr

0 Kudos
Reply

397 Views
lua40927
Contributor II
Thank you for your reply.

I also want to ask, when CAN is set to CAN FD mode, is it possible to transmit classic CAN messages to older devices that do not support CAN FD? I disabled TX's fd and BRS, but the device is not receiving messages.

If it is possible, how should I configure it?
0 Kudos
Reply

259 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

yes, it is possible, even if node has CAN FD mode enabled the classic CAN message can be sent. It is done as you wrote. Keep tx_info parameter to have fd_enable=false

PetrS_0-1767963017301.png

and send message with this tx_info as parameter.

BR, Petr

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2289826%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EIs%20it%20possible%20to%20determine%20whether%20a%20received%20CAN%20message%20is%20a%20CAN%20FD%20or%20a%20regular%20CAN%20message%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2289826%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%20I'm%20currently%20using%20an%20S32K312%20.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI'm%20currently%20using%20the%20official%20sample%20code%20and%20have%20enabled%20FD%20for%20rx_info.%3C%2FP%3E%3CP%3EI've%20tried%20this%20configuration%20and%20it%20allows%20me%20to%20receive%20classic%20CAN%20messages%20(not%20CAN%20FD).%3C%2FP%3E%3CP%3E%3CSTRONG%3EWhat%20I%20want%20to%20do%20now%20is%20determine%20whether%20a%20received%20message%20is%20a%20CAN%20FD%20message%20based%20on%20the%20received%20message.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EI%20noticed%20that%20the%20received%20message%20declaration%20is%20as%20follows%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22lua40927_0-1767843957135.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22lua40927_0-1767843957135.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22lua40927_0-1767843957135.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F372071i6830974EED12729D%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22lua40927_0-1767843957135.png%22%20alt%3D%22lua40927_0-1767843957135.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThe%20only%20status%20I%20can%20view%20is%20%22cs%22%2C%20but%20I%20can't%20find%20anything%20about%20%22cs%22%20in%20the%20manual.%3C%2FP%3E%3CP%3EIf%20there%20are%20other%20methods%20to%20determine%20this%20without%20using%20%22cs%22%2C%20please%20provide%20them%20to%20me.%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2289953%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Is%20it%20possible%20to%20determine%20whether%20a%20received%20CAN%20message%20is%20a%20CAN%20FD%20or%20a%20regular%20CAN%20message%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2289953%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EThank%20you%20for%20your%20reply.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20also%20want%20to%20ask%2C%20when%20CAN%20is%20set%20to%20CAN%20FD%20mode%2C%20is%20it%20possible%20to%20transmit%20classic%20CAN%20messages%20to%20older%20devices%20that%20do%20not%20support%20CAN%20FD%3F%20I%20disabled%20TX's%20fd%20and%20BRS%2C%20but%20the%20device%20is%20not%20receiving%20messages.%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20it%20is%20possible%2C%20how%20should%20I%20configure%20it%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2289938%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Is%20it%20possible%20to%20determine%20whether%20a%20received%20CAN%20message%20is%20a%20CAN%20FD%20or%20a%20regular%20CAN%20message%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2289938%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3Eyes%2C%20the%20%22cs%22%20would%20contain%20that%20info%2C%20after%20reception%20it%20is%20loaded%20with%20MB's%20word0.%20MSB%20bit%20indicates%20if%20frame%20is%20classic%20CAN%20on%20CAN%20FD%20one.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22PetrS_0-1767857035396.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22PetrS_0-1767857035396.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22PetrS_0-1767857035396.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F372106i53F6955568916118%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22PetrS_0-1767857035396.png%22%20alt%3D%22PetrS_0-1767857035396.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EBR%2C%20Petr%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2291028%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Is%20it%20possible%20to%20determine%20whether%20a%20received%20CAN%20message%20is%20a%20CAN%20FD%20or%20a%20regular%20CAN%20message%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2291028%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3Eyes%2C%20it%20is%20possible%2C%20even%20if%20node%20has%20CAN%20FD%20mode%20enabled%20the%20classic%20CAN%20message%20can%20be%20sent.%20It%20is%20done%20as%20you%20wrote.%20Keep%20tx_info%20parameter%20to%20have%20fd_enable%3Dfalse%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22PetrS_0-1767963017301.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22PetrS_0-1767963017301.png%22%20style%3D%22width%3A%20385px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F372327i8457754889C5B735%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22PetrS_0-1767963017301.png%22%20alt%3D%22PetrS_0-1767963017301.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Eand%20send%20message%20with%20this%20tx_info%20as%20parameter.%3C%2FP%3E%0A%3CP%3EBR%2C%20Petr%3C%2FP%3E%0A%3CDIV%3E%0A%3CBR%20%2F%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E