cancel
Showing results for 
Search instead for 
Did you mean: 

Any example on STM32F2xx with UVC?

ericyuanzhang9
Associate II
Posted on June 03, 2012 at 13:59

Hi,

Does anybody know if there is example on STM32F2xx to support UVC class? I checked USB lib provided by STM but only similar example (Audio with ISO out) provided and I do think there should be quite some works if I port Audio project towards UVC class, as for they indeed have some differences.

That would be good if you can share any idea on the implement method or materials could be shared, I appreciate it pretty much.

Basically I am doing a small demo to simulate a USB Camera by STM32F2xx, a real camera is plugged to DCMI I/F. What I am facing issue is USB Part with suppporting on UVC.

Thank you...

#uvc #usb
22 REPLIES 22
ericyuanzhang9
Associate II
Posted on June 03, 2012 at 18:34

can anyone help?

alok472
Associate II
Posted on June 06, 2012 at 04:00

i dont thing a ready Video class example is available.

participants in this forum can help ofcourse step by step

You want to use ISO EP or Bulk ? i guess bulk is more used.

ericyuanzhang9
Associate II
Posted on June 07, 2012 at 17:38

Hi Alokm.

Thank you to break silence. 🙂

Either Bulk and ISO can be okay for us, even bulk is quite popular for many of appllication, ISO still be proposal mainly for stream scenario.

In our case, we will use fastest implementation initially, eventually we prefer on bulk transfer as for we want to ensure data integrity.

Do you have working example of UVC descriptor? can be shared if any?

alok472
Associate II
Posted on June 09, 2012 at 09:56

i dont have a ready example of descriptors. However i found a PDF on

http://www.usb.org/developers/devclass_docs

ref to

USB_Video_Example_1.1

tsuneo
Senior
Posted on June 09, 2012 at 12:53

> Do you have working example of UVC descriptor? can be shared if any?

Search the keyword 'lsusb ''bInterfaceClass 14 Video''' on Goooogle.

You'll find Linux people post descriptors of many commercial UVC webcams.

Sony Visual Communication Camera

http://hpv.cc/~maty/tmp/vaio/p/lsusb

Chicony Electronics Co., Ltd. HP Webcam-101

http://www.randomprojects.org/wiki/HP_635/lsusb

Genesys Logic, Inc. USB 2.0 Camera

http://linux.seindal.dk/linux-upload/2009/02/lsusb-v.txt

etc.

Tsuneo

ericyuanzhang9
Associate II
Posted on June 12, 2012 at 05:48

Thanks Alokm.

I had uvc spec from USB Org and developed description according its example from ''USB_Video_Example 1.1.pdf'', now driver can be installed correctly as ''USB Video Device'' as attachment.

The problem is that when I try to open camera, error pop up. I thinking it is caused by FW as for no function response request ''GET_CUR'' and ''GET_INFO'' and so on.

I am using ''stm32_f105-07_f2_f4_usb-host-device_lib_2.1.0'' downloaded from ST website, and referring from AUDIO device example.

Questions are:

1. Do I need to do something like encode/decode on JPEG format before transferring data to PC, or I just send data with uncompressed format (RAW RGB) from sensor?

2. am I understanding correctly?

ericyuanzhang9
Associate II
Posted on June 12, 2012 at 05:51

Thank you, ChinZei.

Any idea on my new questions?

tsuneo
Senior
Posted on June 12, 2012 at 19:57

> I thinking it is caused by FW as for no function response request ''GET_CUR'' and ''GET_INFO'' and so on.

Just after Set_Configuration, Windows keep putting Get_Len/Info/Res/Min/Max/Def for each entity on the device.

> 1. Do I need to do something like encode/decode on JPEG format before transferring data to PC, or I just send data with uncompressed format (RAW RGB) from sensor?

Either MJPEG or uncompressed will do. Declare it on the format/frame descriptors, to show options to host. At start of streaming, host examines camera setting with Probe control(s), and it selects one of options with Commit control. Set_Interface switches the alternate streaming interface. And then, isoc IN transactions start. Regardless of compression method, a video frame is split into many chunks to carry over the isoc IN EP. Each chunk starts with 12-bytes payload header.

I recommend you to monitor USB traffic of a UVC webcam using a sniffer. And then, you'll know how it works. Also, compare the traffic with your device. Doesn't one of your friend have any UVC webcam? A sniffer, which can interpret UVC requests, helps you so much.

USBTrace (15 days trial)  http://www.sysnucleus.com/

Tsuneo

tsuneo
Senior
Posted on June 12, 2012 at 20:03

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6b3&d=%2Fa%2F0X0000000brQ%2FZxzc6JddjWHgUhdf3TJwOGjxsgIZW4PLq1TaxaF.3S8&asPdf=false