USB superspeed peripherals Forum Discussions
Hi,
I am working on a project where i need to connect FX3 to the external peripheral using the UART interface.This project basically uses a direct DMA channel from UART to USB endpoint to read data coming over Rx lines ,as explained in the UsbUart example. But with this only the reception part of the data over UART can be achieved. My requirement is that even before the reception of data , the external peripheral needs to be configured . As the UART is opened or configured in DMA mode the API's like CyU3PUartTransmitBytes will not work . So is there any other way or any API that can be used to send data over the Tx lines of UART from CX3 to the peripheral?
Show LessHello everyone,
we designed an industrial camera using FX3 in bulk mode. With some type of host controller (for example: Renesas USB 3.0 eXtensible Host Controler) we face some issue while doing basic bulk out write in loop on endpoint 0 => After a while, the Host (PC Win10 v1803 64bit) sends a warm reset which makes camera to reenumerate, and an unplug event is sent to the PC application.
We succeeded to reproduce the issue with the EZ-USB FX3 development board and the Bulkloop example Firmware & software (Cypress USB suite v1.3.3). After a few minutes, the application stops itself because it receives a device removal event.
With an USB analyser, we clearly see a warm reset sent by the host and we suspect it is caused by errors in the USB link flow control.
See analyser screen shot in attachment: Capture1.PNG show the last good transactions done, then you have all other USB traffic until warm reset which happened in Capture5.PNG (timestamp: 10 799 947 426)
I also sent PC configuration (report.HTM) in attachment.
Does anyone face the same problem ? What can we do to prevent this issue ?
Best regards.
Yves D.
Show LessIn theC:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\application\cpp\bulkloop,there is a demo called bulkloop.
int nDeviceIndex = 0;
m_selectedUSBDevice->Open(nDeviceIndex);
The nDeviceIndex is always o.
If there are several devices,how can i get it? Maybe i select second device,how can it distinguish?
I think it maybe a mistake!
Show LessHello,
I have been trying to get the UART to work in DMA mode. What I would like to do is receive a USB packet with some data that I that is to be sent out using the UART and also send any data received by the UART back to the computer over USB. I am able to do this using the byte by byte mode but it requires the use of a thread to continuosly look for received data and put it in a buffer to be sent back to the computer over USB. I seems like this would be a perfect use for the UART DMA mode. I can not find any examples that show how to do this besides the one that shows how to do a loopback. For that there is only one DMA channel created but I think I need to channels one for sending and one for receiveing. Is this correct?
Here is some code that I wrote to initialize the UART and create the a send and receive DMA channel. Does this look correct.
CyU3PReturnStatus_t SerialInit(void)
{
CyU3PUartConfig_t uartConfig;
CyU3PReturnStatus_t apiRetStatus;
CyU3PDmaChannelConfig_t dmaConfig;
// Initialize the UART.
apiRetStatus = CyU3PUartInit();
if (apiRetStatus != CY_U3P_SUCCESS && apiRetStatus != CY_U3P_ERROR_ALREADY_STARTED)
return apiRetStatus;
// Set UART configuration
CyU3PMemSet ((uint8_t *)&uartConfig, 0, sizeof (uartConfig));
uartConfig.baudRate = CY_U3P_UART_BAUDRATE_9600;
uartConfig.stopBit = CY_U3P_UART_ONE_STOP_BIT;
uartConfig.parity = CY_U3P_UART_NO_PARITY;
uartConfig.txEnable = CyTrue;
uartConfig.rxEnable = CyTrue;
uartConfig.flowCtrl = CyFalse;
uartConfig.isDma = CyTrue;
apiRetStatus = CyU3PUartSetConfig (&uartConfig, NULL);
if (apiRetStatus != CY_U3P_SUCCESS)
return apiRetStatus;
// Initialize the dmaConfig.
CyU3PMemSet ((uint8_t *)&dmaConfig, 0, sizeof(dmaConfig));
dmaConfig.size = CY_FX_UART_DMA_BUF_SIZE;
dmaConfig.count = 1;
dmaConfig.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaConfig.prodHeader = 0;
dmaConfig.prodFooter = 0;
dmaConfig.consHeader = 0;
dmaConfig.prodAvailCount = 0;
// Create a channel to write to the UART.
dmaConfig.prodSckId = CY_U3P_CPU_SOCKET_PROD;
dmaConfig.consSckId = CY_U3P_LPP_SOCKET_UART_CONS;
dmaConfig.notification = 0;
dmaConfig.cb = NULL;
apiRetStatus = CyU3PDmaChannelCreate (&glUartTxChHandle, CY_U3P_DMA_TYPE_MANUAL_OUT, &dmaConfig);
if (apiRetStatus != CY_U3P_SUCCESS)
return apiRetStatus;
// Create a channel to read from the UART.
dmaConfig.prodSckId = CY_U3P_LPP_SOCKET_UART_PROD;
dmaConfig.consSckId = CY_U3P_CPU_SOCKET_CONS;
dmaConfig.notification = CY_U3P_DMA_CB_PROD_EVENT;
dmaConfig.cb = CyFxUartDmaCallback;
apiRetStatus = CyU3PDmaChannelCreate (&glUartRxChHandle, CY_U3P_DMA_TYPE_MANUAL_IN, &dmaConfig);
if (apiRetStatus != CY_U3P_SUCCESS)
return apiRetStatus;
// Set UART Tx transfer Size to infinite
apiRetStatus = CyU3PUartTxSetBlockXfer(0xffffffff);
if (apiRetStatus != CY_U3P_SUCCESS)
return apiRetStatus;
// Set UART Rx transfer Size to 1
apiRetStatus = CyU3PUartRxSetBlockXfer(0xFFFFFFFF);
if (apiRetStatus != CY_U3P_SUCCESS)
return apiRetStatus;
// Set DMA Channel transfer size
apiRetStatus = CyU3PDmaChannelSetXfer (&glUartTxChHandle, CY_FX_UART_DMA_TX_SIZE);
if (apiRetStatus != CY_U3P_SUCCESS)
return apiRetStatus;
return apiRetStatus;
}
Here is some code that send data to the UART to be transmitted. When I do this no data goes out the UART. What am I doing wrong?
CyU3PReturnStatus_t SendUART(uint8_t *buffer, int Length)
{
CyU3PReturnStatus_t apiRetStatus;
CyU3PDmaBuffer_t dmaFw2UARTBuffer;
// Get an out buffer.
apiRetStatus = CyU3PDmaChannelGetBuffer(&glUartTxChHandle, &dmaFw2UARTBuffer, CYU3P_WAIT_FOREVER);
if (apiRetStatus != CY_U3P_SUCCESS)
return apiRetStatus;
CyU3PMemCopy(dmaFw2UARTBuffer.buffer, buffer, Length);
apiRetStatus = CyU3PDmaChannelCommitBuffer (&glUartTxChHandle, Length, 0);
if (apiRetStatus != CY_U3P_SUCCESS)
return apiRetStatus;
return apiRetStatus;
}
Thank you,
Garyio
Show LessIn the CX3_CONFIG_CTRL register, bits [9:8] points to "DATA MODE" that should be used for data packing and byte ordering.
It is written that the register is set by SetintfParams function.
However, I cannot retrieve which parameter of "SetIntfParams" function is used to configure "data mode".
When I re-read register with I2C directly, DATA MODE is always 0.
Furthermode DATA MODE explaination refers to 0 = Mode 0, 1 = Mode 1, 2 = Mode 2, 3 = reserved.
Could you please precise the exact meaning of "DATA MODE" and the correct way to program it ?
For now, I program it after SetIntParams function call with a direct I2C write command : is this ok ?
Thank you for your help,
Best Regards
Show LessI have created a project for my 8 bit input with raw8 pix format
i have edited my guid and frame size for the input, but i am getting error in media players like ffplay and vlc.
i have referenced microsoft docs and got guid
0x7A,0xEB,0x36,0xE4,
0x4F,0x52,0xCE,0x11,
0x9F,0x53,0x00,0x20,
0xAF,0x0B,0xA7,0x70, /*GUID for RGB8 "e436eb7a-524f-11ce-9f53-0020af0ba770" */
I have also edited the frame rate that is 25 fps
whatelse to change? please review my code thanks.
Show LessSetup:
- Ubuntu 16.04 LTS
- Cypres SDK v. 1.3.3
I try to debug FX3 in EZ USB Suite using openOCD.
I followed EzUsbSuite_UG guide (v.1.3.3) chapter 3.2 (Debugging with OpenOCD). I have the FX3 device in the bootloader mode. The log from console:
Show Less
Open On-Chip Debugger 0.8.0 (2014-12-03-16:28)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Warn : Adapter driver 'cy7c65215' did not declare which transports it allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
adapter_nsrst_delay: 200
jtag_ntrst_delay: 200
adapter speed: 1000 kHz
trst_and_srst srst_pulls_trst srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
RCLK - adaptive
adapter speed: 1000 kHz
Error: CyGetDeviceInfo failed
Error: CyGetDeviceInfo failed
Error: CyGetDeviceInfo failed
Error: CyGetDeviceInfo failed
Error: CyGetDeviceInfo failed
Error: CyGetDeviceInfo failed
Error: CyGetDeviceInfo failed
Error: CyGetDeviceInfo failed
USB Device: Vid=9fb Pid=6001 Intf=1
USB Interface 0: Type=255
USB Device: Vid=4b4 Pid=7 Intf=4
USB Interface 0: Type=0
USB Interface 1: Type=0
USB Interface 2: Type=4
Info : clock speed 1000 kHz
Info : JTAG tap: fx3.cpu tap/device found: 0x07926069 (mfg: 0x034, part: 0x7926, ver: 0x0)
Info : Embedded ICE version 6
Info : fx3.cpu: hardware has 2 breakpoint/watchpoint units
Info : accepting 'gdb' connection from 3333
undefined debug reason 7 - target needs reset
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Warn : target not halted
Info : JTAG tap: fx3.cpu tap/device found: 0x07926069 (mfg: 0x034, part: 0x7926, ver: 0x0)
Warn : srst pulls trst - can not reset into halted mode. Issuing halt after reset.
Error: invalid mode value encountered 0
target state: halted
target halted in ARM state due to debug-request, current mode: Thread
cpsr: 0x2c38a000 pc: 0xf0001e14
MMU: disabled, D-Cache: disabled, I-Cache: enabled
Warn : NOTE! DCC downloads have not been enabled, defaulting to slow memory writes. Type 'help dcc'.
Warn : NOTE! Severe performance degradation without working memory enabled.
Warn : NOTE! Severe performance degradation without fast memory access enabled. Type 'help fast'.
Error: timeout waiting for SYSCOMP & DBGACK, last DBG_STATUS: 0
Warn : negative acknowledgment, but no packet pending
Error: timeout waiting for SYSCOMP & DBGACK, last DBG_STATUS: 0
Error: timeout waiting for SYSCOMP & DBGACK, last DBG_STATUS: 0
Warn : target not halted
Warn : target not halted
Warn : target not halted
Warn : target not halted
Warn : target not halted
Warn : target not halted
Warn : target fx3.cpu is not halted
Error: can't add breakpoint: target running
Info : dropped 'gdb' connection
Step by step procedure:
1. Increase the interfaces 4 from 2 in config descriptor in UVC frameworks code and association interface would be 2 , one for each class
2. Make sure the total length of descriptors are modified accordingly. I mean add CDC class descriptors
3. Initialize all common blocks at one time and one place
4. Setup call back incorporate both UVC+CDC
5. Keep only one GPIO configuration
6. Create DMA channel for UART, another for UVC
But when I finish above procedure,I found a device node named USB Composite Device with yellow exclamation mark in window 7 Device manager in USB Host Side.It show as
And There is no FX3 UVC device in the Image Device Tree in window 7 Device manager(If I do nothing,There is a UVC device in the Image Device Tree)
So,It is appreciated if there is a reference demo for such composite device or a more detailed guide.Another,Is there a newly host driver for this composite device?I just install CypressDriverInstaller_1.exe from the following link: http://www.cypress.com/documentation/software-and-drivers/usb-serial-software-development-kit
Show LessHi,
We made a wrong terminal connection of FX 3 and connected the RESET # terminal directly to the INT # terminal.
As a result, I encountered a phenomenon that the USB BOOT operation does not work.
The SPI boot operation works without problems.
Where is the cause of the USB boot operation not functioning?
What is wrong with directly connecting the RESET # pin to the INT # pin?
Those who have knowledge please give us information.
Best regards,
Show LessHi,
I'd like to have a code snippet for cx3 to place it correctly into gpif 24 bits mode.
For now we have of course something like :
apiRetStatus = CyU3PMipicsiGpifLoad( CY_U3P_MIPICSI_BUS_24 , BUFFERSIZE);
call
and a apiRetStatus value success as return.
However I have a worry with a former call of
apiRetStatus = CyU3PDeviceConfigureIOMatrix (&io_cfg);
because in every example io_cfg.isDQ32Bit is defined as CyFalse.
We define some gpios with it also and uart/i2c usage so this function has to be called either.
Is this OK with CX3 that isDQ32Bit is set to false whereas we use the 24 bits gpif ? Cx3Rgb24AS0260 sample as something similar in it.
In our firmware, we now have a correct behavior with a CY_U3P_MIPICS_BUS_16 configuration (format output 16 bits also). If we change to 24 bits with GPifLoad (and format output RGB888 24 bits also), it doesn't work anymore as if CX3 was still in gpif 16 bits configuration after the CyU3PMipicsiGpifLoad call.
Thank you for your help,
Best Regards,
Show Less