USB device stack and class drivers

Johann Fischer

Hi all,

I got closer with Zephyr USB device stack while I wrote USB device driver for
Kinetis [1]. There are a few things that are not optimal and which I would like
to improve.

* USB controllers like Kinetis USBFSOTG do not have a FIFO for the endpoints but
own DMA controller configured over a buffer descriptor table. Depending on the
number of endpoints, the endpoint buffer has to be configured in the driver
with little effort (and the buffer content is copied unnecessarily with every
ep_read and ep_write). Would it be acceptable to use memory slabs or memory
pools for the endpoint buffers?

* device stack does not handle the USB reset and does not re-initialize the
endpoints and it sets the device address before sending ACK with ZLP. Both
issues need workaround in device driver.

* the header files usb_common.h and usbstruct.h can be merged

* the class drivers in subsys/usb/class, each have their own complete device
descriptor, vid/pid and strings are not configurable, no composite device
support. The headers of the class drivers can also be used by USB host stack
(if there is one in the future) and I think these belong to include/usb. I
started here and there is a RFC PR [2].

* there are several USB device stack applications and class driver which are
in sample directory but can be moved to subsys/usb, for example dfu, webusb and
wpanusb. e.g. composite device consisting of dfu and wpanusb would be nice.

* wpanusb API looks based on atusb, but the interface is quite
different, where is the linux driver as a counterpart of it?


Best Regards,
Johann Fischer

Join to automatically receive all group messages.