I am having one of the most confounding problems. I have been developing a camera interface using the CX3 and the OV5647 5Mp sensor for many months now. This have been going well, up to about a week ago. For some reason, every time I try to transfer video data I am getting DMA commit error 47 (CY_U3P_INVALID_SEQUENCE) when the CX3 calls CyU3PDmaMultiChannelCommitBuffer() in the DMA callback routine. Up till a week ago, I'd never seen this error. A multitude of old firmware versions all produce the same error when attempting to stream data to my PC application. I am able to load and run the demo UVC software and stream data to eCAM using the same hardware, so I know this isn't a hardware issue.
The CX3 firmware is based on https://community.cypress.com/thread/16971?q=Streaming%20RAW%20image%20data%20using%20Cypress%20driver which has been heavily modified for our device. I've written my own video display app using Microsoft's Visual Studio community 2017 and OpenCV. Briefly, It is a 64-bit command line app that runs two threads. The first thread (collection thread) starts streaming then performs continuous XferData calls (using CyAPI.lib) to retrieve camera data into one of four frame-sized buffers. A second thread (rendering thread) waits for a complete (filled) frame buffer then translates the Bayer data to an RGB image (OpenCV Mat object) and calls imshow to display the image. Simple concept. Logic insures that the buffers are used sequentially and a buffer's content isn't overwritten before it is displayed.
Things have generally been working well aside from the occasional Windows error 31 that terminates collection.
About a week ago while I was experimenting with different imager resolutions and CX3 video/DMA buffer sizes, I lost the ability to send data to my application. I have many old versions of firmware in various stages of development that I have tried, but they all result in the same invalid sequence error I noted above. The PC application, at least as far as video data collection is concerned is trivial, a single loop that calls XferData() to move the CX3 data into a DMA buffer sized portion of a video buffer. The very first call to XferData fails with the sequence error. No frames/buffers are successful.
At the start of data collection, the PC app, when it was working, would typically report error 995 a few times until the streaming process got started. Now it reports a single error: 998 (unknown error). No data is ever transferred.
I added a call to CyU3PDmaMultiChannelGetStatus() before calling CyU3PDmaMultiChannelCommitBuffer() to find the DMA channel status. It reports CY_U3P_DMA_ACTIVE, which doesn't give much insight into what's happening or why it has changed in the last couple of weeks. I've tried removing and reinstalling the FX3 development environment in case a DLL or library was corrupted, but even after the reinstall, I'm getting the same behavior.
I'd be very appreciative of anyone who can point me in a direction to hunt down this issue.