Can the GPIF configuarion be changed during running time?

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

cross mob
Anonymous
Not applicable

Hi,

   

 

   

I'm trying to use the GPIF as a master to read/write and SRAM type devices. Since these devices have different characteristics, I need to change GPIF configurations frequently. But I don't want to reboot and load different firmware every time. I plan to change configurations, such as clock frequence and port width, by control endpoint during running time.

   

Is it possible to implement this?

   

 

   

Thanks!

   

Rover

0 Likes
4 Replies
Anonymous
Not applicable

Hi Rover,

   

It is possible to do that. You don't have to load firmware every time you want to change the GPIF descriptors.

   

Use CyU3PGpifDisable(CyTrue);

   

Then you can load new GPIF configuration using CyU3PGpifLoad() and start the state machine using CyU3PGpifSMStart() API.

   

Thanks,

   

sai krishna.

0 Likes
Anonymous
Not applicable

Thank Sai for the reply. I want to know if I need to config the DMA again?

0 Likes
Anonymous
Not applicable

 Hi Rover,

   

 

   

The DMA config would depend upon the two different GPIF configurations that are going to be loaded one after the other.

   

If there is no change necessary in the DMA size, count, or type when you are switching between the GPIF configurations, then CyU3PDmaChannelReset() and CyU3PDmaChannelSetXfer() calls would suffice. But if the new GPIF configuration needs the DMA channel parameters to be changed, then you would need to perform a CyU3PDmaChannelDestroy() and then create a new DMA channel with the new parameters.

   

 

   

Regards

   

Shashank

0 Likes
Anonymous
Not applicable

I tried to change the bus width of GPIF. However, the new width becomes effective from second transfer after I changed the width. That is to say, the first packet I sent from USB still uses the old settings. Why?

0 Likes