FX3 USB3 Explorer Kit

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
adki_3154446
Level 1
Level 1
5 replies posted 5 questions asked First reply posted

Hi,

We use FX3 USB3 Explorer Kit to simulate USB camera (USBIsoSourceSink project), in a real USB web cam, we able to see flickering pictures when the time_service_interval > 125us (according to the USB3 spec, the time interval between ITP packets should be 125us).

we trying to reproduce the flickering issues with the FX3 device and we are using the streamer app form the SDK, failure counter keep be 0.

We saw in the FinishXfer function that the fail criteria\error is depend on USBDstatus, NtStatus and the result of the function GetOverLappedResult() function,

there is any way to give us indication to detect that the time_service_interval > 125us?

if no, is there any way to detect that the time_service_interval > 125us?

thank you and have a nice day,

A.K

0 Likes
1 Solution

Hello Adam,

This API creates an application timer than can be configured as a one-shot timer or as a auto-reload timer.

uint32_t CyU3PTimerCreate ( CyU3PTimer timer_p, CyU3PTimerCb_t expirationFunction, uint32_t

expirationInput, uint32_t initialTicks, uint32_t rescheduleTicks, uint32_t timerOption )

para.PNG

Note: If you configure last parameter i.e. timeOption as CYU3P_NO_ACTIVATE, timer needs to be started explicitly using uint32_t CyU3PTimerStart ( CyU3PTimer  timer_p ) API.

As per this KBA  EZ-USB® FX3™ Timer Ticks – KBA93074  The default value of one timer tick is 1 millisecond. So, value passed to parameter initialTicks needs to be a timer value in milliseconds.

We do not have any API to create or set the timer in micro seconds. As the timer value can be given in milliseconds and not micro seconds, the number of ITP events can be tracked in 1 millisecond by using this timer and keeping the initialTicks as 1 millisecond  and then get the time for 1 ITP event.

You can refer to cyfxbulksrcsink example firmware in the SDK which implements timer and similarly implement the timer to get time of ITP events.

Path: SDK Installation Path\Cypress\EZ-USB FX3 SDK\1.3\firmware\basic_examples\cyfxbulksrcsink

You can also refer to FX3 API Guide from the SDK

Path: SDK Installation Path\Cypress\EZ-USB FX3 SDK\1.3\doc\firmware

Please confirm that when bInterval is 1 (i.e 125 us) are you able to stream properly or with glitches ?

Let me know if any queries on this

Regards,

Rashi

Regards,
Rashi

View solution in original post

0 Likes
8 Replies
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

The ITP events (CY_U3P_USB_EVENT_SOF_ITP) can be tracked in CyFxIsoSrcSinkApplnUSBEventCB callback function. These ITP events are enabled by calling this API CyU3PUsbEnableITPEvent (CyTrue); These events and API are used in the default firmware USBIsoSourceSink in the SDK

To check the occurrence of the ITP you can set timer or use CyU3PGetTime API to get the time difference between two ITP events.

As the main problem is video flickering, please let me know the bInterval value in the descriptors and how much data (bytes/interval) is sent through the endpoint

Please let me know if any query on this

Regards,

Rashi

Regards,
Rashi
0 Likes

Hi Rashi,

thank you for the explanation and for the help .

i copied here the ISOC EP descriptor:

        ----------------- Endpoint Descriptor -----------------

bLength                  : 0x07 (7 bytes)

bDescriptorType          : 0x05 (Endpoint Descriptor)

bEndpointAddress         : 0x03 (Direction=OUT EndpointID=3)

bmAttributes             : 0x01 (TransferType=Isochronous  SyncType=None  EndpointType=Data)

wMaxPacketSize           : 0x0400

Bits 15..13             : 0x00 (reserved, must be zero)

Bits 12..11             : 0x00 (0 additional transactions per microframe -> allows 1..1024 bytes per packet)

Bits 10..0              : 0x400 (1024 bytes per packet)

bInterval                : 0x01 (1 ms)

        ------ SuperSpeed Endpoint Companion Descriptor -------

bLength                  : 0x06 (6 bytes)

bDescriptorType          : 0x30 (SuperSpeed Endpoint Companion Descriptor)

bMaxBurst                : 0x0E (up to 15 packets per burst)

bmAttributes             : 0x01 (max 28 packets within a service interval)

wBytesPerInterval        : 0x7800 (reserved bus time = 3840000 µs)

about the data (bytes/interval) that sent through the endpoint im not sure that i understood the calculation that i saw in this descriptor do you have any explanation for that?

appreciate it a lot.

thank you and have a good day,

