USB superspeed peripherals Forum Discussions
Hi.
I'm learning about GPIF-II State Machine.
But I have some questions about state machine.
First is start order of state machine.
As you can see in document numbered AN75779, there are two start point of state named "START_SCK0" and "START"SCK1".
Which one is performed first?
Second is about dma callback and thread context.
When state was in "PUSH_DATA_SCK0" and line was !LV, state would be changed to "LINE_END_SCK0", isn't it?
And then state would be change from "LINE_END_SCK0" to "WAIT_FULL_SCK0" when DATA_CNT_HIT was true, it's correct?
So when state was changed to "WAIT_FULL_SCK0", is dma callback function called for "WAIT_FULL_SCK0"? And then when LV was true, state would be changed to "PUSH_DATA_SCK1", right?
Am I right?
Show LessUsing the FX3...
Hi
Can a device get some message (bits) from HOST during enumeration? For example, can the device identify the HOST OS..
Note that the HOST Application is not running..
I assume this means modifying the cyusb3 driver (and device code of course). It's not clear if any of the available Get Requests can be modified to achieve this.
Thanks
John
I have the FX3's hooked up back to back, with a host on each side like described in the Designing a Master Interface AN87216 example. I am using a GPIF State Machine that I found here on the forums that works for two bidirectional DMA Auto channels and I am trying to get it to work by making one of them allow for a Manual Out channel so that I can write custom data to it from the CPU to PPORT. Currently, whenever I call my function CyFxManualEPTransfer(), it gets stuck at state 11, RD_WR_IDLE_1 and fails to CommitBuffer with error code 66, CY_U3P_ERROR_INVALID_ADDR.
GPIF II State Machine:
CyFxManualEPTransfer Function:
CyU3PReturnStatus_t
CyFxManualEPTransfer (
uint16_t byteCount,
uint8_t *buffer)
{
CyU3PDmaBuffer_t buf_p;
CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
if (byteCount == 0)
{
return CY_U3P_SUCCESS;
}
CyU3PDebugPrint (2, "\r[INFO] MANUAL EP access - size: 0x%x\r\n", byteCount);
/* Update the buffer address and status. */
buf_p.buffer = buffer;
buf_p.status = 0;
buf_p.size = glI2cPageSize;
buf_p.count = glI2cPageSize;
status = CyU3PDmaChannelSetupSendBuffer (&glChHandleInterruptLpUtoP, &buf_p);
//status = CyU3PDmaChannelGetBuffer (&glChHandleInterruptLpUtoP, &buf_p, CYU3P_NO_WAIT);
if (status != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (2, "\r[INFO] MANUAL EP: CyU3PDmaChannelSetupSendBuffer failed, Error code = %d\n", status);
//CyFxAppErrorHandler(status);
return status;
}
CyU3PDmaChannelSetWrapUp(&glChHandleInterruptLpUtoP);
status = CyU3PDmaChannelCommitBuffer (&glChHandleInterruptLpUtoP, buf_p.size, 0);
if (status != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (2, "\r[DEBUG] MANUAL EP: CyU3PDmaChannelCommitBuffer failed, Error code = %d\n", status);
uint8_t current_state;
CyU3PDebugPrint (4, "\r[DEBUG] Write failed with error code %d\n\r", status );
status = CyU3PGpifGetSMState(¤t_state);
CyU3PDebugPrint (4, "\r[DEBUG] Current state %d and err = %d\n\r", current_state, status );
//CyFxAppErrorHandler(status);
return status;
}
status = CyU3PDmaChannelWaitForCompletion(&glChHandleInterruptLpUtoP,
CY_FX_FLASH_PROG_TIMEOUT);
if (status != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (2, "MANUAL EP: CyU3PDmaChannelWaitForCompletion failed, Error code = %d\n", status);
//CyFxAppErrorHandler(status);
return status;
}
/* Need a delay between write operations. */
CyU3PThreadSleep (10);
return CY_U3P_SUCCESS;
}
DMA Channel setup for the Auto Channels:
/* Create a DMA Auto Channel between four sockets of the U port.
* DMA size is set based on the USB speed. */
dmaCfg.prodSckId = CY_FX_PRODUCER_USB_SOCKET;
dmaCfg.consSckId = CY_FX_CONSUMER_PPORT_SOCKET;
dmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaCfg.notification = 0;
dmaCfg.cb = NULL;
dmaCfg.prodHeader = 0;
dmaCfg.prodFooter = 0;
dmaCfg.consHeader = 0;
dmaCfg.prodAvailCount = 0;
apiRetStatus = CyU3PDmaChannelCreate (&glChHandleBulkLpUtoP,
CY_U3P_DMA_TYPE_AUTO_SIGNAL, &dmaCfg);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PDmaChannelCreate failed, Error code = %d\n", apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
/* Create a DMA Auto Channel between four sockets of the P port.
* DMA size is set based on the USB speed. */
dmaCfg.prodSckId = CY_FX_PRODUCER_PPORT_SOCKET;
dmaCfg.consSckId = CY_FX_CONSUMER_USB_SOCKET;
dmaCfg.notification = 0;
dmaCfg.cb = NULL;
dmaCfg.prodHeader = 0;
dmaCfg.prodFooter = 0;
dmaCfg.consHeader = 0;
dmaCfg.prodAvailCount = 0;
apiRetStatus = CyU3PDmaChannelCreate (&glChHandleBulkLpPtoU,
CY_U3P_DMA_TYPE_AUTO_SIGNAL, &dmaCfg);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PDmaChannelCreate failed, Error code = %d\n", apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
DMA Channel setup for the Manual Out:
/* Now create the DMA channels required for read and write. */
CyU3PMemSet ((uint8_t *)&dmaConfig, 0, sizeof(dmaConfig));
dmaConfig.size = pageLen;
/* No buffers need to be allocated as this will be used
* only in override mode. */
dmaConfig.count = 0;
dmaConfig.prodAvailCount = 0;
dmaConfig.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaConfig.prodHeader = 0;
dmaConfig.prodFooter = 0;
dmaConfig.consHeader = 0;
dmaConfig.notification = 0;
dmaConfig.cb = NULL;
/* Create a channel to write to the EEPROM. */
dmaConfig.prodSckId = CY_U3P_CPU_SOCKET_PROD;
dmaConfig.consSckId = CY_FX_INTERRUPT_CONSUMER_PPORT_SOCKET;
status = CyU3PDmaChannelCreate (&glChHandleInterruptLpUtoP,
CY_U3P_DMA_TYPE_MANUAL_OUT, &dmaConfig);
if (status != CY_U3P_SUCCESS)
{
WARNPRINT("MANUAL EP: CyU3PDmaChannelCreate OUT failed");
return status;
}
/* Create a channel to read from the EEPROM. */
dmaConfig.count = 16;
dmaConfig.prodSckId = CY_FX_INTERRUPT_PRODUCER_PPORT_SOCKET;
dmaConfig.consSckId = CY_FX_INTERRUPT_USB_SOCKET;
status = CyU3PDmaChannelCreate (&glChHandleInterruptLpPtoU,
CY_U3P_DMA_TYPE_AUTO, &dmaConfig);
if (status != CY_U3P_SUCCESS)
{
WARNPRINT("MANUAL EP: CyU3PDmaChannelCreate IN failed");
return status;
}
I have tried a variety of setups, but I can't seem to get it to work. Any suggestions?
Show LessHello,
How can I change the "SerialNumber" field in the device descriptor of the FX3 device?
I was able to change the Manufacturer and Product description in the firmware "cyfxbulkdscr.c" file but I couldn't find the "SerialNumber" field so that I could input a string descriptor there instead of NULL.
thanks,
jl46
Hello, I want to use sensor with MIPI CSI-2 interface. But its CSI-2 and D-PHY versions are greater than the CX3's MIPI CSI-2 version(v1.01). I know that MIPI has backward compatibility. Can I use this sensor with CX3. Thank you very much.
Sensor MIPI versions:
MIPI Alliance Specification for Camera Serial Interface 2 (CSI-2) Version 1.2
MIPI Alliance Specification for D-PHY Version 1.2
Hi,i used function of CyU3PDmaChannelSetupSendBuffer to send my data of uvc to host,but host camera tools don't dispaly my uvc data,and add part of the code in the attachment as follows.
Show LessHello,
We currently have a board with a device using I2C slave address "0xA0". This generates a conflict with the boot EEPROM since they share the same address.
It seems like FX3 ROM uses "0xA0" address when booting from I2C. Is it possible to change this and boot from another I2C address?
Show LessHello,
I have a board with an onboard CYUSB3011 and I'm using a modified firmware based on the bulkloopmanual example firmware (w/ Callback). I was wondering how to enable the burst mode and maximize the amount of bytes that can be transferred over USB because I tried initial modifications and changing from 1024 to even just 2048 yields an IN or OUT transfer error.
Also, what's the maximum bytes that can be transferred over USB with this firmware? I'm assuming it can have higher than 8192 bytes since it's USB3.0 which should have higher throughput or payload.
thanks,
jl46
Hello:
In order to verify the CX3(CYUSB3065) and MIPI interface sensors, I built a CX3&OV5640 minimum system (without using the ov5640 autofocus function). Using the SDK sample firmware, the computer can correctly recognize the camera, but cannot display the image (regardless of whether the firmware uses Release or Debug mode). I suspect that the signal line of the system is missing. Because it is the smallest system for verification, only the fewest signal lines are connected: including MIPI_CLOCK, MIPI_D0, MIPI_D1, I2C, XRST, XSHUTDOWN, I wonder if the SDK sample's CX3 & OV5640 firmware uses other signal lines?
Best regards!
LiuQi
Show LessHi,
I use FX3 with an image sensor. Also, i need to use it to communicate with a FPGA. A simple GPIFToUSB project is sufficient for this. However, i don't know how to merge these two projects. Can UVC and GPIFToUSB work together with different threads?
Another problem is the number of pins. 16-bits are used for UVC, but if i add the GPIFToUsb states same data bus also will be used for driving data. Another question is that if a make the data bus 24-bits, can i use this bus seperately such as 23:16 for gpiftousb and 15:0 for UVC?
Show Less