Zephyr CAN-USB Support #78812
-
Dear Zephyr RTOS community, I would like to propose adding Zephyr's own CAN-USB driver with SocketCAN for Linux support to the project. It would include following steps:
Adding Zephyr's own CAN-USB implementation shall open following opportunities:
CAN-USB is widely used for CAN-Bus data logging/tarnsmission over USB to the host PC. One of the examples is a PEAK-CAN-USB device series with according open-source linux kernel driver. Bofore I begin with the implementation I have following open questions to USB (@jfischer-no) and CAN (@henrikbrixandersen) maintainers:
Thank you all. Appendix:
CANnectivity is very well done and already has a good performance, but is maintained outside of Zephyr RTOS. It's huge advantage albite the others - it brings own USB VID:PID. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
@KozhinovAlexander is the suggestion to develop a new USB-CAN driver from scratch? USB protocol, kernel driver(s), tooling etc? Seems like a lot of duplicated effort considering the popularity of gs_usb solutions out there. There seem to be an interest into merging back the CANnectivity implementation down the road, that seems like a more effective solution to me. Is there any drawback of that beside having the protocol part out-of-tree right now? |
Beta Was this translation helpful? Give feedback.
-
There's no technical reasons why two different can-usb implementations could not live in the code base, but for the sake of code maintainability I think one would rather avoid it and only have to maintain a single one. I could understand if it was two well known standard, but in this case there's an existing widely adopted one (gs_usb) and nothing else, I would not start developing a second one unless you find a fundamental protocol flaw in the existing protocol that justifies developing a new one. There's a precedence of this in the code base by the way, there are two USB-ethernet protocols (CDC-ECM and RNDIS) implemented in the USB stack and one of those is going to not be ported to the new stack. In my opinion this effort would only make sense if there was a class defined protocol (a CDC-CAN of some sort) to be implemented. |
Beta Was this translation helpful? Give feedback.
-
@henrikbrixandersen @fabiobaltieri Thank you a lot for this great discussion and also for your convince work. I've got your points, I see your experience, I agree with a lot you say, but some stuff I see different. But, hey, this is how it works. |
Beta Was this translation helpful? Give feedback.
There's no technical reasons why two different can-usb implementations could not live in the code base, but for the sake of code maintainability I think one would rather avoid it and only have to maintain a single one. I could understand if it was two well known standard, but in this case there's an existing widely adopted one (gs_usb) and nothing else, I would not start developing a second one unless you find a fundamental protocol flaw in the existing protocol that justifies developing a new one.
There's a precedence of this in the code base by the way, there are two USB-ethernet protocols (CDC-ECM and RNDIS) implemented in the USB stack and one of those is going to not be ported to the…