MPC5748G CAN-FD bit timing

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

MPC5748G CAN-FD bit timing

2,099 Views
antoniograu
Contributor II

Hi,

 

I have a couple of questions. I´m using a MPC5748G and I want to change the bit timming when using CAN-FD mode.

Currently I have CAN-FD working with 500kbps arbritation and 2000Kbps Data Phase working.

 

Now I want to change the sample point to make some tests.

Is there any document like "FlexCANbitTiming.pdf" but for CAN-FD?

 

I understood from Reference Manual that CAN-FD arbitration bit timing is affected by CAN_CTRL1 or CAN_CBT and data phase is affected only by register CAN_FDCBT, right?

 

As far I understood, the CRC on the register is filled at TX: "This register is updated at the same time the Tx Interrupt Flag is asserted."

Is the CAN module checking also the CRC of received frames? Is there a code to calculate CRC of CANFD frames of a non-iso can-fd?

 

Thanks in advance,


Antonio

Labels (1)
4 Replies

1,461 Views
alexvinchev
Contributor V

antoniograu​, you might want to look at this topic as well, especially answer from lukaszadrapa​:

https://community.nxp.com/thread/377680#comment-575999

CRC calculation of MPC5748G is compliant up to certain version of CAN-FD specification, for later specification, you(we)'ll need newer cut of the devices...

0 Kudos

1,461 Views
antoniograu
Contributor II

Yes, I had this discussion last year when I received Cut2. It was a mistake in CAN-FD specification. :smileysad:

1,461 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

Q: Is there any document like "FlexCANbitTiming.pdf" but for CAN-FD?

A: unfortunately not. You should use an info stated within Reference Manual or CAN-FD specification.

Q: I understood from Reference Manual that CAN-FD arbitration bit timing is affected by CAN_CTRL1 or CAN_CBT and data phase is affected only by register CAN_FDCBT, right?

A: Yes, you are right.

Q: Is the CAN module checking also the CRC of received frames? Is there a code to calculate CRC of CAN-FD frames of a non-iso can-fd?

A: There are different CRC polynomials for different CAN frame formats.

- CRC_15 … used for all frames in Classical CAN format.

- CRC_17 … used for frames in CAN FD format with a data field up to 16 bytes long.

- CRC_21 … used for frames in CAN FD format with a data field longer than 16 sixteen bytes.

The receivers use the same polynomial to calculate the check sum from the bits as seen on the bus-lines. Thus when receiving a message, FlexCAN decodes EDL and DLC to select the adequate CRC polynomial to check for a CRC error.

BR, Petr

0 Kudos

1,461 Views
antoniograu
Contributor II

Hi Petr,

thanks for your answer.

About the CRC Thema for CAN_FD frames with BRS (Bite Rate Switch) activated:

I´m sending CAN-FD with fixed DLC =15 from FlexCAN1 to FlexCAN2, 3, 4 and 5. So CRC21 will be used.

I can see the register CAN_FDCRC of CAN1 is updated every time a frame is sent.

What I want is to compare the CRC_FD from my CAN1 with the CRC_FD received on the other channels.

My question is:

Is FlexCAN module only showing CRC or CRC-FD errors at Transmission time? Is it possible to check CRC errors at receiving? 

CAN-FD CRC.PNG

Thanks!

0 Kudos