|
My application is basically also the image sensor project AN75779. The problems with state machine switches seem to be know gone when using SDK 1.1.1, but there are plenty of other issues with this project.
On the USB bus the error USBD_STATUS_XACT_ERROR is reported when using the NEC/Renesas host controller when the transfer is running for a couple of minutes. If I am using an ASmedia host controller, then it reports USBD_STATUS_DATA_OVERRUN immediately. Regarding the ASmedia host controller I have to say that instead of receiving the expected 16380 Bytes for a full DMA buffer (+4 Bytes padding), the function XferData constantly returns only 6544 Bytes. God knows why.
I also found that this project is only running when calling CyU3PDmaMultiChannelReset() after a partial buffer is comitted (this is the actuall implementation of AN75779). Otherwise the DMA transfer gets stuck somehow. What is the reason for this? For my understanding there should be no need to reset the DMA channels after a partial buffer is comitted. Also I found that when a partial buffer is comitted out of the GPIF state machine (state action COMMIT), two buffers are actually produced, one with length 0 and another one that holds the expected data. Moreover, I found that when a producer commits a buffer, I actually get up to 10 consumer events triggering the DMA callback. This also doesn't make any sense and can cause the variable dmaDone in the image sensor project to underflow.
At last, I am wondering if this project can ever run with USB 2.0. My understanding is that with USB 2.0 the maximum packet size is 512 Bytes as a difference to USB 3.0 where we can send burst packets up to 16 kB. With USB 2.0 I find that the DMA call back takes too much CPU time, so that it is not possible to handle even 10 MB/s upstream data rate.
Concluding, I think AN75779 is not well thought through and found that I cannot use it in my application since I need to support also USB 2.0. Also it works only partially with a Nec/renesas host controller while with ASmedia it does not work at all.
-Silvio
|