USB superspeed peripherals Forum Discussions
Hi,
I have an FX3 with a U2P DMA bulk channel with 2 buffers (16KB) each. The FX3 is used as a bridge between the host (PC) and an FPGA.
For this test, I'm sending packets of 2KB and I would like the FX3 to forward the data to the FPGA as soon as this packet arrives (it may take some time until a new packet arrives). However, I see that I need to fill the buffer (send 8 packets) before any data is moved to the FPGA.
I'm using usblib as the driver for the USB interface, and I'm wondering if there is anything at the FX3 side to achieve this functionality. It seems that with non-multiples of the packet size (1KB) this does not happen.
Any suggestion is welcome.
Kind regards
Show LessHello
I have to develop a board.
I use FX3S because it can connect to FPGA via GIPF II,
it can connect to uSD thanks to SDIO
it can connect to PC via USB.
FX3S has another SDIO and in the datasheet I see it can connect to WLAN chip.
Is it possible to connect FX3S SDIO to WiLink™ 8 from Teaxas Instruments ?
Here WiLink™ 8 drivers WILINK8-WIFI-MCP8 WiLink™ 8 Proprietary Wi-Fi Driver – QNX, WinCE, Nucleus RTOS baseline | TI.com
Here the chip https://www.ti.com/lit/ds/symlink/wl1835mod.pdf?ts=1605258022453&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252F…
FX3S has a TCP/IP stack ?
Show LessDear, I got a very strange behavior, the dmabuffer count is alway incorrect.
First, for testing purpose, I wired the Most significant 8 bits i.e. D[15:8] to 0x80 and connect the Least significant 8 bits i.e. D[7:0] to sensor output. Now,
(1) If I use the 16bits format, the 8-bit monochrome data from the sensor will be sent as a 'Y' value and 0x80 will be sent instead of 'U' or 'V' value.
(2) If I use the 8bits format, I just got the Y value.
Please refer to the attached project for my code.
--------> Test I (8 bits format)
by setting width and height in cyfxuvcdscr9v034.c to the following parameter
#define UVC_WIDTH (unsigned int)376 //for testing
#define UVC_HEIGHT (unsigned int)480
I got the following picture,
It is clear that the camera has taken these 752x480 bytes as the format of 376x480 YUV2 format. Up till now we can say the the data streaming is of no problem, at least the hardware connections are correct!
----------> Test 2
Now I make the following change to my project,
(***change I) change the above setting to
#define UVC_WIDTH (unsigned int)752 #define UVC_HEIGHT (unsigned int)480
(***change II) according to https://community.cypress.com/thread/11106?start=0, I made the following change to the project,
\1. Configure GPIF for 16-bit bus width by selecting 16 Bit in the Data bus width field of Interface Definition tab of GPIF II Designer.
\2. set LD_DATA_COUNT and LD_ADDR_COUNT to 8183, since the GPIF bus width is changed to 16 bits.
\3. Rebuild the GPIF project after making the above mentioned changes.
USART debug log
[2020-11-19 22:36:46.438]# RECV ASCII>
UsbEventCB: Detected SS USB Connection
USBSetupCB:In SET_FTR 0::1
USBSetupCB:In SET_FTR 0::1
USBSetupCB:In SET_FTR 0::1
USBSetupCB:In SET_FTR 0::1
[2020-11-19 22:36:47.330]# RECV ASCII>
UVC: Completed 0 frames and 0 buffers
[2020-11-19 22:36:48.302]# RECV ASCII>
UVC: Completed 0 frames and 0 buffers
[2020-11-19 22:36:49.280]# RECV ASCII>
UVC: Completed 0 frames and 0 buffers
[2020-11-19 22:36:50.269]# RECV ASCII>
UVC: Completed 0 frames and 0 buffers
Application Started
UVC: Completed 0 frames and 0 buffers, current count = 0
[2020-11-19 22:36:51.241]# RECV ASCII>
UVC: Completed 52 frames and 31 buffers, current count = 1728
[2020-11-19 22:36:52.217]# RECV ASCII>
UVC: Completed 105 frames and 20 buffers, current count = 1728
[2020-11-19 22:36:53.195]# RECV ASCII>
UVC: Completed 158 frames and 9 buffers, current count = 1728
Now I can get just a black screen; and I don't understand why this count is 1728, it should be 16384-16=16368bytes.
(***change III)
Not sure what is problem, and I made some additional change for testing according to https://community.cypress.com/thread/34847?q=commit%20buffer%20prob
(1) Set the CY_FX_UVC_STREAM_BUF_SIZE = 36K and CY_FX_UVC_STREAM_BUF_COUNT = 3.
(2) set ADDR_COUNT_LIMITER and DATA_COUNT_LIMITER to (((36K-16) /2) -1 ) = 18423
(3) Then modify No. of bytes device can rx in single payload in probe control structure to 0x9000 as follows:
"0x00, 0x90, 0x00, 0x00, /* No. of bytes device can rx in single payload = 36 KB */"
(4) add some addition debug info in the app loop, the debug results are given as follows,
[2020-11-20 09:56:07.338]# RECV ASCII>
UsbEventCB: Detected SS USB Connection
USBSetupCB:In SET_FTR 0::1
USBSetupCB:In SET_FTR 0::1
[2020-11-20 09:56:08.224]# RECV ASCII>
Current status = 0
UVC: Completed 0 frames and 0 buffers, current count = 0
[2020-11-20 09:56:09.186]# RECV ASCII>
Current status = 0
UVC: Completed 0 frames and 0 buffers, current count = 0
[2020-11-20 09:56:10.162]# RECV ASCII>
Current status = 0
UVC: Completed 0 frames and 0 buffers, current count = 0
[2020-11-20 09:56:11.139]# RECV ASCII>
Current status = 0
UVC: Completed 0 frames and 0 buffers, current count = 0
[2020-11-20 09:56:12.133]# RECV ASCII>
Current status = 0
UVC: Completed 0 frames and 0 buffers, current count = 0
[2020-11-20 09:56:12.833]# RECV ASCII>
Current status = 0
Application Started
UVC: Completed 0 frames and 0 buffers, current count = 0
[2020-11-20 09:56:13.796]# RECV ASCII>
Current status = 7
UVC: Completed 52 frames and 15 buffers, current count = 21808
[2020-11-20 09:56:14.788]# RECV ASCII>
Current status = 6
UVC: Completed 105 frames and 10 buffers, current count = 21808
[2020-11-20 09:56:15.750]# RECV ASCII>
Current status = 7
UVC: Completed 158 frames and 5 buffers, current count = 21808
[2020-11-20 09:56:16.740]# RECV ASCII>
Current status = 6
UVC: Completed 211 frames and 0 buffers, current count = 21808
[2020-11-20 09:56:17.703]# RECV ASCII>
Current status = 7
UVC: Completed 263 frames and 17 buffers, current count = 21808
[2020-11-20 09:56:18.695]# RECV ASCII>
Current status = 6
UVC: Completed 316 frames and 12 buffers, current count = 21808
[2020-11-20 09:56:19.657]# RECV ASCII>
Current status = 6
UVC: Completed 369 frames and 8 buffers, current count = 21808
[2020-11-20 09:56:20.678]# RECV ASCII>
Current status = 7
UVC: Completed 422 frames and 3 buffers, current count = 21808
Clear feature request detected...
Current status = 6
Application Stopped
UVC: Completed 0 frames and 0 buffers, current count = 21808
[2020-11-20 09:56:21.650]# RECV ASCII>
Current status = 6
UVC: Completed 0 frames and 0 buffers, current count = 21808
[2020-11-20 09:56:22.627]# RECV ASCII>
Current status = 6
UVC: Completed 0 frames and 0 buffers, current count = 21808
I can see that the DMA buffer is committing data, but the count value is 21808, it should be 36*1024-16 = 36848.
I'm perplexed by this strange behavior, where am I doing wrong?
Show LessHi ,
Im testing Loopback case of AN65974 ,
when I click transfer file out for bulk out transfer , I have no problem and I see the data patter how fig 53 of application note ,
Then I select BULK INPUT ENDPOINT and click transfer data -in I have :
Bulk in transfer failed with error code :997
Can help me .
Thank .
Francesco
Show LessHi Francesco,
Please check if you are getting PRD_EVENT. If not, then FPGA is not sending the data to FX3. Please make sure hardware connections are ok and also make sure that data is sent to FPGA when you performed OUT transfer.
Regards,
Hemanth
Show LessHi,
Using the *FX3 dev board*, is there a recomended mechanism to boot from SPI/flash?
-- We have SPI/flash wired to the dev board, but the PMODE only allows I2C or USB boot.
I need to test some prod SPI boot/code, and was thinking of using the 2nd stage bootloader to do so. We don't really want to unsolder any PMODE pins on the dev board....
Thanks.
JN
Show LessHello,
I have a problem programming the Superspeed Explorer Kit.
I want to send 4 buffer of 200 Byte using spi. Sometimes happen that the clock 'pause' itself for ~20us and then restart whit the correct data.
I tried different frequencies, I disabled the CyU3PDebugPrint() function and I tried to build the project in Release mode but nothing changes.
I attach the code and also an oscilloscope screenshot whit the error.
CyFxSpiInit();
CyU3PSpiSetSsnLine(CyFalse);
CyU3PSpiTransmitWords(spi_cmd,1);
CyU3PSpiSetSsnLine(CyTrue);
CyU3PBusyWait(200);
CyU3PSpiSetSsnLine(CyFalse);
CyU3PSpiTransmitWords(mosi_buff_1,200);
CyU3PSpiSetSsnLine(CyTrue);
CyU3PBusyWait(200);
CyU3PSpiSetSsnLine(CyFalse);
CyU3PSpiTransmitWords(mosi_buff_2,200);
CyU3PSpiSetSsnLine(CyTrue);
CyU3PBusyWait(200);
CyU3PSpiSetSsnLine(CyFalse);
CyU3PSpiTransmitWords(mosi_buff_3,200);
CyU3PSpiSetSsnLine(CyTrue);
CyU3PBusyWait(200);
CyU3PSpiSetSsnLine(CyFalse);
CyU3PSpiTransmitWords(mosi_buff_4,200);
CyU3PSpiSetSsnLine(CyTrue);
Here the CyFxSpiInit() function:
Show LessCyU3PReturnStatus_t
CyFxSpiInit (void)
{
CyU3PSpiConfig_t spiConfig;
CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
/* Start the SPI module and configure the master. */
status = CyU3PSpiInit();
if (status != CY_U3P_SUCCESS)
{
return status;
}
CyU3PMemSet ((uint8_t *)&spiConfig, 0, sizeof(spiConfig));
spiConfig.isLsbFirst = CyFalse;
spiConfig.cpol = CyFalse;//CyTrue;
spiConfig.cpha = CyFalse;//CyTrue;
spiConfig.ssnPol = CyFalse;
spiConfig.leadTime = CY_U3P_SPI_SSN_LAG_LEAD_ONE_HALF_CLK;
spiConfig.lagTime = CY_U3P_SPI_SSN_LAG_LEAD_ONE_HALF_CLK;
spiConfig.ssnCtrl = CY_U3P_SPI_SSN_CTRL_FW;
spiConfig.clock = 8000000 ;
spiConfig.wordLen = 8;
status = CyU3PSpiSetConfig (&spiConfig, NULL);
return status;
}
I've been adapting the code from FX3 / CX3 Firmware for Streaming RAW Image Data using Cypress Driver to my hardware.
I can now use the Streamer application to receive data and the data-rate perfectly fits the theoretical H*V*bpp*fps.
I've set the GPIF II bus width to 24 and I'm using multiple-to-one transfers with those (default) settings:
#define CX3_UVC_DATA_BUF_SIZE | (0x6000) | // DMA Buffer Data Size Used: 24576 Bytes |
#define CX3_UVC_PROD_HEADER | (0) | // UVC DMA Buffer Header Size |
#define CX3_UVC_PROD_FOOTER | (0) | // UVC DMA Buffer Footer Size |
I wonder why those are the only settings I can make work!
I'm trying to set the header and footer in order to add a custom payload (in principle this is not different from UVC 12-bytes header)
I've made experiments with differets sets of values, in order to keep:
1. CX3_UVC_DATA_BUF_SIZE + CX3_UVC_PROD_HEADER + CX3_UVC_PROD_FOOTER divisible by 16
2. CX3_UVC_DATA_BUF_SIZE divisible by 16 and 24.
3. CX3_UVC_DATA_BUF_SIZE * CX3_UVC_STREAM_BUF_COUNT * CX3_UVC_SOCKET_COUNT < ~220KB
In fact I get no errors from the CyU3PMipicsiGpifLoad and CyU3PGpifSMStart nor from the CyU3PDmaMultiChannelCreate calls.
Nevertheless, when I start the streamer it reads a few bytes at the very beginning, then the device enters in a loop of "stop and restart".
Seems like if I setup the producer to write in the DMA buffer using offsets (header and/or footer) something goes wrong.
Can someone help me? Am I missing some constaint?
Show Less