CAN-FD Protocol Exception on S32K396 not working

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

CAN-FD Protocol Exception on S32K396 not working

2,090 Views
rtljopl
Contributor II

We are running a S32K396 FlexCAN module in Legacy RXFIFO mode. The channel does not support the Enhanced RXFIFO (channel 4).

We need this controller to exist on a network where some nodes are going to be sending CAN-FD frames.

We have set the PREXCEN bit in CTRL2 that should trigger the protocol exception logic for non supported bits, however the controller still triggers CAN error frames on the bus when CAN-FD frames are seen.

It seems like the protocol exception logic is not active in this case. The controller CAN support CAN-FD, but not in the legacy fifo mode.

From my understanding the Protocol Exception logic should be activated for the FDF bit in the  CAN frame if the controller does not support it. Which is the case in this configuration.

Is this a known issue?

Tags (1)
0 Kudos
Reply
6 Replies

2,074 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @rtljopl,

I am not aware of any open issue regarding protocol exception. 

Are you able to share which RTD version you are using? Is this EB Tresos, S32DS or another configuration tool? I can ask the internal team for confirmation regarding this issue.

If possible, also please share the FlexCAN module configuration, to test this on my side.

Best regards,
Julián

0 Kudos
Reply

2,068 Views
rtljopl
Contributor II

