Messages in this thread | | | Date | Sun, 31 Jul 2022 20:58:03 +0200 | From | Marc Kleine-Budde <> | Subject | Re: [RFC PATCH v3 8/9] can: slcan: add support to set bit time register (btr) |
| |
On 31.07.2022 17:54:01, Dario Binacchi wrote: > > If an adapter follows 100% the official firmware doc the BTR registers > > are interpreted as SJA1000 with 8 MHz CAN clock. > > I checked the sources and documentation of the usb adapter I used (i. > e. Https://www.fischl.de/usbtin/): > ... > sxxyyzz[CR] Set can bitrate registers of MCP2515. You > can set non-standard baudrates which are not supported by the "Sx" > command.
I hope the effective clock speed is documented somewhere, as you need this information to set the registers.
> xx: CNF1 as hexadecimal value (00-FF) > yy: CNF2 as hexadecimal value (00-FF) > zz: CNF3 as hexadecimal value > ... > > Different from what is reported by can232_ver3_Manual.pdf : > > sxxyy[CR] Setup with BTR0/BTR1 CAN bit-rates where xx and yy is a hex > value. This command is only active if the CAN > > And here is the type of control carried out by the slcan_attach for > the btr parameter: > https://github.com/linux-can/can-utils/blob/master/slcan_attach.c#L144 > When I would have expected a different check (i. e. if (strlen(btr) > 4). > Therefore it is possible that each adapter uses these bytes in its own > way as well as > in the content and also in the number of bytes.
I expected something like that.
regards, Marc
-- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | [unhandled content-type:application/pgp-signature] | |