Re: Protocol recommendation for CAN(FD)-USB adapter

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

 



On 20.02.2024 19:44:21, Vincent MAILHOL wrote:
> On Tue. 20 Feb. 2024 at 17:35, Vincent Mailhol
> <vincent.mailhol@xxxxxxxxx> wrote:
> > On Tue. 20 Feb. 2024 at 17:10, Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> wrote:
> > >
> > > On 20.02.2024 08:49:26, Dr. Michael 'Mickey' Lauer wrote:
> > > > Hi Marc,
> > > >
> > > > >>
> > > > >> Sounds pretty cool. Our design is based on an ESP32-S3 though, so I
> > > > >> have to duplicate that effort. Is there some kind of USB protocol
> > > > >> definition for what gs-usb expects or do I need to learn that from the
> > > > >> implementation?
> > > > >
> > > > > I've put together a very rough summary of the driver's side of view:
> > > > >
> > > > > https://gist.github.com/marckleinebudde/99f72d9db67accf08cc6efa367cfe54b
> > > > >
> > > > > Feel free to update.
> > > >
> > > > Wow, that’s very kind of you!
> > >
> > > :)
> > >
> > > > Later this year I’ll take this blueprint to implement the necessary
> > > > changes in our firmware. I’ll enhance / update your summary
> > > > as I’ll go.
> > >
> > > If you discover any odd points or areas for improvement in the USB
> > > protocol, please let us know.
> > >
> > > Currently, TX-complete sends the _entire_ structure back to the host,
> > > which is quite an overhead, especially for CAN FD frames. We're working
> > > on a "short-tx-complete" feature.
> >
> > The es581.4 may be doing what you are looking for:
> >
> >   - When sending a frame, the driver attaches a 32 bit index:
> > https://elixir.bootlin.com/linux/v6.7/source/drivers/net/can/usb/etas_es58x/es581_4.h#L78
> >   - When receiving the TX completion message, the device just send
> > back that index and a timestamp:
> > https://elixir.bootlin.com/linux/v6.7/source/drivers/net/can/usb/etas_es58x/es581_4.h#L97
> >
> > The device is agnostic of what this index represents. The driver uses
> > the index from the can_put_echo_skb() / can_get_echo_skb().
> >
> > (in addition the driver can handle bulk send and receive but that's
> > another story).
> 
> I forgot to mention: it is also perfectly fine not to use the index as
> long as you can guarantee that the TX completion messages are received
> in order (which is not hard to achieve). In which case, the TX
> completion message can be as simple as just a timestamp.

ACK, but in the medium term I want to add a CTRL mode to switch CAN
devices into true "send CAN frames by prio" mode.

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

Attachment: signature.asc
Description: PGP signature


[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