Hello Marc and others, On Friday 18 of March 2022 15:49:13 Marc Kleine-Budde wrote: > The CiA (CAN into Automation) lists in their Newsletter 1/2018 in the > "Recommendation for the CAN FD bit-timing" [1] article several > > recommendations, one of them is: > | Recommendation 3: Choose BRPA and BRPD as low as possible > > [1] > https://can-newsletter.org/uploads/media/raw/f6a36d1461371a2f86ef0011a51371 >2c.pdf > > With the current bit timing algorithm Srinivas Neeli noticed that on > the Xilinx Versal ACAP board the CAN data bit timing parameters are > not calculated optimally. For most bit rates, the bit rate > prescaler (BRP) is != 1, although it's possible to configure the I have already thought about algorithm and optimal number of bitquanta per bittime. In the fact, I think than original LinCAN algorithm version which I have provided for SocketCAN used reversed preference for BPR. But I think that too small or too big ratio is bad. So for our actual NuttX ESP32C3 driver developed by our studnet Jan Charvat, I consider to add some mechanism how to specify optimal bitquanta per bittime ratio. The question is if that should be additional parameter in the struct can_bittiming_const https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/can/netlink.h#L47 or if that should be some constant defined for data bitrate and probably the second for arbitration bitrate. If there is interrest I try to provide some patch which would prefer the nearest suitable BPR to optimal timequanta to bittime ratio. Best wishes, Pavel -- Pavel Pisa phone: +420 603531357 e-mail: pisa@xxxxxxxxxxxxxxxx Department of Control Engineering FEE CVUT Karlovo namesti 13, 121 35, Prague 2 university: http://dce.fel.cvut.cz/ personal: http://cmp.felk.cvut.cz/~pisa projects: https://www.openhub.net/accounts/ppisa CAN related:http://canbus.pages.fel.cvut.cz/ Open Technologies Research Education and Exchange Services https://gitlab.fel.cvut.cz/otrees/org/-/wikis/home