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.
Solved! Go to Solution.
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.
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.
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.
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.
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 enable | loopback disable | |
kFLEXCAN_8BperMB | Pass | Pass |
kFLEXCAN_16BperMB | Pass | Pass |
kFLEXCAN_32BperMB | Pass | Pass |
kFLEXCAN_64BperMB | Fail | Fail |
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:
Is is same as your side?
Best regards,
Christine.
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.
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.
Hi @Christine_Li m
Thank for you kindly support.
When this issue have further step, please let me know.
Best Regards,
Adam
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.