cancel
Showing results for 
Search instead for 
Did you mean: 

I can't set the can_fd Data time in 8Mbps, what could be the problem? (STM32H753VIT6)

KDG
Associate III

Hi, I am currently trying to set the data time of the can_fd function to 8Mbps for can_fd communication.
However, when I set the data time to be 8Mbps, the communication does not proceed normally.
When I set the data time to 1,2,4,5 Mbps, it worked fine, but why does it not work when I set it to 8 Mbps?
I have attached the IOC file in the attachment.

+ i already tried to change the data times into  5/4 , 6/3 but it didn't worked

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @KDG ,

Watch this video on youtube, how to configure FDCAN timings especially @13:57

You need to use kvaser calculator from here: https://kvaser.com/support/calculators/can-fd-bit-timing-calculator/

Node delay to be put here:

SofLit_0-1726839757823.png

 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

7 REPLIES 7
LCE
Principal

You have to compensate the transceiver delay, there's a register setting for that.

No idea how to set this with Cube.

/* enable TDC = transmitter delay compensation
 *	this is a MUST for high data rates
 */
	/* configure Tx Delay Compensation : TdcOffset = DataTimeSeg1 * DataPrescaler */
	uint32_t u32TdcOffs = ((uint32_t)phCan->Instance->DBTP >> FDCAN_DBTP_DTSEG1_Pos) + 1;
	uint32_t u32TdcFltWdw = 0;

	/* set TDC filter window */
	phCan->Instance->TDCR = (u32TdcFltWdw << FDCAN_TDCR_TDCF_Pos);
	/* set TDC offset */
	phCan->Instance->TDCR |= (u32TdcOffs << FDCAN_TDCR_TDCO_Pos);
	/* enable TDC */
	phCan->Instance->DBTP |= FDCAN_DBTP_TDC;

 

SofLit
ST Employee

Hello,

You are using Normal mode.

What is the transceiver part number you are using? Is it supporting 8Mb/s bandwidth?

Did you try the Loopback mode?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
KDG
Associate III

The transceiver is TCAN341x, and it says it supports 8Mbps in its datasheet

"Support of classical CAN and optimized CAN FD performance at 2, 5, and 8 Mbps"

 

No, I didn't tried the Loopback mode, can it be used for this solution?

 

KDG
Associate III

In the datasheet it says

"Without transceiver delay compensation, the bitrate in the data phase of a CAN FD frame is limited by the transceivers loop delay"

you are saying that this could be the cause of my error?

KDG
Associate III

Ohh... so the transceiver delay compensation is needed when using the can fd data time which is over 5Mbps.

after when i added the transceiver delay compensation, a waveform with a size about 192ns is added before the err waveform occured. 

I think by adjusting the delay compensation setting, my problem could be solved, but I can't find the guidelines for setting it, Is there any guidelines for it?

LCE
Principal

It's all in the reference manual, and register description. It's all calculated as "mtq".

And it depends on the actual transceiver chip, which has its delay in ns usually in its datasheet.

Hello @KDG ,

Watch this video on youtube, how to configure FDCAN timings especially @13:57

You need to use kvaser calculator from here: https://kvaser.com/support/calculators/can-fd-bit-timing-calculator/

Node delay to be put here:

SofLit_0-1726839757823.png

 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.