Other Parts Discussed in Thread: TCAN4550
Hello
I'm using TCAN4550EVM to my board by wired connection.
and I'm trying Linux Driver code (starting with lastest version.. 5.12.xxx).
Linux code provides a bit timing calcurate fuction ( can_calc_bittiming() ) and I tried that method.
TCAN4550EVM supplied 40MHz CAN clock and I tested CAN rate was 500 kHz, and FD data rate 2MHz.
according to Linux code, bittiming const was calcurate like this
static int can_get_bittiming(struct net_device *dev, struct can_bittiming *bt, const struct can_bittiming_const *btc, const u32 *bitrate_const, const unsigned int bitrate_const_cnt) { .... if (!bt->tq && bt->bitrate && btc) err = can_calc_bittiming(dev, bt, btc); .... }
I entered "bt->bitrate" like above value and "btc" value like by TI Linux code.
static const struct can_bittiming_const m_can_bittiming_const_31X = { .name = KBUILD_MODNAME, .tseg1_min = 2, /* Time segment 1 = prop_seg + phase_seg1 */ .tseg1_max = 256, .tseg2_min = 2, /* Time segment 2 = phase_seg2 */ .tseg2_max = 128, .sjw_max = 128, .brp_min = 1, .brp_max = 512, .brp_inc = 1, }; static const struct can_bittiming_const m_can_data_bittiming_const_31X = { .name = KBUILD_MODNAME, .tseg1_min = 1, /* Time segment 1 = prop_seg + phase_seg1 */ .tseg1_max = 32, .tseg2_min = 1, /* Time segment 2 = phase_seg2 */ .tseg2_max = 16, .sjw_max = 16, .brp_min = 1, .brp_max = 32, .brp_inc = 1, };
then bit timing calcurated like this:
bt timing : br:500000 brp:1, proseg:34 sjw:1 tseg1:35 tseg2:10 sp:875 tq:25
data bt timing : br:2000000 brp:1, proseg:7 sjw:1 tseg1:7 tseg2:5 sp:750 tq:25
then I tested that value, Normal CAN or CANFD signal was fine, but CANFD BRS signal was not works.
that means those calcurated data bi timing value was not works.
Q1) Is my method correct? when TI code development, what method was used?
Q2) Is those calcurated value correct?
Q3) could i get sample bit timing value like those setting?
thank you