USB superspeed peripherals Forum Discussions
Hello,
Long version:
I am new to cypress products, but I am working with microcontrollers since ages. Currently I have a project where a CYUSB3033 seems to fit in.
So I got a ZTEX usb-fpga-2.18 board (since the pactroninc guys a bit "shady" and pricey for what you get). After I installed the EZ USB Suite, I set up the JLink debugging connection as described in the manual and experienced the Bad JTAG communication Error after some googleing I found the linked solution. Currently everything works, but it is not as strait forward as I am used to from other manufacturers. E.g. if I just want to run the code I can ether use the debug mode and let it run, kill the debug session and switch back to the previous perspective or place the jumper on the board and switch to Cypress USB Control Center and upload the firmware there. Both ways are not as seamless, as I would expect from someone who calls themselves industry leader. I would have expected to just click the little green play button and the code gets uploaded. I tried to find a way to use JLink commander to just upload the code (and run it), but without success. It seems to upload the code and then does not proper reset the PC. That way I found that the CYUSB* devices are not officially supported by SEGGER, funny since I read in some manual from Cypress, that JLink is their preferred tool.
Short version:
Is there a way to configure EZ USB Suite to one click upload the code to the device?
Thanks,
Michael
Show LessI want to change the DMA burst length and buffer size. The firmware I'm using is the SlaveFifoSync, which I downloaded from the AN65974. I notice that the the default setting is following(sorry, I can't find how to insert code):
#ifdef STREAM_IN_OUT
#define BURST_LEN 16
#define DMA_BUF_SIZE (16)
/* Slave FIFO P_2_U channel buffer count */
#define CY_FX_SLFIFO_DMA_BUF_COUNT_P_2_U (4)
/* Slave FIFO U_2_P channel buffer count */
#define CY_FX_SLFIFO_DMA_BUF_COUNT_U_2_P (8)
#endif
So I change the setting like this:
#ifdef STREAM_IN_OUT
#define BURST_LEN 16
#define DMA_BUF_SIZE (16)
/* Slave FIFO P_2_U channel buffer count */
#define CY_FX_SLFIFO_DMA_BUF_COUNT_P_2_U (1)
/* Slave FIFO U_2_P channel buffer count */
#define CY_FX_SLFIFO_DMA_BUF_COUNT_U_2_P (1)
#endif
It works fine for my application. But the DMA buffer is still large. It spends about 6 seconds for data to fill the 16KB buffer. So I want to continue to reduce the DMA buffer size. The setting is following:
#ifdef STREAM_IN_OUT
#define BURST_LEN 2
#define DMA_BUF_SIZE (2)
/* Slave FIFO P_2_U channel buffer count */
#define CY_FX_SLFIFO_DMA_BUF_COUNT_P_2_U (1)
/* Slave FIFO U_2_P channel buffer count */
#define CY_FX_SLFIFO_DMA_BUF_COUNT_U_2_P (1)
#endif
The buffer size is 2KB. But the data transfer failed. I don't know where is the problem. Maybe I made the wrong amendment, or I need to continue to modify something else. Thanks for any advice.
Show LessHello guys,
We would like to use FX3 module to help us transfer video streams from our IMX253 camera to the host PC, as we described in this thread.
Shortly, the image size as well as the frames per second, bits per pixel and the width of DataBus differ from what we can find in AN75779 document.
RashiV_61 suggested to implement some more changes that I could find in AN75779 document (changes of glProbeCtrl[CY_FX_UVC_MAX_PROBE_SETTING] settings withing uvc.c file). We implemented all those changes but there was no success!
Let me take a deeeeeep breath and explain you one more time what we did on our side, kindly asking you to let us know if we missed something:
Let's say that we have the following parameters:
Image size: 2504 x 1502 pixels
fps: 21.48376241501965
Bits per pixel: 16
Color format: YUV2
DataBus width: 16 (DQ[15:0])
We did the following modifications:
1) New GPIF II Designer project is created. The width of Databus is set to 16-bits and the limit value of LD_ADDR_COUNT and LD_DATA_COUNT counters to 8183. Consequently, new cyfxgpif2config.h header file is generated.
2) A copy of EZ USB UVC_AN75779 project is created and cyfxgpif2config.h header file replaced. The firmware example is downloaded from here (version of the firmware from 10/30/2017).
a) in uvc.c file
io_cfg.isDQ32Bit | = CyFalse; |
to the best of my understanding, this parameter should be set to TRUE only if Databus width is equal to 32-bits. Am I wrong?
b) We also changed the info about image size, fps and bit rate of the Super Speed Configuration descriptor in:
/* Class specific Uncompressed VS frame descriptor */ | ||
0x1E, | /* Descriptor size */ | |
0x24, | /* Descriptor type*/ | |
0x05, | /* Subtype: uncompressed frame I/F */ | |
0x01, | /* Frame Descriptor Index */ | |
0x01, | /* Still image capture method 1 supported */ | |
0x06, 0x08, | /* Width in pixel - 2054*/ /* Changed ! Was 1280*/ | |
0xDE, 0x05, | /* Height in pixel - 1502*/ /* Changed ! Was 720*/ | |
0xF5,0x92,0x35,0x3F, | /* Min bit rate bits/s. - 2054 x 1502 x 21.48376241501965fps x 16-bits per pixel */ /* Changed */ | |
0xF5,0x92,0x35,0x3F, | /* Max bit rate bits/s. - 2054 x 1502 x 21.48376241501965fps x 16-bits per pixel */ /* Changed */ | |
0x00,0xA4,0x1F,0x00, | /* Maximum video or still frame size in bytes(Deprecated)*/ | |
0x3B, 0x1A, 0x07, 0x00, | /* Desired frame interval in the unit of 100ns: 21.48376241501965 fps */ /* Changed! was 30fps*/ | |
0x01, | ||
0x15,0x16,0x05,0x00, | /* Not sure what is the meaning of this field !?*/ /* Frame interval 3: Same as Default frame interval */ |
I did not touch the deprecated /* Maximum video or still frame size in bytes (Deprecated) */ field. Should I change it?
Also, I don't know what is the meaning of the last field in the descriptor. The guy in this thread says this is /* Frame interval 3: Same as Default frame interval */ and that it should be equal to Default frame interval. Should I change this field somehow?
c) According to suggestions from RashiV_61, in uvc.c file we updated the fields of glProbeCtrl[CY_FX_UVC_MAX_PROBE_SETTINGS] settings:
0x00, 0x00, | /* bmHint : no hit */ |
0x01, | /* Use 1st Video format index */ |
0x01, | /* Use 1st Video frame index */ |
0x3B, 0x1A, 0x07, 0x00, | /* Desired frame interval in the unit of 100ns: 21.48376241501965 fps */ /* Changed */ |
0x00, 0x00, | /* Key frame rate in key frame/video frame units: only applicableto video streaming with adjustable compression parameters */ |
0x00, 0x00, | /* PFrame rate in PFrame / key frame units: only applicable to video streaming with adjustable compression parameters */ |
0x00, 0x00, | /* Compression quality control: only applicable to video streaming with adjustable compression parameters */ |
0x00, 0x00, | /* Window size for average bit rate: only applicable to video streaming with adjustable compression parameters */ |
0x00, 0x00, | /* Internal video streaming i/f latency in ms */ |
0x68, 0x26, 0x5E, 0x00, | /* Max video frame size in bytes - 2054 x 1502 x 2Bytes per pixel*/ /* Changed */ |
0x00, 0x40, 0x00, 0x00, | /* No. of bytes device can rx in single payload = 16 KB */ |
What we changed here is Max video frame size in bytes and Desired frame interval.
Is there anything else we are missing here, guys?
We are using custom-made board with FX3 on it. The only accessible interface for debugging is JTAG interface. Can we use JTAG interface to debug FX3 and see what is going on inside?
Thanks for your time and effort.
Sincerely,
Bojan.
Show LessHi All:
I accomplished the FX3-UVC device and added the Video Control structure such as Brightness control, and it works on AMCap!
Now, I need to use the VLC player by some reasons, and it's OK to execute Video Stream.
However, I CANNOT find the Video Control item such as Brightness control on the VLC player...
Could somebody give me some suggestions?
Thank you so much!
Hughes
PS. I only can find the "Maun" -> "Tools" -> "Effects and Filters", but it's not what I want...
Show LessI could not find the above mentioned file neither in the Software Development kit nor at the Cypress site. Could you give me a download-link please ?
Kind regards
Pierre Hermans
Show LessNormally we use CyFx3BootUsbStart( CyTrue, ..) with option "Re-Enumeration will NOT be done" and it works as expected.
At the unusual situation where the device power up, start it's USB connect cycle, short after CyFx3BootUsbStart, CyFx3BootUsbConnect but before device became emumerated, a very short USB disconnect / re-connect occur. From this moment on, the device don't start it's enumeration cycle, firmware stay at bootloader and wait until USB connection is ready.
This behaviour can be easily reproduced within a debug session, by restarting the debug session directly after CyFx3BootUsbConnect have been called. From than till next device reset (power cycle or CyFx3BootDeviceReset), no USB enumeration will be triggered. Further firmware reloads within the debugger won't fix that.
If we call CyFx3BootUsbStart( CyFalse, ..) with option "Re-Enumeration will be done" than it seems to work in any situation.
Is there a way to reset the USB within Second Stage Bootloader to ensure the same behavior like after first power up? Any thing to undo the changes cause by CyFx3BootUsbStart - option "Re-Enumeration will NOT be done"?
Show LessI have a callback registered with CyU3PUsbRegisterSetupCallback and I am not using fast enumeration.
Currently I am using the callback to log setup transactions.
Comparing my log with that from a USB analyzer I can see that I get most SETUP transactions with the exception of SetAddress.
Is it possible for the application to be notified when a SetAddress transaction has occurred?
Show LessHi All,
I have been working on this firmware (https://community.cypress.com/thread/16971?start=0&tstart=0) and have finally run out of memory? When I compile my latest code, the linker spits out:
c:/program files (x86)/cypress/ez-usb fx3 sdk/1.3/arm gcc/bin/../lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/bin/ld.exe: OV5647_dual_camera_NOUVC_e.elf section `i._tx_mutex_prioritize' will not fit in region `SYS_MEM'
c:/program files (x86)/cypress/ez-usb fx3 sdk/1.3/arm gcc/bin/../lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/bin/ld.exe: section .data loaded at [40030000,4003188f] overlaps section i._tx_mutex_prioritize loaded at [4002ff00,400300ff]
c:/program files (x86)/cypress/ez-usb fx3 sdk/1.3/arm gcc/bin/../lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/bin/ld.exe: section i._tx_queue_cleanup loaded at [40030100,400301b7] overlaps section .data loaded at [40030000,4003188f]
c:/program files (x86)/cypress/ez-usb fx3 sdk/1.3/arm gcc/bin/../lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/bin/ld.exe: region `SYS_MEM' overflowed by 440 bytes
C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\ARM GCC\/arm-none-eabi/lib/libc.a(lib_a-writer.o): In function `_write_r':
writer.c:(.text+0x20): undefined reference to `_write'
C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\ARM GCC\/arm-none-eabi/lib/libc.a(lib_a-closer.o): In function `_close_r':
closer.c:(.text+0x18): undefined reference to `_close'
C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\ARM GCC\/arm-none-eabi/lib/libc.a(lib_a-lseekr.o): In function `_lseek_r':
lseekr.c:(.text+0x20): undefined reference to `_lseek'
C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\ARM GCC\/arm-none-eabi/lib/libc.a(lib_a-readr.o): In function `_read_r':
readr.c:(.text+0x20): undefined reference to `_read'
C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\ARM GCC\/arm-none-eabi/lib/libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text+0x18): undefined reference to `_sbrk'
collect2.exe: error: ld returned 1 exit status
cs-make: *** [OV5647_dual_camera_NOUVC_e.elf] Error 1
13:08:43 Build Finished (took 13s.977ms)
The linker map files are pretty confusing to look at so I have written a little program to summarize lengths of the various modules. When I look at the current version of my code, and a former version that does compile without error, I see the current version is *shorter* than the old version that compiles, which is perplexing. This brings up numerous questions:
1) Can someone point me to a document that discusses the various memory sections used by the CX3 libraries?
2) The CX3 (CYUSB3064) part data sheet says the parts have 512 or 256 KB of SRAM but there is no mention as to which family member has how much memory. Are we to guess that the 4-lane version has 512K and the 2-lane as 256K?
3) Neither program is anywhere near close to this limit, is SYS_MEM some special memory section that must be considered separately, or am I not understanding how data is loaded for CX3 execution?
4) I have seen the compiler spit out similar errors when I had a grave macro syntax problem. I had imbalanced parenthesis in a macro and compensated for it by adding an extra parenthesis in the macro expansion. The compiler didn't mention and memory overlaps, but did spit out many missing symbol errors (_sbrk, _write, _close, ...).
Thanks as always,
Scott
Show LessHello FX3 gurus,
We want to take uncompressed video streams from Sony's IMX253 CMOS sensor and transfer them to the PC by the help of FX3 module. The best we can take from IMX253 sensor is UHD image of 4096 x 300 pixels in size. We have FPGA device as a bridge between IMX253 and FX3 module. FPGA is used to apply demosaicing, noise reduction, color/gamma correction algorithms. What we have at the output of all those blocks are pixels in RGB space with 12-bits resolution per pixel (or 10-bits resolution per pixel if we don't have enough FPGA resources).
I found that AN75779 application note could be the perfect place to start with. Given the fact that we want to take the maximum we can from FX3 module, our Databus is 32-bit wide. Consequently, I created a new project in GPIF II Designer by following AN75779 document in order to generate appropriate cyfxgpif2config.h header file. Basically, I changed the width of the Databus and limit value of LD_ADDR_COUNT and LD_DATA_COUNT counters to 4091.
Here is what I did on the FX3 firmware side (SDK 1.3.4 is used, by the way):
In uvc.c file:
io_cfg.isDQ32Bit | = CyTrue; |
I also changed the info about bit depth, image size, frame size and frame rate of the Super Speed Configuration descriptor in cyfxuvcdscr.c file:
0x20, | /* Number of bits per pixel - 32 */ |
0x00, 0x10, | /* Width in pixel - 4096*/ | |
0xB8, 0x0B, | /* Height in pixel - 3000*/ |
0x00,0x20,0xBC,0xBE, | /* Max bit rate bits/s. - 3.2Gbps */ |
0x5B, 0xCC, 0x15, 0x00, | /* 7fps */ |
I did not touch Min bit rate bits/s field and I leaved streaming encoding format to YUY2 for the moment.
Is there anything we are missing to change? I did not change the descriptor fields of the High Speed Configuration descriptor because we are mainly interested in USB 3.0 transfers.
We would like to use some open-source video players (e.g. VLC, VirtualDub...) to try playing our streams on PC side. Consequently, we should transfer them some of the streaming encoding formats they are supporting. It would be the most appropriate for us to send uncompressed streams in RGB format but I've been reading that sending the stream in RGB format is not supported by those open-source video players. Can you confirm this?
Is there any other streaming encoding format in addition to YUY2 that is supported by open-source video players? How about YCbCr?
Thank you very much for your time and effort. It is really appreciated.
Sincerely,
Bojan.
Show LessHi
My project we are using the cypress FX3s dongle board. I need to increase the speed of SD card writing & Reading using (FATFS),
Currently my project coping speed is taking around 69 seconds for 1 Gb file ,I want to be reduce to 55 second .
so I am planning to use ping pong buffer method to increase the copy speed .
MY project overall view
Currently three threads I configured
thread1 - Read the data from the SD card & Writing into the Second SD Card (this thread I m planning split in to two thread one for write another one for read)
thread2 - using for the USB UART
thread3 - using for USB Mass Storage
Thread3 will be Suspended when thread1 execution.
when first thread reading data from SD card using DMA, the handle is given to the DMA that time I plan to switch to another thread for writing, but it’s not switching without Thread sleep function if I use thread sleep function, my copying time is increased Actually I want, two thread to be act as a parallel operation then may be I can increase the speed please provide me your valuable suggestion
Best Regards
K Manikandan
Show Less