Page 1 of 1

port from 2.6.x to 3.1.x : usb-cdc flush behavior

Posted: Tue Mar 15, 2016 6:01 pm
by alex31
Hello, i am in the process of porting all my stuff to ChibiOS 3.1. Most of the time, it works flawlessly.

With usb-cdc, i notice different behaviour between 2.6 and 3.1 :

2.6 : data is flushed after each chSequentialStreamWrite
3.1 : data is flushed only after the buffer of size SERIAL_USB_BUFFERS_SIZE if full

To let my application run, I have lowered SERIAL_USB_BUFFERS_SIZE, but it's not ideal,
is there any means to flush data after a chSequentialStreamWrite on usb-cdc ?

Thanks,
Alexandre

Re: port from 2.6.x to 3.1.x : usb-cdc flush behavior

Posted: Tue Mar 15, 2016 6:10 pm
by Giovanni
Hi,

Look at the latest demos, there is a new function to associate to the periodic USB callback, it flushes the buffer automatically. Examples are in any usbcfg.c file.

Giovanni

Re: port from 2.6.x to 3.1.x : usb-cdc flush behavior

Posted: Wed Mar 16, 2016 9:07 am
by alex31
Yes, the sduSOFHook stuff and associated callback do the job.

Thanks !

Alexandre