cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

ReBa_1054056
New Contributor

Hello,

We use the FX3S as part of a camera to store the recorded shots on a SD card. When USB is connected the images can be read from the internal SD card since the FX3S works as a USB Mass Storage Device. As Mass Storage device it can be accessed using the universally available drivers for all host operation systems. So no driver writing is needed.

When USB is disconnected the camera works standalone and records the shots on the SD card.

It has been requested to add a USB Video Class (uvc) device to the implementation of the FX3S firmware. In this situation the camera still records the shots to the SD card when USB is disconnected. But when USB is connected two devices should be presented to the operating system. The Mass Storage device for access to the SD card, and an USB Video Class device for direct access to the stream of shots (like a webcam).

Is there a way to present two devices descriptors to the operating system, like if there were two independent devices, with their own interfaces? So when connecting USB to the camera two devices are recognized and appear (under Windows or Linux) as a USB Mass Storage Device and as an Imaging Device.

Regards,

Rene

0 Likes
Reply
1 Solution
SrinathS_16
Moderator
Moderator

Hello Rene,

- Under the "Configuration Descriptor" section of the descriptor file, a new descriptor information has to be included to add the UVC interface. The length of the "Configuration Descriptor" and the "Number of interfaces" section has to be updated accordingly.

- The endpoints that are used in the UVC and MSC descriptors should not coincide.

- The endpoints must be configured in the device firmware.

- The functionalities for the new interface must be included in the firmware.

Best regards,

Srinath S

View solution in original post

0 Likes
Reply
3 Replies
SrinathS_16
Moderator
Moderator

Hello Rene,

- Yes, two devices can be presented to the host.

- The descriptor information has to be modified to add the UVC class specific descriptors.

- The endpoints have to be configured and the DMA channels have to be created between the GPIF II interface and the USB interface.

Please refer to AN75779 for UVC class implementation.

Best regards,

Srinath S

0 Likes
Reply
ReBa_1054056
New Contributor

Hello Srinath,

The AN75779 UVC class implementation contains (in cyfxuvcdesr.c) the high speed and super speed device descriptors: CyFxUSBDeviceDscr and CyFxUSBDeviceDscrSS. These are registered within CyFxUVCApplnInit() using:

     /* Register the USB device descriptors with the driver. */

     CyU3PUsbSetDesc (CY_U3P_USB_SET_HS_DEVICE_DESCR, NULL, (uint8_t *)CyFxUSBDeviceDscr);

     CyU3PUsbSetDesc (CY_U3P_USB_SET_SS_DEVICE_DESCR, NULL, (uint8_t *)CyFxUSBDeviceDscrSS);

The FX3SMassStorage implementation contains (in cymsc_dscr.c) the descriptors CyFxUSB20DeviceDscr and CyFxUSB30DeviceDscr, and these are registers within CyFxMscApplnInit() using:

     /* Register the USB descriptors. */

     apiRetStatus = CyU3PUsbSetDesc (CY_U3P_USB_SET_HS_DEVICE_DESCR, NULL, (uint8_t *)CyFxUSB20DeviceDscr);

           ...

     apiRetStatus = CyU3PUsbSetDesc(CY_U3P_USB_SET_SS_DEVICE_DESCR, NULL, (uint8_t *)CyFxUSB30DeviceDscr);

So one will overwrite the other when both are used, as both class implementations use the same value for desc_type of CyU3PUsbSetDesc. Is it?

How can this be combined? The device descriptor contains the device class, which is different for the UVC and MSC.

Regards,

Rene

0 Likes
Reply
SrinathS_16
Moderator
Moderator

Hello Rene,

- Under the "Configuration Descriptor" section of the descriptor file, a new descriptor information has to be included to add the UVC interface. The length of the "Configuration Descriptor" and the "Number of interfaces" section has to be updated accordingly.

- The endpoints that are used in the UVC and MSC descriptors should not coincide.

- The endpoints must be configured in the device firmware.

- The functionalities for the new interface must be included in the firmware.

Best regards,

Srinath S

View solution in original post

0 Likes
Reply