- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would like to hear advice if there is a way to update the socket by changing the DMA type while running.
I am using Manytoone multichannel.There is no problem in various reset->load operations by configuring several gpif state-machines suitable for this.However, when I try to switch to Singlechannel SlaveFifo mode, it does not work normally.
If the configuration of the DMA channel is completely different, is there a way to properly convert it during execution.
Currently, the only alternative I can do is reset the device and re-enumerating the usb, which is very inconvenient.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks to your kind help, the cause was found and resolved.
When I used the Vendor command in the Event method, it works fine.
In the case of simply switching SM, the event method was not used, but I have missed that point.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I understand that the Multi DMA channel needs to be reconfigured as a Single DMA channel.
In this case, the Multi DMA channel should be reset (CyU3PDmaMultiChannelReset) and destroyed (CyU3PDmaMultiChannelDestroy) and a new channel can be created.
Please note to stop the data transfer when the channel is destroyed. For example, if the Multi DMA channel is between PIB and UIB block, the GPIF state machine should be disabled and the for USB , flushing the endpoint, disabling the endpoints need to be done.
You can refer CyFxBulkSrcSinkApplnStop function of USBBulkSrcSink for more details. There is no need to reset the device and re numerate USB device
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, Thank you for your support.
We will send you the code with the current problem. Please check it.
1) change_SM() and 2) Change_SM_sfifo() work fine respectively.
The problem is that the operation stops when 1) is switched back to 2) while it is running.
The reason seems to be that the dma type is changed from Multichannel to SingleChannel.
Where should I look?
----
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please follow the following sequence to change/reconfigure the DMA channel as a single DMA channel from multi DMA channel
- Disable GPIF state machine ->CyU3PGpifDisable()
- Destroy the Multi DMA channel - >CyU3PDmaMultiChannelDestroy()
- Flush & reset the endpoints
- Create the single DMA channel - CyU3PDmaChannelCreate
- Set the DMA transfer size - CyU3PDmaChannelSetXfer for single DMA channel
- CyU3PGpifLoad with new state machine
- Start the GPIF state machine CyU3PGpifSMStart
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, Thank you for supports.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please confirm that none of the APIs fails when change_sm_fifo is called.
If there are no failures, please check if there are any CY_U3P_DMA_CB_PROD_EVENT in the CyFxSlFifoPtoUDmaCallback after the change_sm_fifo is executed.
Also, please try to disable the USB endpoint 1 and re enable it in set_fifo_dma
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,I am really appreciate for your time.
In the above my source, I found the missing part of initializing the Pib clock. Now converting from cyfxbulksrcsink to SlaveFifo works fine.The reason I guess is that DMA has the same structure.
Using the above function is no problem in operation.
But still converting from USBBulkLoopManualManytoOne (SDK 1.3.4) to SlaveFifo doesn't work at all.
The reason I think is because the DMA structure is different.
At Now, using below function reset and re-numerate is woking but very uncomfortable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will inspect following your suggestion,and report again.
-none of the APIs fails
-any CY_U3P_DMA_CB_PROD_EVENT
and How can I disable the USB endpoint 1 and re enable ?
Do you mean flush and reset?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
The endpoint can be disabled using CyU3PSetEpConfig API by setting epCfg.enable = CyFalse;
/* Flush the endpoint memory */
CyU3PUsbFlushEp(CY_FX_EP_CONSUMER);
/* Disable endpoints. */
CyU3PMemSet ((uint8_t *)&epCfg, 0, sizeof (epCfg));
epCfg.enable = CyFalse;
/* Disable the GPIF->USB endpoint. */
apiRetStatus = CyU3PSetEpConfig(EP_IN, &epCfg);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PSetEpConfig failed, Error code = %d\n", apiRetStatus);
CyFxAppErrorHandler (apiRetStatus);
}
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks to your kind help, the cause was found and resolved.
When I used the Vendor command in the Event method, it works fine.
In the case of simply switching SM, the event method was not used, but I have missed that point.
Regards,