Page 1 of 1

bulk usb/ serial_usb

Posted: Thu May 07, 2015 9:52 pm
by geoffrey.brown
I was interested in creating a bulk usb device (not full serial) and started with the examples in :

https://github.com/fpoussin/ChibiOS-Examples

In the process, I noticed that the only thing preventing me from simply using serial_usb was the assumption in
sduStart and sduStop that the interrupt endpoint be > 0. I made the following changes:

in sduStart:

if (config->int_in > 0)
usbp->in_params[config->int_in - 1U] = sdup;

in sduStop:

if (sdup->config->int_in > 0)
usbp->in_params[sdup->config->int_in - 1U] = NULL;

Now to create a bulk device, I initialize a serial_usb device without the interrupt endpoint. Of course, the usb device descriptor needs to change as well.

It seems this might be a generally useful tweak to the serial_usb device.

Geoffrey

Re: bulk usb/ serial_usb

Posted: Fri May 08, 2015 10:24 am
by Giovanni
Hi,

Good suggestion, change committed on trunk.

Giovanni