KW38 CAN-FD 64bytes

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
2,063件の閲覧回数
Adam_Ho
Contributor II

Hi, 

I am using sample project "frdmkw38_flexcan_interrupt_transfer" to try CAN-FD.

If I want to send 64 bytes data through, I set "DLC" as 15.

In loopback mode, I send 64 bytes data, but I only receive 16 bytes.

Is there any configuration I miss?

Thanks.

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
1,857件の閲覧回数
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Adam_Ho 

#define RX_MESSAGE_BUFFER_NUM (6)
#define TX_MESSAGE_BUFFER_NUM (5)

If use kFLEXCAN_64BperMB, the Maximum MBs is 7.

So the "RX_MESSAGE_BUFFER_NUM" and "TX_MESSAGE_BUFFER_NUM"  should less than 7. Pleas set "RX_MESSAGE_BUFFER_NUM" to 6, and "TX_MESSAGE_BUFFER_NUM" to 5, then the system would work normally.

I tested it on my side, it is ok. Please try it on your side and let me know your results.

Best regards,

Christine.

元の投稿で解決策を見る

タグ(1)
0 件の賞賛
返信
12 返答(返信)
2,043件の閲覧回数
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Adam_Ho 

Thanks for creating case to us and hope you are doing well.

I checked our SDK code, and may I ask whether you only modified DLC from 10 to 15 or also changed DWORD_IN_MB and BYTES_IN_MB?

For your information:

Dword in each message buffer, Length of data in bytes, Payload size must align,

and the Message Buffers are limited corresponding to each payload configuration.

 

So please also modified DWORD_IN_MB and BYTES_IN_MB to the one related to DLC to have a try.

 

Best regards,

Christine.

タグ(1)
0 件の賞賛
返信
2,032件の閲覧回数
Adam_Ho
Contributor II

Hi @Christine_Li ,

I modify the parameters to fit "kFLEXCAN_64BperMB", but seems not work.

If I use "kFLEXCAN_32BperMB", it is work.

Please give me more hint. 

Thanks.

Adam_Ho_0-1715164197494.png

Adam_Ho_1-1715164218949.png

 

0 件の賞賛
返信
2,003件の閲覧回数
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Adam_Ho 

Thanks for your feedback.

I checked your current settings, and also checked our Reference Manual.

In reception, this DLC field is written by the FlexCAN module, copied from the DLC (Data Length Code) field of the received frame.
In transmission, this DLC field is written by the CPU and corresponds to the DLC field value of the frame to be transmitted.

I think it should be matched with below:

 *    DWORD_IN_MB    DLC    BYTES_IN_MB             Maximum MBs
 *    2              8      kFLEXCAN_8BperMB        32
 *    4              10     kFLEXCAN_16BperMB       21
 *    8              13     kFLEXCAN_32BperMB       12
 *    16             15     kFLEXCAN_64BperMB       7

 

May I ask whether it can work well with below? It only has problem when you use in 64Byte, am I right?

Or you didn't tried 8Bytes and 32Bytes?

 

 *    DWORD_IN_MB    DLC    BYTES_IN_MB             Maximum MBs
 *    2              8      kFLEXCAN_8BperMB        32
 *    8              13     kFLEXCAN_32BperMB       12

 

How about disable loop back mode?

Best regards,

Christine.

 

タグ(1)
0 件の賞賛
返信
1,994件の閲覧回数
Adam_Ho
Contributor II

Hi @Christine_Li ,

I check all the parameter in Table. and the result is in below.

Yes, It's only have problem in 64Byte.

I think the problem is on Rx buffer size, maybe this is the clue to find out the result.

I attach the source code for loopback mode, and comment the place I configurate.

You can find the place by //TODO: adam_test 

 loopback enableloopback disable
kFLEXCAN_8BperMBPassPass
kFLEXCAN_16BperMBPassPass
kFLEXCAN_32BperMBPassPass
kFLEXCAN_64BperMBFailFail
0 件の賞賛
返信
1,979件の閲覧回数
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Adam_Ho 

Did you connect 12V power supply on J32 of the two boards?

I checked the Readme, it mentioned this point.

And also I am trying on my local side to repro this issue.

 

Best regards,

Christine.

 

タグ(1)
0 件の賞賛
返信
1,975件の閲覧回数
Adam_Ho
Contributor II

Hi @Christine_Li ,

Yes, I am using 12V as power voltage.

Thanks.

 

Best Regards, 

Adam

0 件の賞賛
返信
1,957件の閲覧回数
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Adam_Ho 

Thanks for your reply.

Just to confirm with you, after you change all parameters related to 64Bytes, then the board doesn't have any response, am I right?

I am trying to reproduce your issue, and above is what I saw on my two boards(one as TX, one as RX).

But when I changed back to 32Bytes related parameters, it can work properly.

Error phenomenon is like below:

Christine_Li_1-1715336105257.png

Is is same as your side?

 

Best regards,

Christine.

 

タグ(1)
0 件の賞賛
返信
1,953件の閲覧回数
Adam_Ho
Contributor II

Hi @Christine_Li ,

Yes, you reproduce  my issue.

I think Rx buffer size is wrong, so system in 64Bytes parameter when rx data  coming system go to wrong address.

Then system halt.

 

0 件の賞賛
返信
1,947件の閲覧回数
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Adam_Ho 

Thanks for your quick reply.

I can't agree with you more.

I will create an internal case to track further.

Once receive any response from our internal team, I will share with you.

Thanks again for creating such an important issue to us, it give a great chance to make us better.

Have a nice weekend!

 

Best regards,

Christine.

タグ(1)
0 件の賞賛
返信
1,942件の閲覧回数
Adam_Ho
Contributor II

Hi @Christine_Li m 

Thank for you kindly support.

When this issue have further step, please let me know.

Best Regards, 

Adam

0 件の賞賛
返信
1,858件の閲覧回数
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Adam_Ho 

#define RX_MESSAGE_BUFFER_NUM (6)
#define TX_MESSAGE_BUFFER_NUM (5)

If use kFLEXCAN_64BperMB, the Maximum MBs is 7.

So the "RX_MESSAGE_BUFFER_NUM" and "TX_MESSAGE_BUFFER_NUM"  should less than 7. Pleas set "RX_MESSAGE_BUFFER_NUM" to 6, and "TX_MESSAGE_BUFFER_NUM" to 5, then the system would work normally.

I tested it on my side, it is ok. Please try it on your side and let me know your results.

Best regards,

Christine.

タグ(1)
0 件の賞賛
返信
1,849件の閲覧回数
Adam_Ho
Contributor II

@Christine_Li 

Thanks, 

It's work.

 

Best  Regards, 

Adam

0 件の賞賛
返信