How to receive CAN message with different DLC?(CAN FD payload size const to 64 byte)

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

How to receive CAN message with different DLC?(CAN FD payload size const to 64 byte)

2,246 Views
zhanlong_xu
Contributor II

Now I develop in S32R272 and I need to receive some CAN messages with DLC64 and a diagnostic message with DLC8, this diagnostic message is used for UDS function.

1.I config the payload size to 64 with CAN FD,then set the diagnostic request/response CAN message with DLC8;

2.I use CANoe transmit a diagnostic request message with DLC8 and waiting the ecu to receive this diagnostic request;

3.I find that when receive the DLC8 message, software stop run. I don't know why it happened.

If payload size was configured to 64, all received message's DLC should equal to 64?

Can I set the mixed dlc messages?

Ps: If the ECU has ever received/transmitted a 64byte can message, then receive a 8 byte message, it works normal.

If the ECU has never received/transmitted a 64byte can message, it stop working when received a 8 byte message first time.

4 Replies

2,169 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I do not know s32r272 device, should it be s32r372?

Anyway; mixed DLC messages are possible. Base on your PS message it looks this is due to insufficient FlexCAN memory initialization when ECC is enabled. By default this ECC is enabled and proper memory init must be done as stated in RM's "Detection and Correction of Memory Errors" chapter.

BR, Petr

0 Kudos

2,169 Views
zhanlong_xu
Contributor II

Dear Petr,

After I set CAN_MECR->ECCDIS to 1, ECU works well. It can receive DLC8 diagnostic request message and  response ok.

Will it cause other problems if  I set ECCDIS to 1?

0 Kudos

2,169 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

no, just the error detection and correction mechanism will be disabled.

BR, Petr

0 Kudos

2,169 Views
zhanlong_xu
Contributor II

Dear Stancik,

Thank you very much.The device is S32R274. 

The FlexCAN memory is too small? Where can I set the memory?

0 Kudos