Re: Queries on CAN frame work

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

 



Le ven. 14 janv. 2022 à 06:10, Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> a écrit :
>
> On 13.01.2022 21:30:04, Marc Kleine-Budde wrote:
> > > Recently we did few experiments with our CANFD network. Stuff error
> > > observed with different Nominal and Dataphase prescaler configuration
> > > values, which we get from the frame work.
> > >
> > > For lower baud rates separate prescalers are working good, but when we
> > > switch to high baud rates(like 4Mbps and 5Mbps) observed the BUSOFF
> > > state(Due to stuff errors) on IP(Xilinx).
> > >
> > > With shared prescaler(low prescalers) we are not seeing the issue..
> > >
> > > In Iso spec also mentioned to avoid tolerance, we have to maintain
> > > common TQ for Nominal and Data phase.
>
> This is a known problem with the current arbitration and data bit rate
> calculation. They are done independently of each other, resulting in not
> common pre-scalers and thus not common TQ.
>
> > > Spec: ISO 11898-1:2015(E)  page no :50
> > >
> > > " If the same time quantum length is used in the nominal bit time and
> > > in the data bit time and the positions of the sample points in the
> > > nominal bit time are the same in all CAN nodes of a network, then
> > > optimum clock tolerance is accomplished for networks using FD frames."
> > >
> > > CIA:
> > > https://can-newsletter.org/uploads/media/raw/f6a36d1461371a2f86ef0011a513712c.pdf
> > >
> > > From above CAN-newsletter also suggested the same in recommendation 2 and 3.
>
> I'll have a look at the newsletter and see what changes need to be done
> to the existing algorithm.
>
> > > Recommendation 2: Set the BRPA bit-rate prescaler equal BRPB
> > > Recommendation 3: Choose BRPA and BRPD as low as possible
> > >
> > > Is there any possibility in framework to use shared prescalars for
> > > Nominal and Dataphase?.
>
> Not yet.

Well, technically, skipping the full calculation and providing all
bittiming parameters will allow you to use shared prescalers. But
indeed, there is nothing to automatically calculate it nor to check the
sanity of manually provided bittiming parameters.

> > > One more question. How to calculate TDCO ?, is there any generic
> > > formula for this ?.
>
> Vincent (Cc'ed) can help you on this.

It is implemented in the kernel here:
https://elixir.bootlin.com/linux/latest/source/drivers/net/can/dev/bittiming.c#L178

You can refer to the patch description for additional info.
 * Original patch:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c25cc7993243fdc00ab7e608e3764819538015ab
 * Amended by:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=39f66c9e229797a58a12ea78388cbbad1f81aec9

N.B.: the comments of the original patch related to iproute2 are outdated.

If you follow the links in the patches you will find even more discussions
on this topic in the mailing list archives. But I guess that the commit
description is enough to answer your questions.

Also, please note that the xilinx driver does not yet implement TDC.
Actually, TDC netlink framework was introduced recently in the kernel and
as of today only the etas_es58x does support it.

By the way, Marc, did you get an answer from Microchip on the relative
TDCO topic for the mcp25xxfd?
c.f. https://lore.kernel.org/all/20210817094306.iyezzml6m7nlznri@xxxxxxxxxxxxxx/


Yours sincerely,
Vincent Mailhol



[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