Hi @alan-p
So, in your side, loopback mode, 500K/5M and 250K/5M also send and recive works, right?
The issue just happen when test between two RT1064 or one RT1064+CANAlyzer, right?
When you test 500K/5M, 250K/5M, please test it like this:
1. CANFD souce clock use 30M instead of 8M
#define FLEXCAN_CLOCK_SOURCE_DIVIDER (1U)
2.
#define SET_CAN_QUANTUM 1/* change*/
#define PSEG1 3
#define PSEG2 2
#define PROPSEG 1
#define FPSEG1 1/* change*/
#define FPSEG2 1/* change*/
#define FPROPSEG 1/* change*/
Add the following code in FLEXCAN_FDInit.
fdctrl |= CAN_FDCTRL_TDCEN_MASK;/* change *
activating the TDC bit in the FDCTRL register.
This bit has to be turned ON only when you want to have a baudrate greater than 2.5Mbps.
Your 500K 5M situation, I have tested in the previous time.
Please check my attached code.
I even write a chinese document about it:
https://www.nxpic.org.cn/module/forum/thread-622319-1-1.html
You can see 500K/5M works.
I also test:
My test result:
Case 1: the arbitration baudrate is 1Mbit/s, and data baudrate is 5Mbit/s, ->work
PRESDIV = 2, when arbitration baudrate is 1Mbit/s.
flexcanConfig.baudRate = 1000000U;
flexcanConfig.baudRateFD = 5000000U;/* change*/
Case 2: the arbitration baudrate is 500Kbit/s, and data baudrate is 5Mbit/s, ->work
PRESDIV = 5, when arbitration baudrate is 500Kbit/s,
flexcanConfig.baudRate = 500000U;
flexcanConfig.baudRateFD = 5000000U;/* change*/s
Case 3: the arbitration baudrate is 250Kbit/s, and data baudrate is 5Mbit/s, ->work
PRESDIV = 11, when arbitration baudrate is 250Kbit/s,
flexcanConfig.baudRate = 250000U;
flexcanConfig.baudRateFD = 5000000U;/* change*/
Case 4: the arbitration baudrate is 125Kbit/s, and data baudrate is 5Mbit/s, ->work
PRESDIV = 23, when arbitration baudrate is 125Kbit/s,
flexcanConfig.baudRate = 125000U;
flexcanConfig.baudRateFD = 5000000U;/* change*/
Although it is for RT1060-EVK, your RT1064 is the same.
Wish it helps you!
Best Regards,
Kerry