The length of data sent by canfd is inconsistent

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

The length of data sent by canfd is inconsistent

Jump to solution
1,253 Views
vanaua
Contributor I

I got the following project file according to the NXP official canfd example, but when I used FLEXCAN0_transmit_msg, there were many zeros in the end, could you please tell me whether I sent the 8-bit length? How does it display 64 bits at the receiving terminal?

TIM截图20200402061256.jpg

TIM截图20200402061309.jpg

TIM截图20200402061355.jpg

TIM截图20200402061419.jpg

Labels (1)
Tags (2)
0 Kudos
1 Solution
1,137 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

use CAN0->RAMn[ 0*MSG_BUF_SIZE + 0] = 0xCC400000 | 8 << CAN_WMBn_CS_DLC_SHIFT;

or simply write

CAN0->RAMn[ 0*MSG_BUF_SIZE + 0] = 0xCC480000;

BR, Petr

View solution in original post

5 Replies
1,138 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

use CAN0->RAMn[ 0*MSG_BUF_SIZE + 0] = 0xCC400000 | 8 << CAN_WMBn_CS_DLC_SHIFT;

or simply write

CAN0->RAMn[ 0*MSG_BUF_SIZE + 0] = 0xCC480000;

BR, Petr

1,137 Views
vanaua
Contributor I

Thank you very much,your answer solved my puzzle

0 Kudos
1,137 Views
vanaua
Contributor I

does any bro can help me? Thanks

0 Kudos
1,137 Views
vanaua
Contributor I

pastedImage_1.png

0 Kudos
1,137 Views
vanaua
Contributor I

CAN0->RAMn[ 0*MSG_BUF_SIZE + 0] = 0xCC4F0000 | 8 << CAN_WMBn_CS_DLC_SHIFT;

It  seems that   DLC =8  doesn't work at all, and received length remains 64 。

0 Kudos