- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
attached you can see my state machine designed using GPIF II designer. I have 2 sockets to push data to the DMA channels. COUNT_DATA = 8183
COUNT_ADDR = 8183
CTRL_CNT_HIT = 50 000
Here our dma multi channel config:
/* Create a DMA Manual channel for sending the video data to the USB host. */
dmaMultiConfig.size = CY_FX_UVC_STREAM_BUF_SIZE; //16 *1024
dmaMultiConfig.count = CY_FX_UVC_STREAM_BUF_COUNT; // 4
dmaMultiConfig.validSckCount = 2;
dmaMultiConfig.prodSckId [0] = (CyU3PDmaSocketId_t)CY_U3P_PIB_SOCKET_0;
dmaMultiConfig.prodSckId [1] = (CyU3PDmaSocketId_t)CY_U3P_PIB_SOCKET_1;
dmaMultiConfig.consSckId [0] = (CyU3PDmaSocketId_t)(CY_U3P_UIB_SOCKET_CONS_0 | CY_FX_EP_VIDEO_CONS_SOCKET);
dmaMultiConfig.prodAvailCount = 0;
dmaMultiConfig.prodHeader = 0; /* 12 byte UVC header to be added. */
dmaMultiConfig.prodFooter = 0; /* 4 byte footer to compensate for the 12 byte header. */
dmaMultiConfig.consHeader = 0;
dmaMultiConfig.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaMultiConfig.notification = CY_U3P_DMA_CB_PROD_EVENT | CY_U3P_DMA_CB_CONS_EVENT;
dmaMultiConfig.cb = CyFxUvcApplnDmaCallback;
This is GPIF cb:
/* GpifCB callback function is invoked when FV triggers GPIF interrupt */
void
CyFxGpifCB (
uint8_t currentState /* GPIF state which triggered the interrupt. */
)
{
/* The ongoing video frame has ended. If we have a partial buffer sitting on the socket, we need to forcibly
* wrap it up. We also need to toggle the FW_TRG a couple of times to get the state machine ready for the
* next frame.
*/
switch (currentState)
{
case PARTIAL_BUF_IN_SCK0:
CyU3PDmaSocketSetWrapUp (CY_U3P_PIB_SOCKET_0);
break;
case FULL_BUF_IN_SCK0:
break;
case PARTIAL_BUF_IN_SCK1:
CyU3PDmaSocketSetWrapUp (CY_U3P_PIB_SOCKET_1);
break;
case FULL_BUF_IN_SCK1:
break;
default:
/* This should not happen. Do nothing. */
return;
}
CyU3PGpifControlSWInput (CyTrue);
CyU3PGpifControlSWInput (CyFalse);
}
In our code when a frame is over (recognized as we'll receive a partial buffer and not a full one) we attach a footer and then proceed in transfering data to host PC.
However, this is the error we receive when we try to start the streaming: DMA Reset Event: Commit buffer failure
Could it be because we try to send too many frames ? Like the FPS is too high?? We are sampling data at 100MHz.
Before we tried this machine and it worked:
Here we had:
COUNT_DATA = 8191
COUNT_ADDR = 8191
CTRL_CNT_HIT = 1250
LV was a signal that was high for 17us and down for 3 us. Basically we did the same thing as before (2 sockets) but we were sampling only when LV was high.
Can someone help me understand why my new machine doens't work?
Thanks,
Lnda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please refer to the state machine and application note and also the code of AN75779. The application note will help you to understand the state machine very well. and the state machine is also similar to yours.
Please check the firmware code changes as well. And let us know if you have any query further.
Best Regards,
Sakshi Bakal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Sakshi ,
Thanks for the suggestion, we actually started following the project AN75779, but we can't undertand what's wrong in our code (we want to be indipendent from LV).
Thanks
Linda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Linda,
Please do share your firmware code file along with the state machine with us so that I can check on my side and let you know what's wrong.
Best Regards,
Sakshi Bakal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What part of code do you need ??
Best regards,
Linda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you share the zip file if it's possible?
Regards,
Sakshi Bakal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Linda,
There are 3 image files in debug folder which one should I use to check?
Regards,
Sakshi Bakal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
You have mentioned that "we want to be independent of LV" but If you say so how your frame will give you the exact picture, it depends on LV for filling the frame. Can you please elaborate on how exactly you want to output to be and what changes you want apart from AN75779?
Regards,
Sakshi Bakal