Change PIB clock frequency and GPIF width by EP0

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,

   

 

   

As I described in another thread, I can change the GPIF width at running time, but the setting does not take effect immediately. It becomes effective with the second packet after the change. I don't know why this happens.

   

Another issue is that I failed to change PIB clock at running time. I destroyed the DMA channels and called CyU3PPibDeInit and then call CyU3PPibInit to set new frequency and create DMA channels again. I found that the PIB clock is changed, but the GPIF has no output when there is out packet from USB endpoint.

   

Anyone has any idea on above issues?

   

 

   

Thanks,

   

Rover

0 Likes
1 Reply
Anonymous
Not applicable

Hi,

   

 

   

Can you please call CyU3PUsbSetEpNak API to keep the endpoint in NAK mode for 100us before the DMA channel is destroyed. And clear the NAK condition after the channel is set up once again.

   

You can do this with the help of code shown below.

   

/* Cypress: Keep the endpoint NAK-ed while it is being cleaned up. */

   

    CyU3PUsbSetEpNak (EP_CONSUMER, CyTrue);

   

    CyU3PBusyWait (100);

   

Once after the DMA channel is created

   

/* Cypress: We can release the endpoint from NAK mode now. */

   

    CyU3PUsbSetEpNak (EP_CONSUMER, CyFalse);

   

Please let me know the result after following this.

   

Thanks,

   

Sai krishna.

0 Likes