I want to set SPI flash function to my firmware.
so how can i dynamic configuration GPIO between SPI and fifo
i don't wnat using API to jump bootload or SPI programming mode
thank you tell me that, and i know setting SPI at UART pin.
but it not i want,
so the I/O can't dynamic switch between FIFO and SPI?
Do you want to use SPI in conjuction with 32-bit GPIF?
According FX3 datasheet this is not possible to use FX3 built-in SPI module in 32-bit GPIF mode. Workaround is to implement SPI yourself in FX3 software.
i just want to do that,
1. firmware is running 32bit fifo function
2. chang GPIO from fifo to SPI (not SPI programming.img , still my firmware)
3. build new firmware through SPI flash
4. reset IC to running new firmware
so, i just change GPIO from fifo to SPI once when i want flash SPI ROM
is it possible ?
If you do not need 32-bit GPIF and SPI simultaneously, then you can reconfigure GPIF from 32-bit mode to 16-bit mode at runtime by calling CyU3PDeviceConfigureIOMatrix function again. Note that Cypress does not recommend such a dynamic reconfiguration (could it be that there may appear glitches on pins?), but at least in my application this works pretty well.
thank you a lot,
but i have other question, if i use 32 bit fifo, the SPIand UART pin are share,
so the circuit can share ?
See table 7 in CYUSB301X datasheet ( http://www.cypress.com/?docID=49087 ) and especially note 3 on page 15 there:
Note 3. When GPIF II is configured for the 32-bit data bus width, GPIO-GPIO may be configured as GPIOs or I2S, and GPIO to GPIO may be configured as GPIOs or UART interface only.
So, whatever the actual reason is, built-in SPI module can't be used in this mode. Reconfigure GPIF to 16-bit mode or implement SPI in software with using GPIOs.
So, if i use 32bit fifo and i creat GPIO to GPIO are SPI like UsbGpioSpiMode
In hardware, I can't creat UART circuit and SPI circuit at the same time
is it right ?
I am not familiar with FX3 internal circuit. There might be that GPIOs 53...56 just can't be routed to built-in SPI module if GPIF is in 32-bit mode. Or, it might be that SPI module can't be powered. Or, ... .
Anyway, whatever the reason is, if datasheet tells that you can't use SPI module when you set GPIF to 32-bit mode, then you can't (I have no reason to doubt on this statement in dataseet).
If you need to know exact reason why SPI can't be used, create a Tech Case.