Adam.

0 Likes

also i have another question:

After adding time calculation between ITP events in FW, how can we read it in C# application?

After adding time calculation between ITP events in FW, how can we read it in C# application?

0 Likes

Hello,

bInterval                : 0x01 (1 ms)  /// 125 us

An isochronous transfer can specify the service interval as ( 2 ^ (bInterval-1)) x 125 µs, where bInterval ranges from 1 to 16. SuperSpeed isochronous transfer type can move up to 1024 x 16 x 3 bytes per service interval. Taking the minimum service interval as 125 µs, the maximum theoretical bandwidth for SuperSpeed isochronous transfer can be calculated as (maximum packet size * burst size * number of iso-packets / service interval). That works out to 1024 x 16 x 3 / 125µ bytes/s or 375 MBps (3 Gb/s).

From the endpoint descriptors, i observed that endpoint size is equal to the bytes/ interval (i.e. 30 KB each) which is fine. Please confirm that when bInterval is 1 (i.e 125 us) are you able to stream properly or with glitches.

After adding time calculation between ITP events in FW, how can we read it in C# application?

>> Please confirm that the video application that you are using is UVC compliant or a non UVC application.

If the application is non UVC vendor commands can be used to communicate with the firmware. Please refer to this thread How to communicate with firmware? which explains communication through vendor commands.

For UVC complaint application the user defined communication (sending ITP events) can be done using extension unit.

Please let me know if any queries on this

Regards,

Rashi

Regards,
Rashi
0 Likes

Hi Rashi

CyU3PGetTime() function returns time in milliseconds resolution, so if we calculate time between ITP events we can’t get resolution of microseconds.

I understand that there is option to achieve this with CyU3PTimerCreate function, what parameters should we pass to this function to start timer in microseconds?

thanks and have a good day,

Adam.

0 Likes

Hello Adam,

This API creates an application timer than can be configured as a one-shot timer or as a auto-reload timer.

uint32_t CyU3PTimerCreate ( CyU3PTimer timer_p, CyU3PTimerCb_t expirationFunction, uint32_t

expirationInput, uint32_t initialTicks, uint32_t rescheduleTicks, uint32_t timerOption )

para.PNG

Note: If you configure last parameter i.e. timeOption as CYU3P_NO_ACTIVATE, timer needs to be started explicitly using uint32_t CyU3PTimerStart ( CyU3PTimer  timer_p ) API.

As per this KBA  EZ-USB® FX3™ Timer Ticks – KBA93074  The default value of one timer tick is 1 millisecond. So, value passed to parameter initialTicks needs to be a timer value in milliseconds.

We do not have any API to create or set the timer in micro seconds. As the timer value can be given in milliseconds and not micro seconds, the number of ITP events can be tracked in 1 millisecond by using this timer and keeping the initialTicks as 1 millisecond  and then get the time for 1 ITP event.

You can refer to cyfxbulksrcsink example firmware in the SDK which implements timer and similarly implement the timer to get time of ITP events.

Path: SDK Installation Path\Cypress\EZ-USB FX3 SDK\1.3\firmware\basic_examples\cyfxbulksrcsink

You can also refer to FX3 API Guide from the SDK

Path: SDK Installation Path\Cypress\EZ-USB FX3 SDK\1.3\doc\firmware

Please confirm that when bInterval is 1 (i.e 125 us) are you able to stream properly or with glitches ?

Let me know if any queries on this

Regards,

Rashi

Regards,
Rashi
0 Likes

Hi Rashi,

thanks for the answer.

so yes, the binterval is 1m, i can stream properly and also i cant see that there is any glitches using USB Lecroy Trace, i can see that every 125us the data packets from the device is sent properly.

so as i understood we dont have any way to check that the ITP events are exactly 125us right?

our porous here is to check if we have glitches by Firmware.

0 Likes

Hello Adam,

From your response, i can understand that when binterval is 1 (125 us) the video streaming is fine i.e without any glitches. Is this right?

USB Lecroy Trace, i can see that every 125us the data packets from the device is sent properly

>> Are you able to see the ITP in the traces. Is it as expected. Please share the Lecroy trace when glitches are seen during streaming

so as i understood we don't have any way to check that the ITP events are exactly 125us right?

>> We don't have API to set or create a timer in microseconds. But as per my previous response the number of ITP events can be calculated. Also, ITP can be seen in the Lecroy trace

our porous here is to check if we have glitches by Firmware.

>> Can you elaborate on this. How are you planning to debug this problem using service interval be used?

Regards,

Rashi

Regards,
Rashi
0 Likes