bulk usb/ serial_usb

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
Post Reply
geoffrey.brown
Posts: 122
Joined: Thu May 07, 2015 9:47 pm
Has thanked: 3 times
Been thanked: 18 times

bulk usb/ serial_usb

Post 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
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: bulk usb/ serial_usb

Post by Giovanni »

Hi,

Good suggestion, change committed on trunk.

Giovanni
Post Reply