USB superspeed peripherals Forum Discussions
Hello,
I'm using the Cypress example code projects to try to get data from an accelerometer (ADcmXL3021). I'm using the UsbSpiDmaMode project, where I've merged GPIO functionality into it.
When I'm trying to communicate with the accerlerometer, I'm using SPI communication. The UsbSpiDmaMode already has functions set up for this; CyFxSpiTransfer (programmer application), which uses the two functions CyU3PSpiTransmitWords and CyU3PSpiReceiveWords.
Currently, I've tried making my own functions to write and read data over the SPI interface. They look as follows:
with startSampling() and readData().
As you can see I pass in 0x3E, 0x08, 0x00 as my input, which you can also read in the datasheet for the accelerometer are the registers that start recording data. The datasheet can be found here:
(where 0x3E is the address for GLOB_CMD and 0x08 (0x0800) is the address to start recording).
My output gives the same values, which implies that I'm using the functions incorrectly. Below, my data value (200 entries) are seen from the UART debugger:
It would obviously be best if I could use the given function, CyFxSpiTransfer, but I get stuck in the CyFxSpiWaitForStatus() function when I try using it with the call: CyFxSpiTransfer(0x003E, 0x0800, 4, CyFalse)
(I'm unsure what the 3rd parameter means (*buffer).
I've seen you're employee, juchong, has made a GitHub FX3 API which includes this accelerometer, but I can't seem to understand it and how it works (I'm new to this world). It's found here:
Moreover, can I use the CyU3PSpiTransferWords function to combine the two (transmit and recieve) into one? If so, that would be much better of course.
If you could tell me where I go wrong, in the calls of the given functions, it would help me out very much! I hope it's a simple fix. All I want to do is invoke the RTS mode (later the MFFT mode) of the ADcmXL3021 accelerometer, and get a single reading of the mode for each iteration call from the main function of my program (located in the AppThread_entry function). The AppThread_entry function looks like below:
Hope I've provided enough information, other please tell me if you need more information. I've also attached the C-file to this message.
Sincerely,
Søren
Show LessHi All,
I'm feeling very stupid asking this question, here goes. I'm using Visual Studio 2019, have used the functions in CyAPI.lib without any problem.
I'm now using CyU3PDeviceGpioOverride and CyU3PGpioSetSimpleConfig but these don't exist in CyAPI.lib.
So in a pure Windows environment how do I link with these functions or must I write them myself as they are overrides?
I've downloaded everything from the downloads page, still none the wiser.
Simon
Show LessDear Sir,
I designed a custom board with CY3014+FPGA for slavefifo stream-out function for printer purpose.
The config are : GPIF interface external PCLK 48Mhz,32bits,slave fifo out.
While testing,all works OK but sometimes my PC side application(C) showed a problem of transfer failed,err code =997 and could not send data anymore,once close program and re-run ,and it could send again.Unstable.
I verified it by download USBBulkLoopAuto.img to cy3014 , and tested by Bulk Loop.exe for loopback test , no problem .like pictures attached.(sorry,I found I have no permission to upload images yet).
So,means PC->driver->usb 3.0 cable ->CY3014 chip loop back are all normal.
Then,I switched back to my slavefifo.img and run Cypress Streamer.
At first,it worked fine,however, some minutes later, the receiving is stopped and the error message is "Xfer request rejected. NTSTATUS = c0000001".
The interface between CY3014 and FPGA are simple :
32bits data(could be ignored here before problem cleared).2 bits address.
/CS and /OE are GND.
PCLK= supplied by FPGA 48Mhz.
My side,only control /RD ,depend on FX3 /empty signal.
No matter controlled /RD signal,or simply treated /RD=!/EMPTY , all have problem as above red text.
One more clue,before I click steamer START,I select end point and it showed"BULK OUT,16384 bytes,15 maxburst"
Once problem occurred, the end point change back to default "IN...".
Any idea will be appreciated.
Thanks.
BR
Steven
Show Less
USB3CV test fails with following error, When uncompressed format Y16 or Y8 used.
GUID format used for Y8
0x1B, /* Descriptor size */
ES_UVC_CS_INTRFC_DESCR, /* Class-specific VS interface Type */
0x04, /* Subtype : VS_FORMAT_UNCOMPRESSED */
0x01, /* Format desciptor index */
0x04, /* Number of Frame Descriptors that follow this descriptor: 1 */
/* GUID, globally unique identifier used to identify streaming-encoding format: Y8 */
0x59,0x38,0x20,0x20,//Y8
0x00,0x00,0x10,0x00,
0x80,0x00,0x00,0xAA,
0x00,0x38,0x9B,0x71,
0x08, /* Number of bits per pixel */
0x02, /* Optimum Frame Index for this stream: 1 (1596x1300) */
0x00, /* X dimension of the picture aspect ratio; Non-interlaced */
0x00, /* Y dimension of the pictuer aspect ratio: Non-interlaced */
0x00, /* Interlace Flags: Progressive scanning, no interlace */
0x00, /* duplication of the video stream restriction: 0 - no restriction */
/* Class specific Uncompressed VS format descriptor */
0x1B, /* Descriptor size */
ES_UVC_CS_INTRFC_DESCR, /* Class-specific VS interface Type */
0x04, /* Subtype : VS_FORMAT_UNCOMPRESSED */
0x03, /* Format desciptor index */
0x04, /* Number of Frame Descriptors that follow this descriptor: 1 */
/* GUID, globally unique identifier used to identify streaming-encoding format: Y16 */
0x59,0x31,0x36,0x20, // Y16
0x00,0x00,0x10,0x00,
0x80,0x00,0x00,0xAA,
0x00,0x38,0x9B,0x71,
0x10, /* Number of bits per pixel */
0x02, /* Optimum Frame Index for this stream: 1 (1596x1300) */
0x00, /* X dimension of the picture aspect ratio; Non-interlaced */
0x00, /* Y dimension of the pictuer aspect ratio: Non-interlaced */
0x00, /* Interlace Flags: Progressive scanning, no interlace */
0x00, /* duplication of the video stream restriction: 0 - no restriction */
Hello,
There is a question that shows in UART debug.CyU3PSetEpConfig failed, Error code = 77.
I modify the routine named USBIsochloopAuto.My destination is using the iso transfer to transfer data from FPGA to the host.
when i download the FW by control center, there is an error happened.
there is an accessory about my FW and my GPIF design and a picture about the error.
thanks a lot!
Show LessWe are using FX3 with a hub. Hub can power the downstream VBUS with 12VDC. There is 12V/5V DC/DC converter on the FX3 board. So, the power network would be like the following,
FX3 Vbus: supplied by 5V from the DC/DC convert,
FX3 3.3V, 1.8V, 1.2V : supplied by 5V to 3.3V ,5V to 1.8V, 5V to 1.2V DC/DC converter.
Will this power supply topology have any problem with FX3?
I can't load block diagram picture using this new forum system by the way. It would be easy to understand the power network with diagram.
Thanks,
Show Less
Why programming RAM succeed, but programming of I2C EEPROM failed using a same img file?
Dear Team
We are made a custom board with FX3 and Lattice FPGA, Similar to the Lattice USB3 video bridge development kit.
I am using USB to SPI boot mode.
I am getting this error. Also sometimes it showing an SPI Erase failed.
Same thing I am tried to program through the control center. There I am not getting any error. But Actually, I am not sure SPI is programmed or not.
Here I am using USB boot mode.
Regards
Praveen
i want to use EP0 to set some parameters from host to device.
i save the EP0 data from the databus to a buffer A, and than use DMA channel transfer buffer A to a PIB socket.
i want to get the flagC(correspond to the PIB socket),but i can’t see the change of the flag.
that is my programs,give me some advice plz! thank you!
if(bType==CY_U3P_USB_VENDOR_RQT)
{
if(bRequest==JY_DE_CODE_TYPE) //user-defined
CyU3PUsbGetEP0Data(wLength, &buffer, NULL);
CyU3PDmaBuffer_t buf_p;
buf_p.size = 64;
buf_p.count = 64;
buf_p.buffer = buffer;
buf_p.status = 0;
CyU3PDmaChannelSetupSendBuffer (&glChHandleSlFifoUtoP, &buf_p);
//glChHandleSlFifoUtoP is a DMA channel which i build.
CyU3PDmaChannelCreate (&glChHandleSlFifoUtoP,
CY_U3P_DMA_TYPE_MANUAL_OUT, &dmaCfg);
}
Show LessHello,
I'm using CX3 to read a MIPI camera. I'm able to correctly configure the image sensor and CX3 to receive expected frame sizes and frame rate, but I have some strange values in both situations, when generating test patterns and when reading image data. It happens on all resolutions I have tried.
Example of two configurations:
There are 2 strange things.
1. First 6 pixels have strange values and the whole image is shifted by 6 pixels
2. At every multiple of 16384 there are 6 wrong pixels - I have configured image sensor to send all zeros
The first 2 lines are embedded and do not represent the image (these 2 lines represent registers values according to image sensor datasheet).
In the attachment is one frame data. Each frame looks exactly the same.
Best Regards,
Milan
Show Less