Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Re-configure FX3 "on-the-fly"

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Re-configure FX3 "on-the-fly"
Moderator:
RSKV

Post Reply
Follow this topic



Re-configure FX3 "on-the-fly"

RobK posted on 10 Jan 2012 7:16 AM PST
Top Contributor
56 Forum Posts

Hi,

is there any safe possibility to reconfigure the FX3-hardware by using the API CyU3PDeviceConfigureIOMatrix() in a running user-application firmware? I'd like to switch the GPIF-mode from 32bit to 16bit in the user-aaplication firmware.
The FX3 API-guide says:

"This function must be called after the CyU3PDeviceInit call from the main () function. IO matrix cannot be
dynamically changed and needs to be invoked during the device initialization."

Is that the full truth ;-) or is there a backdoor somewhere?

 

Thanks!

Regards,

Robert




Re: Re-configure FX3 "on-the-fly"

aasi posted on 11 Jan 2012 02:21 AM PST
Cypress Employee
1073 Forum Posts

Hi Robert,

Please create a tech support case (MyAccount -> MyCases) so that this topic can be discussed in proper detail.

Thanks,

Anand



Re: Re-configure FX3 "on-the-fly"

Lumpi6 posted on 11 Jan 2012 07:47 AM PST
Top Contributor
183 Forum Posts

Hi Robert,

 

you can reconfigure the FX3 on the fly. You just have to take care, that all configured DMA's are destroyed before you call CyU3PDeviceConfigureIOMatrix() with the new configuration. That also means some peripheral configured DMA like USB, I2C, SPI,...

 

Best regards

Lumpi



Re: Re-configure FX3 "on-the-fly"

RobK posted on 12 Jan 2012 11:32 PM PST
Top Contributor
56 Forum Posts

That are good news :-) !

Thanks Lumpi6!!

 



Re: Re-configure FX3 "on-the-fly"

Lumpi6 posted on 12 Jan 2012 02:46 AM PST
Top Contributor
183 Forum Posts

You're welcome,

 

make sure you stop the USB interface and all other peripherals (de-init all peripherals and destroy configured dma's) before you re-configure and then re-start the USB interface.

The best place to do this in a separate thread for re-configuring the device. The configureIoMatrix call in the main still has to stay there.

 

Regards,

lumpi



Re: Re-configure FX3 "on-the-fly"

Hans10 posted on 05 Dec 2012 11:21 PM PST
Member
2 Forum Posts

Hi Lumpi,

I am trying to reconfigure the io-matrix on the fly as well, starting with an SPI  and a 16Bit-GPIF interface first and then switching to an 32Bit-GPIF interface. So far I have been successful to stop and restart my USB interface with respect to the first interface setup (SPI and 16Bit-GPIF). All that is computed in a seperated thread:

1. deinitializing and destroying all peripherals respectively DMA-channels

2. reinitializing and recreating according peripherals and DMA-channels

I can verify that within my control center and what's happening in there while I am restarting or reinitializing the first setup. Unfortunaetly, as soon as I try to change the io-matrix, especially calling >> CyU3PDeviceConfigureIOMatrix(io_cfg) << within my "reconfigure"-thread my interface does not come up again at all. So my question is, where exactly am I supposed to reconfigure my io-matrix and where to make the call >> CyU3PDeviceConfigureIOMatrix(io_cfg) <<.

When I got that right and with respect to the FX3 firmware api guide, after calling >>CyU3PKernelEntry()<< my threads are created and I have no chance to return to int main() where the original
call of >>CyU3PDeviceConfigureIOMatrix(io_cfg)<< is made. So how does that fit together with your last comment "The configureIoMatrix call in the main still has to stay there.".

Any advice would be highly appreciated.

Thank you very much in advance.

Christian

 



Re: Re-configure FX3 "on-the-fly"

Lumpi6 posted on 05 Dec 2012 03:04 AM PST
Top Contributor
183 Forum Posts

Hi Christian,

>>> So how does that fit together with your last comment "The configureIoMatrix call in the main still has to stay there.".

.

That just means, that you have to call the configureIoMatrix once before kernelEntry is called. But that comment does not exclude that you can call it in any of your worker threads. To change configuration you can call the IoMatrix function in any worker thread in respect to re-initializing all peripherals and DMA.

.

.

So actually I do not really know why it is not working in your case. I read in following topic, that some problems are in release 1.2.1 with USB3.0 reconnect. They won't occur if you are connecting through USB2.0 HS.

http://www.cypress.com/?app=forum&id=167&rID=70848

regards,

lumpi



Re: Re-configure FX3 "on-the-fly"

Lumpi6 posted on 05 Dec 2012 03:04 AM PST
Top Contributor
183 Forum Posts

....

Which FX3 SDK are you using?

 



Re: Re-configure FX3 "on-the-fly"

Lumpi6 posted on 05 Dec 2012 03:05 AM PST
Top Contributor
183 Forum Posts

...

did you stop and de-initialize and then initialize the USB phy?



Re: Re-configure FX3 "on-the-fly"

Hans10 posted on 10 Dec 2012 12:58 AM PST
Member
2 Forum Posts

Hi Lumpi,

thanks for your fast response and your more than invaluable hints. I have tried changing the SDK (from 1.2.1 back to 1.1) as well as conducting the reconnect procedure by using USB 2.0 HS instead of USB 3.0 SS. Still the same issue. So I started to get a feeling that my code must be wrong somehow. As a result I did the codewriting part again and then it worked perfectly fine. I do not exactly know what I did differently this time but it works. Thanks again for your help and your very valuable hints you have posted here and there, dealing with that issue.

Best regards,

Christian






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.