This is a custom driver built for our RTOS (rt-kernel https://rt-labs.com/product/rtos/) used in automotive domain. So it's based around the specifications of FlexCAN instead of your provided MCAL's.

We have two variants. One based around legacy rx fifo and one based on extended rx fifo (for can-fd). But since the 4th can controller on S32K396 does not supported extended fifo, we are using the older driver. 

Given it's using legacy rx fifo, can-fd can not be enabled, but it should still be able to passively/silently participate in can-fd networks based on the protocol exception logic. 

0 Kudos
Reply

1,969 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @rtljopl,

Actually, looking a bit more into the Protocol Exception definition as per-ISO 11898-1:2015, I do not think this configuration is relevant to your setup. 

According to the international CAN conference (iCC): 

When CAN FD was specified in ISO 11898-1:2015, one bit was reserved for the future expansion of the protocol. This is the reserved bit after the FDF bit, which is expected to be dominant in CAN FD frames. When it is seen recessive, a CAN FD node will detect a protocol exception. Software configuration decides whether the node treats this as a form error or whether it enters the Protocol Exception State, where it will remain until the bus is idle again.


Protocol Exception State (PES) is a mechanism for FD‑capable nodes only. Its purpose is not to prevent Classical CAN nodes from reacting to FD frames, rather so that CAN‑FD nodes do not disturb CAN‑XL frames.

A classic controller receiving an FD frame will trigger an error frame, since the bit sequence on the bus does not make sense to it.

Unless you use gateways for older classic CAN nodes in your bus, Classical nodes will throw errors and go bus‑off.

Best regards,
Julián

0 Kudos
Reply

1,914 Views
rtljopl
Contributor II

But is this node really a classical CAN node?

I suppose it could be considered that when CAN-FD feature is disabled, however i also assumed it could be run as a CAN-FD tolerant controller when not wanting to receive the CAN-FD frames.

But okey. This won't be solvable by some hardware feature in our case anyway, so we have to figure out a workaround for CAN4 channel without any fifo support.

Thanks for the investigation.

0 Kudos
Reply

1,878 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @rtljopl,

I think being a CANFD-tolerant node is more dependent on the PHY. For example, TJA1145 will see CAN FD frames as errors, while TJA1145FD offers CAN FD passive functionality, judging the CAN FD frames as 'valid', regardless of what comes after the FDF bit:

Snag_18a88cb.png

Best regards,
Julián

0 Kudos
Reply

1,854 Views
rtljopl
Contributor II

Yes we are using the FD variant of that TRCV.

However, the concept of `tolerate` there only applies to wakeup (we had missed that). So once the ECU/TRCV is up and running. CAN-FD frames are passed through to the controller independent on the TRCV setting. So the controller starts sending error frames even though in theory it's CAN-FD capable (thou disabled).

Only way to handle it is to enable CAN-FD on the controller and in software (or probably hardware filters) filter out the CAN-FD frames. But then we are back to the problem of limited CAN-FD support in the 4th channel requiring rewritten drivers.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2324438%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ECAN-FD%20Protocol%20Exception%20on%20S32K396%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2324438%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWe%20are%20running%20a%20S32K396%20FlexCAN%20module%20in%20Legacy%20RXFIFO%20mode.%20The%20channel%20does%20not%20support%20the%20Enhanced%20RXFIFO%20(channel%204).%3C%2FP%3E%3CP%3EWe%20need%20this%20controller%20to%20exist%20on%20a%20network%20where%20some%20nodes%20are%20going%20to%20be%20sending%20CAN-FD%20frames.%3C%2FP%3E%3CP%3EWe%20have%20set%20the%20PREXCEN%20bit%20in%20CTRL2%20that%20should%20trigger%20the%20protocol%20exception%20logic%20for%20non%20supported%20bits%2C%20however%20the%20controller%20still%20triggers%20CAN%20error%20frames%20on%20the%20bus%20when%20CAN-FD%20frames%20are%20seen.%3C%2FP%3E%3CP%3EIt%20seems%20like%20the%20protocol%20exception%20logic%20is%20not%20active%20in%20this%20case.%20The%20controller%20CAN%20support%20CAN-FD%2C%20but%20not%20in%20the%20legacy%20fifo%20mode.%3C%2FP%3E%3CP%3EFrom%20my%20understanding%20the%20Protocol%20Exception%20logic%20should%20be%20activated%20for%20the%20FDF%20bit%20in%20the%26nbsp%3B%20CAN%20frame%20if%20the%20controller%20does%20not%20support%20it.%20Which%20is%20the%20case%20in%20this%20configuration.%3C%2FP%3E%3CP%3EIs%20this%20a%20known%20issue%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2324530%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20CAN-FD%20Protocol%20Exception%20on%20S32K396%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2324530%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThis%20is%20a%20custom%20driver%20built%20for%20our%20RTOS%20(rt-kernel%20%3CA%20href%3D%22https%3A%2F%2Frt-labs.com%2Fproduct%2Frtos%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Frt-labs.com%2Fproduct%2Frtos%2F%3C%2FA%3E)%20used%20in%20automotive%20domain.%20So%20it's%20based%20around%20the%20specifications%20of%20FlexCAN%20instead%20of%20your%20provided%20MCAL's.%3C%2FP%3E%3CP%3EWe%20have%20two%20variants.%20One%20based%20around%20legacy%20rx%20fifo%20and%20one%20based%20on%20extended%20rx%20fifo%20(for%20can-fd).%20But%20since%20the%204th%20can%20controller%20on%20S32K396%20does%20not%20supported%20extended%20fifo%2C%20we%20are%20using%20the%20older%20driver.%26nbsp%3B%3C%2FP%3E%3CP%3EGiven%20it's%20using%20legacy%20rx%20fifo%2C%20can-fd%20can%20not%20be%20enabled%2C%20but%20it%20should%20still%20be%20able%20to%20passively%2Fsilently%20participate%20in%20can-fd%20networks%20based%20on%20the%20protocol%20exception%20logic.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2324495%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20CAN-FD%20Protocol%20Exception%20on%20S32K396%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2324495%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F193152%22%20target%3D%22_blank%22%3E%40rtljopl%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EI%20am%20not%20aware%20of%20any%20open%20issue%20regarding%20protocol%20exception.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAre%20you%20able%20to%20share%20which%20RTD%20version%20you%20are%20using%3F%20Is%20this%20EB%20Tresos%2C%20S32DS%20or%20another%20configuration%20tool%3F%20I%20can%20ask%20the%20internal%20team%20for%20confirmation%20regarding%20this%20issue.%3C%2FP%3E%0A%3CP%3EIf%20possible%2C%20also%20please%20share%20the%20FlexCAN%20module%20configuration%2C%20to%20test%20this%20on%20my%20side.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EJuli%C3%A1n%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2325749%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20CAN-FD%20Protocol%20Exception%20on%20S32K396%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2325749%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F193152%22%20target%3D%22_blank%22%3E%40rtljopl%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EActually%2C%20looking%20a%20bit%20more%20into%20the%20Protocol%20Exception%20definition%20as%20per-ISO%2011898-1%3A2015%2C%20I%20do%20not%20think%20this%20configuration%20is%20relevant%20to%20your%20setup.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAccording%20to%20the%20international%20CAN%20conference%20(iCC)%3A%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3EWhen%20CAN%20FD%20was%20specified%20in%20ISO%2011898-1%3A2015%2C%20one%20bit%20was%20reserved%20for%20the%20future%20expansion%20of%20the%20protocol.%20This%20is%20the%20reserved%20bit%20after%20the%20FDF%20bit%2C%20which%20is%20expected%20to%20be%20dominant%20in%20CAN%20FD%20frames.%20When%20it%20is%20seen%20recessive%2C%20a%20CAN%20FD%20node%20will%20detect%20a%20protocol%20exception.%20Software%20configuration%20decides%20whether%20the%20node%20treats%20this%20as%20a%20form%20error%20or%20whether%20it%20enters%20the%20Protocol%20Exception%20State%2C%20where%20it%20will%20remain%20until%20the%20bus%20is%20idle%20again.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EProtocol%20Exception%20State%20(PES)%20is%20a%20mechanism%20for%20FD%E2%80%91capable%20nodes%20only.%20Its%20purpose%20is%20not%20to%20prevent%20Classical%20CAN%20nodes%20from%20reacting%20to%20FD%20frames%2C%20rather%20so%20that%20%3CSTRONG%3ECAN%E2%80%91FD%20nodes%3C%2FSTRONG%3E%20do%20not%20disturb%20CAN%E2%80%91XL%20frames.%3C%2FP%3E%0A%3CP%3EA%20classic%20controller%20receiving%20an%20FD%20frame%20will%20trigger%20an%20error%20frame%2C%20since%20the%20bit%20sequence%20on%20the%20bus%20does%20not%20make%20sense%20to%20it.%3C%2FP%3E%0A%3CP%3EUnless%20you%20use%20gateways%20for%20older%20classic%20CAN%20nodes%20in%20your%20bus%2C%26nbsp%3BClassical%20nodes%20will%20throw%20errors%20and%20go%20bus%E2%80%91off.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EJuli%C3%A1n%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2327373%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20CAN-FD%20Protocol%20Exception%20on%20S32K396%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2327373%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F193152%22%20target%3D%22_blank%22%3E%40rtljopl%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EI%20think%20being%20a%20CANFD-tolerant%20node%20is%20more%20dependent%20on%20the%20PHY.%20For%20example%2C%20TJA1145%20will%20see%20CAN%20FD%20frames%20as%20errors%2C%20while%26nbsp%3BTJA1145FD%20offers%20CAN%20FD%20passive%20functionality%2C%20judging%20the%20CAN%20FD%20frames%20as%20'valid'%2C%20regardless%20of%20what%20comes%20after%20the%20FDF%20bit%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Snag_18a88cb.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Snag_18a88cb.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Snag_18a88cb.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Snag_18a88cb.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F378477iD1BBB508531AB564%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Snag_18a88cb.png%22%20alt%3D%22Snag_18a88cb.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EJuli%C3%A1n%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2326968%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20CAN-FD%20Protocol%20Exception%20on%20S32K396%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2326968%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EBut%20is%20this%20node%20really%20a%20classical%20CAN%20node%3F%3C%2FP%3E%3CP%3EI%20suppose%20it%20could%20be%20considered%20that%20when%20CAN-FD%20feature%20is%20disabled%2C%20however%20i%20also%20assumed%20it%20could%20be%20run%20as%20a%20CAN-FD%20tolerant%20controller%20when%20not%20wanting%20to%20receive%20the%20CAN-FD%20frames.%3C%2FP%3E%3CP%3EBut%20okey.%20This%20won't%20be%20solvable%20by%20some%20hardware%20feature%20in%20our%20case%20anyway%2C%20so%20we%20have%20to%20figure%20out%20a%20workaround%20for%20CAN4%20channel%20without%20any%20fifo%20support.%3C%2FP%3E%3CP%3EThanks%20for%20the%20investigation.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2327642%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20CAN-FD%20Protocol%20Exception%20on%20S32K396%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2327642%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EYes%20we%20are%20using%20the%20FD%20variant%20of%20that%20TRCV.%3C%2FP%3E%3CP%3EHowever%2C%20the%20concept%20of%20%60tolerate%60%20there%20only%20applies%20to%20wakeup%20(we%20had%20missed%20that).%20So%20once%20the%20ECU%2FTRCV%20is%20up%20and%20running.%20CAN-FD%20frames%20are%20passed%20through%20to%20the%20controller%20independent%20on%20the%20TRCV%20setting.%20So%20the%20controller%20starts%20sending%20error%20frames%20even%20though%20in%20theory%20it's%20CAN-FD%20capable%20(thou%20disabled).%3C%2FP%3E%3CP%3EOnly%20way%20to%20handle%20it%20is%20to%20enable%20CAN-FD%20on%20the%20controller%20and%20in%20software%20(or%20probably%20hardware%20filters)%20filter%20out%20the%20CAN-FD%20frames.%20But%20then%20we%20are%20back%20to%20the%20problem%20of%20limited%20CAN-FD%20support%20in%20the%204th%20channel%20requiring%20rewritten%20drivers.%3C%2FP%3E%3C%2FLINGO-BODY%3E