CAN FD bit timings recommendations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Marc/Oliver,

I am getting a problem in flexcan driver when I use data bitrate of 8 MBPS in FD mode.
I am getting Transmit Errors for fast bits. The can clock that I am using is 175 MHz. The arbitration phase bitrate is 1 MBPS.
This error is not occurring when I use data bitrate of 5 MBPS.
I was checking the flexcan timings in error case, and I see that the bit rate prescaler (brp) value for arbitration phase and data phase is different.
bt->brp = 4, data_bt->brp = 1.

The flexcan driver receives these timings after calculations done in https://elixir.bootlin.com/linux/latest/source/drivers/net/can/dev.c#L125
It seems that this function calculates the brp just based on bitrate and It doesn't enforce that brp should be same for both arbitration and data phase.

This is in contrast to the bit timings recommendations for FD mode on CiA website. (18-1_p28_recommendation_for_the_canfd_bit-timing_holger_zeltwanger_cia.pdf)
Recommendation 2: Set the BRPA bit-rate prescaler equal BRPB This leads to identical tq values in both phases.
This prevents that during bit-rate switching inside the CAN FD data frame an existing quantization error can transform into a phase error.

Can you please look into this problem? The bittimings_const values are these

// Arbitration phase
static const struct can_bittiming_const extended_flexcan_bittiming_const = {
              .name = DRV_NAME,
              .tseg1_min = 2,
              .tseg1_max = 96,
              .tseg2_min = 2,
              .tseg2_max = 32,
              .sjw_max = 16,
              .brp_min = 1,
              .brp_max = 1024,
              .brp_inc = 1,
};

// Data phase
static const struct can_bittiming_const flexcan_data_bittiming_const = {
              .name = DRV_NAME,
              .tseg1_min = 2,
              .tseg1_max = 39,
              .tseg2_min = 2,
              .tseg2_max = 8,
              .sjw_max = 4,
              .brp_min = 1,
              .brp_max = 1024,
              .brp_inc = 1,
};

Regards,
Pankaj Bansal




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux