- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have simple scheme (see pic.) FX3 read 16 bit data from slave FPGA with embedded registers array.
I have made GPIF State Machine with GPIF designer (see pic.)
GPIF State Machine starts from state "START" and then I switch to state "RD_START" in Entry function SRamAppThread_Entry using CyU3PGpifSMSwitch (256, RD_START, 256, 0, 0);
In STATE6 is called interrupt callback function with code:
{
CyU3PDmaChannelSetWrapUp(&glChHandleSRamPtoU_48);
}
for (;
{
// code before
apiRetStatus = CyU3PGpifSMSwitch (256, RD_START, 256, 0, 0);
if(apiRetStatus != CY_U3P_SUCCESS){
CyU3PDebugPrint (CY_FX_DEBUG_PRIORITY, "CyU3PGpifSMSwitch failed, Error code = %d\r\n", apiRetStatus);
}
// code after
}
breakpoint set apiRetStatus = CyU3PGpifSMSwitch (256, RD_START, 256, 0, 0);
I want to read one 16 bit word, but I have "zero length" in Control Center window. When I try to read 2 words I haven't problem and I receive 2 words.
I cant read odd number of words. If I try to read odd number of words - N, I have N-1 words (even numer of words).
Were is my mistake
P.S.
/*------DMA P-Port config (AUTO mode)---------------------------------------------------------------------------------------------*/
dmaCfg.notification = 0;
dmaCfg.cb = NULL;
dmaCfg.prodSckId = CY_FX_PRODUCER_USB_SOCKET_4;
dmaCfg.consSckId = CY_FX_CONSUMER_PPORT_SOCKET;
dmaCfg.count = 1;
apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSRamUtoP_48, CY_U3P_DMA_TYPE_AUTO, &dmaCfg);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (CY_FX_DEBUG_PRIORITY, "CyU3PDmaChannelCreate failed, Error code = %d\n", apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
dmaCfg.notification = 0;
dmaCfg.cb = NULL;
dmaCfg.prodSckId = CY_FX_PRODUCER_PPORT_SOCKET;
dmaCfg.consSckId = CY_FX_CONSUMER_USB_SOCKET_8;
dmaCfg.count = 1;
apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSRamPtoU_48, CY_U3P_DMA_TYPE_AUTO, &dmaCfg);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (CY_FX_DEBUG_PRIORITY, "CyU3PDmaChannelconfig Failed, Error code = %d\n", apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
/*-------------------------------------------------------------------------------------------------------------------------*/