USB superspeed peripherals Forum Discussions
Hi,
we use USB3 re-drivers in our hardware setup to improve the overall signal quality on the USB3 links.
This works fine for USB3 but in case if we connect the host PC over a USB2 cable then the enumeration fails.
Our hardware setup is as following:
[Host PC] - [USB2 cable] - [TUSB501 USB3 re-drivers (RX,TX)] - [USB3 cable] - [FX3]
From firmware debug we can see that all USB related API functions (CyU3PUsbStart, CyU3PUsbSetDesc, CyU3PConnectState)
return success but the at the end no SETCONF or RESET event is detected.
After studying the FX3 TRM and TUSB501 datasheets (see below) we assume that the USB3 re-driver on the RX side (seen from FX3)
makes problems when the FX3 tries to detect the USB interface speed. The re-driver detects the FX3 RX receiver and enables
the terminations and output. On the other hand the FX3 turns on the USB3 PHY and starts the 3.0 receiver detection (2).
We assume that the USB3 receiver is always detected since re-drivers are active all the time. For that reason it waits forever on
USB3 enumeration packets and does not fallback to USB2.
We have the following questions:
1.) Is it possible that the USB2 enumeration is blocked because of our assumptions?
2.) Is a timeout implemented in the FX3 firmware to switch back to USB2 when 3.0 receiver is present but no enumeration USB3 happens
3.) Is there a possible FX3 firmware change to fix this issue?
Thanks,
Sven
From TUSB501 datasheet:
After power up, the TUSB501 periodically performs receiver detection on the TX pair. If it detects a SuperSpeed USB receiver,
RX termination becomes enabled, and the TUSB501 is ready to redrive.
The FX3 TRM lists a procedure that is used by the FX3 firmware for USB connection negotiation:
1. Wait for a valid VBus voltage (GCTL_IOPWR interrupt).
2. Turn on the USB 3.0 PHY to start 3.0 receiver detection.
a. If receiver detection succeeds, the LNK_LTSSM_CONNECT interrupt will be received. If this interrupt is received, the
device will proceed with enumeration in USB 3.0 mode.
3. If receiver detection fails, the LNK_LTSSM_DISCONNECT interrupt will be received. If this interrupt is received:
a. Turn off USB 3.0 PHY and turn on USB 2.0 PHY.
b. A USB 2.0 bus reset will be received as part of USB 2.0 connection startup.
c. The 3.0 PHY should be re-enabled on receiving the URESET interrupt that is triggered on a 2.0 bus reset. Both the 2.0
and 3.0 PHYs will be active at this time.
d. If the 3.0 receiver detection succeeds (LNK_LTSSM_CONNECT):
i.Turn off the USB 2.0 PHY.
ii.Proceed with enumeration as a USB 3.0 device.
e. If the 3.0 receiver detection fails (LNK_LTSSM_DISCONNECT):
i.Turn off the USB 3.0 PHY.
ii.Check number of times that 3.0 receiver detection has failed. If this count is greater than 3:
4. Proceed with enumeration as a USB 2.0 device.
5. There is no need to attempt 3.0 enumeration on any further bus resets.
Show LessHi. In reading:
cypress GX3 ethernet can't be recognized by macOS 10.15
still not clear if the drivers are available to support MacOS 10.15 (Catalina) or not?
Would someone please confirm? We are considering this controller for a new design and the missing driver support on the CYUSB3610 webpage is a shortcoming in comparison to a competing device.
Thanks.
Show LessI have an image sensor chip sending me buffers. I'm using 4 mipi lanes, and the bandwidth is high. I'm using a multi-channel DMA configuration, per normal. I'm trying to figure out why, in my DMA callback, when I get a MultiChannelCommitBuffer failure of 0x47, my counter for "outstanding DMA buffers committed, but not consumed yet" is 8 or 9. From my limited understanding, the sensor chip is producing buffers, and the USB pipe is consuming buffers. How many buffers can be produced, but not consumed, without some kind of overflow? How many DMA buffers can the sensor produce, if I don't consume them via sending them to the DMA via CyU3PDmaMultiChannelCommitBuffer? Likewise, what's surprising is that when I get a failure 0x47, I start throwing out *everything* in the DMA callback until the DMA is reset on the main thread (in UvcAppStop). I'm shocked to see 8 callbacks for "consumer events". What is it being consumed BY? Is it being consumed by the USB send pipe, or some other consumption object? Because I'm pretty sure I only allocated 4 DMA buffers to be sent to the PC. How could there be 8 outstanding consumptions that come back in the callback as I am shutting the pipe down? That is 4 too many.
DMA Reset Event due to DMA callback failure
#### CyCx3UvcAppDmaCallback:CyU3PDmaMultiChannelCommitBuffer FAILURE 0x47 at frame 50098, outstanding = 8
DmaCallback GOTDMAERROR, CB_CONS_EVENT
DmaCallback GOTDMAERROR, CB_CONS_EVENT
DmaCallback GOTDMAERROR, CB_CONS_EVENT
DmaCallback GOTDMAERROR, CB_CONS_EVENT
DmaCallback GOTDMAERROR, CB_PROD_EVENT
Dma buffer = 400650ec, status = 8
DmaCallback GOTDMAERROR, CB_PROD_EVENT
Dma buffer = 4005f0cc, status = 8
DmaCallback GOTDMAERROR, CB_CONS_EVENT
DmaCallback GOTDMAERROR, CB_CONS_EVENT
DmaCallback GOTDMAERROR, CB_CONS_EVENT
DmaCallback GOTDMAERROR, CB_PROD_EVENT
Dma buffer = 4004102c, status = 8
DmaCallback GOTDMAERROR, CB_PROD_EVENT
Dma buffer = 4006b10c, status = 8
DmaCallback GOTDMAERROR, CB_CONS_EVENT
DmaCallback GOTDMAERROR, CB_PROD_EVENT
Dma buffer = 4004d06c, status = 8
DmaCallback GOTDMAERROR, CB_PROD_EVENT
Dma buffer = 4004704c, status = 8
DmaCallback GOTDMAERROR, CB_PROD_EVENT
Dma buffer = 4005308c, status = 8
DmaCallback GOTDMAERROR, CB_PROD_EVENT
Dma buffer = 400590ac, status = 8
****CyCx3UvcAppStop****
it's lengthy, and messy, but here is the DMA callback code. I frankly don't know what I'm doing inside this code...
void CyCx3UvcAppDmaCallback (
CyU3PDmaMultiChannel *chHandle,
CyU3PDmaCbType_t type,
CyU3PDmaCBInput_t *input )
{
CyU3PDmaBuffer_t dmaBuffer;
CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
CyU3PReturnStatus_t status2;
if( bGotDmaError )
{
switch( type )
{
case CY_U3P_DMA_CB_XFER_CPLT:
QueueDiagnosticsMessageP( 4, "DmaCallback GOTDMAERROR, DMA_CB_XFER_CPLT\r\n" );
break;
case CY_U3P_DMA_CB_SEND_CPLT:
QueueDiagnosticsMessageP( 4, "DmaCallback GOTDMAERROR, CB_SEND_CPLT\r\n" );
break;
case CY_U3P_DMA_CB_RECV_CPLT:
QueueDiagnosticsMessageP( 4, "DmaCallback GOTDMAERROR, CB_RECV_CPLT\r\n" );
break;
case CY_U3P_DMA_CB_PROD_EVENT:
QueueDiagnosticsMessageP( 4, "DmaCallback GOTDMAERROR, CB_PROD_EVENT\r\n" );
break;
case CY_U3P_DMA_CB_CONS_EVENT:
QueueDiagnosticsMessageP( 4, "DmaCallback GOTDMAERROR, CB_CONS_EVENT\r\n" );
break;
case CY_U3P_DMA_CB_ABORTED:
QueueDiagnosticsMessageP( 4, "DmaCallback GOTDMAERROR, CB_ABORTED\r\n" );
break;
case CY_U3P_DMA_CB_ERROR:
QueueDiagnosticsMessageP( 4, "DmaCallback GOTDMAERROR, CB_ERROR\r\n" );
break;
case CY_U3P_DMA_CB_PROD_SUSP:
QueueDiagnosticsMessageP( 4, "DmaCallback GOTDMAERROR, PROD_SUSP\r\n" );
CyU3PDmaMultiChannelResume( chHandle, CyFalse, CyTrue );
break;
case CY_U3P_DMA_CB_CONS_SUSP:
QueueDiagnosticsMessageP( 4, "DmaCallback GOTDMAERROR, CONS_SUSP\r\n" );
break;
}
if( input != NULL )
{
QueueDiagnosticsMessageP( 4, " Dma buffer = %x, status = %x\r\n", input->buffer_p.buffer, input->buffer_p.status );
}
return;
}
if( !glIsApplnActive )
{
switch( type )
{
case CY_U3P_DMA_CB_XFER_CPLT:
QueueDiagnosticsMessageP( 4, "DmaCallback STOPPING, DMA_CB_XFER_CPLT\r\n" );
break;
case CY_U3P_DMA_CB_SEND_CPLT:
QueueDiagnosticsMessageP( 4, "DmaCallback STOPPING, CB_SEND_CPLT\r\n" );
break;
case CY_U3P_DMA_CB_RECV_CPLT:
QueueDiagnosticsMessageP( 4, "DmaCallback STOPPING, CB_RECV_CPLT\r\n" );
break;
case CY_U3P_DMA_CB_PROD_EVENT:
QueueDiagnosticsMessageP( 4, "DmaCallback STOPPING, CB_PROD_EVENT\r\n" );
break;
case CY_U3P_DMA_CB_CONS_EVENT:
QueueDiagnosticsMessageP( 4, "DmaCallback STOPPING, CB_CONS_EVENT\r\n" );
break;
case CY_U3P_DMA_CB_ABORTED:
QueueDiagnosticsMessageP( 4, "DmaCallback STOPPING, CB_ABORTED\r\n" );
break;
case CY_U3P_DMA_CB_ERROR:
QueueDiagnosticsMessageP( 4, "DmaCallback STOPPING, CB_ERROR\r\n" );
break;
case CY_U3P_DMA_CB_PROD_SUSP:
QueueDiagnosticsMessageP( 4, "DmaCallback STOPPING, PROD_SUSP\r\n" );
CyU3PDmaMultiChannelResume( chHandle, CyFalse, CyTrue );
break;
case CY_U3P_DMA_CB_CONS_SUSP:
QueueDiagnosticsMessageP( 4, "DmaCallback STOPPING, CONS_SUSP\r\n" );
break;
}
return;
}
if (type == CY_U3P_DMA_CB_PROD_EVENT)
{
/* This is a produce event notification to the CPU. This notification is
* received upon reception of every VIDEO buffer produced by the OV chip. The buffer will not be sent
* out unless it is explicitly committed. The call shall fail if there
* is a bus reset / usb disconnect or if there is any application error. */
int WhileLoopIndex = 0;
// loop until we can't get any more dma buffers
//
while( 1 )
{
WhileLoopIndex++;
if( WhileLoopIndex > 10 )
{
// this happens. frequently. WHY?
QueueDiagnosticsMessageP( 4, " CyCx3UvcAppDmaCallback: InWhileLoop too long\r\n" );
if( !bGotDmaError )
{
// start killing the dma...
bGotDmaError = CyTrue;
CyU3PEventSet(&glCx3Event, CX3_DMA_RESET_EVENT_CB,CYU3P_EVENT_OR);
}
return;
}
status = CyU3PDmaMultiChannelGetBuffer(chHandle, &dmaBuffer, CYU3P_NO_WAIT);
if( status != CY_U3P_SUCCESS )
{
// couldn't get a ready buffer, this is normal
break;
}
if(dmaBuffer.count < MSRVIDEOAR_UVC_DATA_BUFFER_SIZE)
{
//QueueDiagnosticsMessage("DMA EOF Buffer %d\r\n", dmaBuffer.count);
CyCx3UvcAppAddHeader ((dmaBuffer.buffer - MSRVIDEOAR_UVC_DATA_BUFFER_HEADER_SIZE), CX3_UVC_HEADER_EOF);
glHitFV = CyTrue;
gFpsFrameCounter++;
gSequentialVideoFrameID++;
glVideoFramesCaptured++;
#ifdef RESET_TIMER_ENABLE
CyU3PTimerStart( &UvcTimer );
#endif
// Reset for the next first buffer of the next frame
gFirstDmaBufferOfVideofFrame = CyTrue; // start of the video frame, not the very first frame we deliver
}
else
{
CyCx3UvcAppAddHeader ((dmaBuffer.buffer - MSRVIDEOAR_UVC_DATA_BUFFER_HEADER_SIZE), CX3_UVC_HEADER_FRAME);
if (gFirstDmaBufferOfVideofFrame)
{
MSRVIDEOAR_EMBEDDED_FRAME_METADATA * pMetaData = (MSRVIDEOAR_EMBEDDED_FRAME_METADATA *) dmaBuffer.buffer;
gFirstDmaBufferOfVideofFrame = CyFalse;
pMetaData->stateFlags = 0;
if (gThroughputErrors > 0)
{
pMetaData->stateFlags |= METASTATEFLAG_THROUGHPUTERROR;
gThroughputErrors = 0;
}
uint64_t llSystemTime = VideoARTicksToHundredNanosecs( s_sofSystemTicks );
// keep track of how many frames per second we produce
//
uint64_t llDelta = llSystemTime - s_llLastSystemTimeFpsCalculatedAt;
if( s_llLastSystemTimeFpsCalculatedAt == 0 || ( llDelta > 10000000 ) )
{
s_llLastSystemTimeFpsCalculatedAt = llSystemTime;
gMeasuredFPS = gFpsFrameCounter;
gFpsFrameCounter = 0;
}
pMetaData->ullTickCount = s_sofSystemTicks;
pMetaData->TickFreq = gsysClockFreq;
pMetaData->sequentialFrameID = gSequentialVideoFrameID;
pMetaData->nMeasuredCaptureFPS = gMeasuredFPS;
pMetaData->nHowManyTimesCaptureStarted = gTimesCaptureStarted;
}
}
/* Commit Buffer to USB*/
// this queues it to be sent over USB.
status = CyU3PDmaMultiChannelCommitBuffer (chHandle, (dmaBuffer.count + MSRVIDEOAR_UVC_DATA_BUFFER_HEADER_SIZE), 0);
if (status != CY_U3P_SUCCESS)
{
gThroughputErrors++;
QueueDiagnosticsMessageP(4,"#### CyCx3UvcAppDmaCallback:CyU3PDmaMultiChannelCommitBuffer FAILURE 0x%x at frame %d, outstanding = %d\r\n", status, gSequentialVideoFrameID, glVideoDmaBuffersCommittedAndNeedingToBeConsumed );
if( !bGotDmaError )
{
// start killing the dma...
bGotDmaError = CyTrue;
CyU3PEventSet(&glCx3Event, CX3_DMA_RESET_EVENT_CB,CYU3P_EVENT_OR);
}
// no matter what, if we got an error, exit. don't flip sockets.
return;
}
else
{
glVideoDmaBuffersCommittedAndNeedingToBeConsumed++;
}
glActiveSocket ^= 1; /* Toggle the Active Socket */
} // loop until we can't get any more DMA buffers
}
else if(type == CY_U3P_DMA_CB_CONS_EVENT)
{
glVideoDmaBuffersCommittedAndNeedingToBeConsumed--;
if( glHitFV == CyTrue )
{
if(glVideoDmaBuffersCommittedAndNeedingToBeConsumed == 0)
{
glHitFV = CyFalse;
gConsumedFrames++;
CyU3PGpioSetValue(VIDEOAR_GPIO_FV, CyFalse);
#ifdef RESET_TIMER_ENABLE
CyU3PTimerStop (&UvcTimer);
#endif
// immediately switch state to SCK0 or SCK1
//
if (glActiveSocket)
CyU3PGpifSMSwitch(
CX3_INVALID_GPIF_STATE, // from
CX3_START_SCK1, // to
CX3_INVALID_GPIF_STATE, // end state
ALPHA_CX3_START_SCK1, // initial alpha
CX3_GPIF_SWITCH_TIMEOUT); // switch timeout
else
CyU3PGpifSMSwitch(
CX3_INVALID_GPIF_STATE,
CX3_START_SCK0,
CX3_INVALID_GPIF_STATE,
ALPHA_CX3_START_SCK0,
CX3_GPIF_SWITCH_TIMEOUT);
#ifdef RESET_TIMER_ENABLE
CyU3PTimerModify (&UvcTimer, TIMER_PERIOD, 0);
#endif
}
else
{
// QueueDiagnosticsMessage("#### CyCx3UvcAppDmaCallback CONSUMED, but glVideoDmaBuffersCommittedAndNeedingToBeConsumed = %d\r\n", glVideoDmaBuffersCommittedAndNeedingToBeConsumed );
}
}
}
else
{
if( type == CY_U3P_DMA_CB_ERROR )
{
QueueDiagnosticsMessageP( 4, "DmaCallback, detected ERROR\r\n" );
}
else if( type == CY_U3P_DMA_CB_ABORTED )
{
QueueDiagnosticsMessageP( 4, "DmaCallback, ABORTED\r\n" );
}
else if( type == CY_U3P_DMA_CB_PROD_SUSP )
{
QueueDiagnosticsMessageP( 4, "DmaCallback, consumer suspend, resumed\r\n" );
CyU3PDmaMultiChannelResume( chHandle, CyFalse, CyTrue );
}
else
{
#if false
CY_U3P_DMA_CB_PROD_SUSP = (1 << 7), /**< This event is generated when the producer socket is suspended. */
CY_U3P_DMA_CB_CONS_SUSP = (1 << 😎 /**< This event is generated when the consumer socket is suspended. */
#endif
QueueDiagnosticsMessageP( 4, "DmaCallback, type = %d\r\n", type );
}
}
}
Show LessHello ,
Present I encounter a solution issue.
I don't know whether CYUSB3014 can realize the function as below,
I want to use GPIF in CYUSB3014 as master transfer data to peripheral 2,but we don't have peripheral 1.
The data size to be transferred around 60KB and peripheral 2 is a 8 bits parallel with data rates around 50MHz slave device.
The slave device without any feedback signals to CYUSB3014.
The questions as below,
Can I use part of SRAM in side the CYUSB3014 as peripheral 1 ??
If yes,how to realize it?
If no,do you have solution on it?
Thanks a lot.
Show LessWe are in Hong Kong/Shenzhen region. We would to develop new 1080p60 video capture product. Should we use CYUSB3014 or any others are recommended?
And also we have the following question:
1) And is standard UVC driver available for Win 8.1 & 10? is it a mature solution?
2) Can we change Firmware setting such as PID, device name?
3) When can I find supported Vtime table for CYUSB3014?
4) Which distributor is recommended for Hong Kong/Shenzhen region? As we need some local technical support for implementation. We will use Lattice FPGA to interface with CYUSB3014.
Thank you!
Steve
Show LessI know this is a bit silly but understanding abbreviations is important to me, especially if I'm expected to use (and thus document) them in my own source code. I understand that the "P-Port" or just "PP" refers to the GPIF II interface (and is abbreviated further to just "P" in "U2P" and "P2U" descriptions of DMA channels), but I haven't found any documentation that explains what that initial P stands for. Parallel? Peripheral? Processor? Something else? It would be nice to have an official definition for this abbreviation included in the documentation. If it already exists somewhere please point me to it.
Show LessNot impressed with the developer community as a solution for questions AT ALL. I have another question up here, for days, no reply by anybody.
Here's a simpler question, it's about clocks. First off, cypress' CX3 documentation on how to get an image sensor working is scattered, scant, and terrible. I'm surprised the CX3 is still a thing, with how bad the documentation is. That said, I doubt anybody is going to help me further. But let's try, maybe it will help other people.
The CX3 has an incoming system clock, it's 19.2 Mhz. Internally, it seems like this is multiplied by 20 to get SYS_CLK. Later in the docs, it states that the MIPI receive bus runs on a different clock, from the incoming REFCLK. In my case, that is 24MHZ. In the call to CyU3PDeviceInit, I pass in a CyU3PSysClockConfig_t, which has a flag in it, "setSysClk400", which tells the sys clock to run at a multiple of 21 instead of 20x the base incoming 19.2Mhz signal. But changing this value back and forth causes my captured frame rate to be different. This surprised me. Unless I am doing something very wrong, I figured the frame rate would stay the same, because it's being "latched" (for lack of a better word) from the MIPI bus, whose frequency is NOT changing based on setSysClk400. Anybody have an idea of why my FPS is changing?
Another thing I don't understand, since I inherited this firmware and hardware board, is LV and FV. My circuit doesn't have LV and FV coming in off GPIO lines from the sensor. How does the CX3 know when it's reached the end of a line or frame? I know it's happening, since it's capturing, but HOW is it working? I see no explanation for this anywhere.
Another thing I want to know is: We're using the OV4688(or 4689). It has been set up to output RAW8, but my cx3config.cycx is set up for input video format = RAW10, which I think is a mistake... Plus the GPIF bus has been set up for 24 bit. I don't understand the GPIF bus width, or why it should be one size or the other. Why not 32-bit? Is this just the size of the data that goes across the GPIO bus? or is it the transfer size (somehow) of what gets passed across the MIPI pixel data bus? Back to the Bayer thing: If I output RAW8 from the sensor, I'm assuming i choose input video format = RAW8. WHY oh WHY is there an "output video format"? The CX3 can't do format translation, so why is this box even there? Why can I choose 8, 16, or 24 bit? I don't get it. And if I choose one of those formats, what does that affect and which other registers do I need to set?
thanks from a very confused person.
Show LessHello
Q1-1) If the value of "Output Pixel Clock [Mhz]" exceeds the Max value, what parameter should I correct?
Q1-2) Please tell me the reason mentioned above.
Q2) Please find attached, the value of "Output Pixel Clock [Mhz]" range is [Min:204.12| and [Max:100]. Why is MIN larger than MAX?
Best Regards
Arai
Show LessHello. I am Lee.
I want to transmit the raw data of the RGB bayer image sensor using FX3.
For the first time, I made an FX3 test board and tested it.
The test board specifications are as follows:
1.1 FX3+ AP0101AT(onsemi ISP) + AR0132AT(onsemi Sensor)
1.2. Data bus: 8bit GPIF (I used cyfxgpif2config.h of UVC_AN75779 as it is.)
1.3. 1280* 960 @ 30hz, UVC(YUV422), 8bit
1.4. UVC Transfer (I used the example UVC_AN75779.)
Streamer @UVC data ( refer to 'FX3 / CX3 Firmware for Streaming RAW Image Data using Cypress Driver ')
toggled "#define CY_DRIVER" in uvc.h
1.5. The test board is working normally without any problems.
I attach this program. (The sensor initialization part is erased.)
And I am going to make a new board like this:
new board specifications :
2.1 FX3+ AR0132AT(onsemi Sensor): NO ISP
2.2. data bus: 12bit bus (16bit GPIF)
2.3 1280* 960 @ 30hz, RAW (RGB Bayer), 12bit
2.4 Only RGB bayer (Sterming mode and One shot mode)
I have a few questions.
Q1. What is the data size (RGB bayer) of 1 frame of the new board? Is 1280*960*2 byte correct?
Q2. Using the sensor's trigger mode (https://files.niemo.de/aptina_pdfs/TN_281_AR0132AT_TRIGGER_Mode_Operation.pdf)
I want to transmit only one frame and wait (one shot mode). What should I do in this case?
Q3. Is there any way to send a specific test pattern without sensor input?
For example, can a red screen be sent even if there is no sensor operation?
Q4. When changing to 8bit GPIF -> 16bit GPIF,
Can I change the data to 16 bits and change the LD_ADDR_COUNT and LD_DATA_COUNT values to 8183?
(LV, FV, PCLK function pins are the same.)
Are there any other modifications in the firmware or in the GPIF II Designer tool?
Q5. Cypress FX3 StramerExample Device @ USB control center
Streaming is turned on or off via 'Zero-length data CONTROL OUT' in the req code.
Could you ever send multiple bytes data pasted here?
ex) 0x99 0x12 0x34
If so, what should I process in firmware?
Q6. Cypress FX3 StramerExample Device @ USB control center
Can I receive whole 1 frame RAW data at once?
Sorry for so many questions.
I look forward to your help.
Show LessHi,
I am referring to FX3 Fail Safe Firmware Update , and able to implement the second stage boot loader for i2c and it is working as expected. same way I would like to use the second stage boot loader for SPI. How it can be achieved ? Do you have any reference design. So it would be very helpful.
Thanks in advance,
Best Regards,
Prasanna
Show Less