Thread (8 messages) 8 messages, 5 authors, 2012-09-09

Re: usb-can device

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: 2012-08-26 16:28:18

Hello Max,

On 08/26/2012 05:52 PM, Max S. wrote:
I am developing a usb to can adapter.

Does there exist a standard usb-can interface on the linux side? Or will
I have to create my own device driver?
There is no standard driver, however I was thinking last week that
someone should write a CDC CAN driver. CDC Ethernet is a standard to
send ethernet frames over USB.
In the linux kernel source I see drivers/net/can/ems_usb.c which seems
to provide a way to add support for multiple devices through the
ems_usb_table. What would it take to get my vendor id and product id
into this list (assuming that the device is working with this driver).

I haven't studied the driver in great detail, so i don't know if it is
appropriate for what I am trying to do...
I don't know what the legal department of ems will do, if you "clone"
their hardware, or build something that is compatible to their hardware
on the driver level.
What are my options for getting a usb device, that exposes two can
nodes, supported under linux? I have complete access to the usb device,
so it would not be a problem for me to build a firmware that behaves a
certain standard way.
The kvaser driver basically just sends and receives binary messages.
They have a common header (len+type of message+CAN interface) and the
message itself. There are messages to send and receive a CAN frame,
TX-complete, for error handling, and for configuration. If you want to
make your device's firmware update able, implement dfu (device firmware
update). Optional stuff is abort tx of CAN frames, timestamps for rx and tx.

Oliver, do you remember the talk about the CAN in FPGA we heart at the
CAN CIA conference, do you have a link to the presentation. It was FPGA
based, but all concept mentioned there also apply to USB based devices.

cheers, Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help