At what point in your code are you making these changes?
I just tried this using a vendor command and handled the vendor command this way:
CyFxGpifRegValue = 0x00000003;
retstatus = CyU3PGpifLoad(&CyFxGpifConfig);
if(retstatus != CY_U3P_SUCCESS)
CyU3PDebugPrint(1,"\r\n gpifload failed error %x \r\n",retstatus);
retstatus = CyU3PGpifSMStart(0,0);
if(retstatus != 0)
CyU3PDebugPrint(1,"\r\n gpifsmstart failed error %x \r\n",retstatus);
isHandled = 1;
It works fine. The data width changed from 16 to 8 bits and the in data transfers work as expected.
Yes i too do it in the same way.
In one case i switch from 16 bit to 8 bit , so i change the registers
CyFxGpifRegValue=0x00000067; to -> CyFxGpifRegValue=0x00000003; /* CY_U3P_PIB_GPIF_BUS_CONFIG */
CyFxGpifRegValue to half of the dma channel size for 8 bit /* CY_U3P_PIB_GPIF_DATA_COUNT_LIMIT */
Is this recommended ??
And after i load the state machine again , for one dma buffer size , the data is coming according to the 16bit configuration , only after that the data is coming according to the 8bit state machine..
Does this mean the state machine takes some time to come to the 8 bit configuration ??
If so why for one dma buffer size this issue is present ??
Is there any other way to do this operation ??
Not sure why exactly the first buffer after config change is still retaining the previous config.
However, try including the CyU3PDmaChannelReset() and CyU3PDmaChannelSetXfer() calls before the CyU3PGpifLoad() call in the vendor request. This should work.
I tried as you said and its working with the CyU3PDmaChannelReset() and CyU3PDmaChannelSetXfer() calls , but i still dont understand why this was essential ?