USB superspeed peripherals Forum Discussions
Hi,
I am wondering if I could configure a DMAMultiChannel using 3 producers (one EP consumer). Two producers from the PIB, and the third one would be the ARM.
I got BAD_ARGUMENT error when I tried.
Br
Show LessI am using an75779 sample code and the sensor is omni vision sensor ov426+ov6946.
The data format is 10bit Raw with 400x400 resolution.
here is what I did
1. change cyfxuvcdscr.c to match 400x400 size
2.init sensor setting(the setting works fine on the other platform)
3.generate cyfxgpif2config.h based on cyfxuvc_an75779 (16bit, LD_DATA_COUNT=8183,LD_ADDR_COUNT=8183)
but I still get a black window (amcap)
the uart port shows the following message repeatly
Application Started
uvc: completed 0 frames and 0 buffers
DMA Reset Event: Frame time overflow,time period=400
Application Stopped
Show LessDear all,
I am currently testing data transfer with FX3, from GPIF2 to USB 3.0. I took the project GpifToUsb as basis. Since I would like to have a clock of 32 MHz, I reduced the PCLK clock (clkdiv=12 instead of 4) and I work with Streamer C# (modified version to do datalogging).
First, I noticed that 4 buffers of 32kB do not work properly. The throughput is very low. To solve this problem, I reduced the buffers to 4x8kB and I got almost the right throughput (32bits x 32MHz -> 128 MB/s, I got about 120-125).
So, my first question is: why does the system does not work well with large buffers and work well with small buffers? It is really weird because I think it should be the opposite...
Then, tried to connect a 8 bits counter on 8 GPIF pins to see if I lost data. Because of latency and long wire (I am using a bread board), I had to put the PCLK to 16 MHz. Then, to have a throughput of about 64 MB/s, I had to select buffers of 4x2kB becasue 4x8kB gave me a very low throughput...
So, with the original firmware, I lose 28 words of 32 bits every time a buffer is full. This seems to be normal according to the fact we have only 1 thread/socket and there is a latence while switching buffer (as explained in AN75779).
So I made some modifications in order to use 2 sockets/threads to tranfert data from GPIF2 to FX3 memory. Here is the code using CyU3PDmaMultiChannelConfig_t dmaMultiCfg; (instead of CyU3PDmaChannelConfig_t dmaCfg;)
dmaMultiCfg.size = 2048;
dmaMultiCfg.count = 4;
dmaMultiCfg.validSckCount = 2;
dmaMultiCfg.prodSckId [0] = (CyU3PDmaSocketId_t)CY_U3P_PIB_SOCKET_0;
dmaMultiCfg.prodSckId [1] = (CyU3PDmaSocketId_t)CY_U3P_PIB_SOCKET_1;
dmaMultiCfg.consSckId [0] = (CyU3PDmaSocketId_t)CY_FX_EP_CONSUMER_SOCKET;
dmaMultiCfg.prodAvailCount = 0;
dmaMultiCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaMultiCfg.prodHeader = 0;
dmaMultiCfg.prodFooter = 0;
dmaMultiCfg.consHeader = 0;
dmaMultiCfg.prodAvailCount = 0;
dmaMultiCfg.notification = CY_U3P_DMA_CB_CONS_SUSP;
dmaMultiCfg.cb = GpifToUsbDmaMultiCallback;
apiRetStatus = CyU3PDmaMultiChannelCreate (&glDmaMultiChHandle, CY_U3P_DMA_TYPE_AUTO_MANY_TO_ONE, &dmaMultiCfg);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PDmaChannelCreate failed, Error code = %d\n", apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
/* Set DMA Channel transfer size */
apiRetStatus = CyU3PDmaMultiChannelSetXfer (&glDmaMultiChHandle, CY_FX_GPIFTOUSB_DMA_TX_SIZE, 0);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PDmaChannelSetXfer failed, Error code = %d\n", apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
As you can see, I basically modified the code the "DmaMulti" objects instead of "Dma". For the state machine, I did some adaptions. There is 2 threads and the 1st thread fill in the data until the !DMA_RDY_TH0 flag is set and switch to the 2nd thread until the !DMA_RDY_TH1 flag is set. Please see the attached file.
With this configuration, I have better results but not perfect. Instead of loosing 28 words of 32 bits while the GPIFII switch the buffer, I lose only 1 word of 32 bits.
So I have 2 issues:
- Why do I have to decrease buffer size in order to have correct transfert?
- Why do I loose 1 word of 32 bits when I use 2 threads?
Thank you in advance,
Best regards,
Christian
Show LessHi: I have met a problem that host sent set feature (content : 01 03 00 00 02 01 00 00) afte i enumerated uvc and hid descriptor , when i creat UVC+HID composite device
Show LessHi: When I debugged the UVC AN75779 code, I encountered a problem. When I turned off the AMCAP, I received a SET FEATURE request from the host. Once I received the SET FEATURE content, the video streaming interface was remotely awake, and I could not With AMCAP, you must replug the USB 3.0 device. Why is this?
Show LessHi,
i am recieving data from p port to u port in the endpoint 0x81,while recieving this data through this dma channel,i am not able to send any data from u port to p port channel in the control centre through the endpoint 0x01.why?
both ptou and utop channel will not work at a time?
thank you.
Show LessHi Sir
I want to Display the RAW12 data in YUV format,I read the FAQ via the website: https://community.cypress.com/docs/DOC-9371 .And about the topic 10, it told me that I could get an example firmware. So, Which access could I get it ? If not ,which parts need to be changed based on the example firmware “Cx3UvcOV5640”?
Best Regards
ZhaiJiankun
Show LessI have FX3 connected to a main application processor via the asynchronous SRAM interface with 8 address and 16 data bits. I am trying to access the FX3 internal MMIO space from the application processor(AP).
I am able to access the P-port registers from the AP by reading and validating the PP_IDENTIFY register value(0x81). Now the next step is to access the internal MMIO registers(specifically the S-port register to configure and use the SDIO peripheral).
Seeing the registers, it seems easy. I can access the PP_MMIO_* register to program but I'm unable to do so. This is my sequence to access the SDCMD0 register.
WRITE32(PP_MMIO_ADDR, register_address_of_sdcmd0); // Write the address of the MMIO register to be accessed to the PP_MMIO_ADDR register.
WRITE16(PP_MMIO, PP_RD); // Write to the MMIO Control register to the enable the read from the address programmed in PP_MMIO_ADDR register.
WAIT(); // Wait until the read operation has been completed.
I can write to the PP_MMIO_ADDR register and have verified it by reading it back. However, I'm unable to program the PP_MMIO register. It reads back 0 every
time.
My register value for PIB_CONFIG is 0xC8000000.
My register value for GPIF_CONFIG is 0xC0000A12.
Both these values indicate that the Read operation should succeed, but it isn't and I'm not sure why. Can anyone help me here quickly ? Am I on the right path or do I need to do something else here ? Any help would be appreciated.
Show LessHi,
I am using CX3 and cyusb_linux in Linux for flashing. In my setup, I have additional I2C EEPROMs. Can I modify the source code of cyusb_linux Qt source base and write my own function which performs I2C flash write to my I2C EEPROMs? My EEPROM will have different slave addresses and I need to write to different memory locations in it.
If so, please help me what to do with the function 'i2c_write' in file fx3_download.cpp?
Show LessHello, I want to know the bit ordering of FX3
======================================================
Update : Sorry, I mean CyU3PDmaBufferInit actually, not CyU3PDmaBufferDeInit.
======================================================
at the function CyU3PDmaBufferInit the source file cyfxtx.c,
there is a comment says
"make those bits beyond valid memory range as unavailable."
========================================================
For example :
If I set my heap size to 2292 byte , then
2292/32 =71 bit , 71 status bits are required , and also
71 mod 32 = 7 .
7 bits are in glBufferManager.usedStatus[size - 1]
and there is a local variable
temp = 32 -7 = 25,
so i have 25 bits beyond valid memory range.
and finally the masking
glBufferManager.usedStatus[size - 1] = ~((1 << 25) - 1)
then i set the highest 7 bits of
glBufferManager.usedStatus[size - 1] to 1.
========================================================
please correct me if I'm wrong.
訊息由此人編輯:學人 楊
Show Less