Page 1 of 1

Usb serial bursting data since move to 16.1

Posted: Mon Feb 22, 2016 6:52 pm
by totalkrill
Hello!

I have been using the serialusbdriver on my stm32f4 in conjunction with the chprintf functionality. It has been working fine when i was on the stable_3.0 branch.

Now when i am using the same code, the usb is sending unevenly, it now only sends data over the USB in chunks of ~250 bytes.

This is happening even if i skip the chprintf and use:

Code: Select all

chSequentialStreamWrite(&SDU1,"sometext",8); 

as well.

Is there anything i need to change between 3.0 and 16.1 to use the SerialUSBDriver?

Re: Usb serial bursting data since move to 16.1

Posted: Mon Feb 22, 2016 10:19 pm
by Giovanni
Look at the demos, there is one more function to call from the periodic callback: usbcfg.c.

Code: Select all

static void sof_handler(USBDriver *usbp) {

  (void)usbp;

  osalSysLockFromISR();
  sduSOFHookI(&SDU1);
  osalSysUnlockFromISR();
}

/*
 * USB driver configuration.
 */
const USBConfig usbcfg = {
  usb_event,
  get_descriptor,
  sduRequestsHook,
  sof_handler /* THIS IS NEW */
};


Giovanni

Re: Usb serial bursting data since move to 16.1

Posted: Tue Feb 23, 2016 4:11 pm
by totalkrill
Now everything works as it did before again, thank you!