Before performing WRITE to FLASH, it has to erased.
So, referring to cyfxusbspidmamode example, you need to send vendor command 0xC4 with wValue=1, Lower byte of wIndex = Sector Number.
When you are doing write, why are you giving wIndex as 0x1000? Is it because you need to write to 0x1000 page address. If yes, then okay. I wanted to let you know that the wIndex here is not related to number of bytes you transfer.
thanks for the reply.
In C:\Program Files\Cypress\EZ-USB FX3 SDK\1.3\firmware\serialif_examples\cyfxusbspidmamode readme.txt file,They have given as below for spi write and read,
wIndex = SPI flash page address (Each page is assumed to be of 256 bytes and the byte address is
computed by multiplying wIndex by 256)
if wIndex is not = 0x1000 ,what will be the value for windex for spi write and read and also for spi flash erase.
please let me know.
If you are reading/writing from/to the Page 0 of Flash then, you can put wIndex as Zero, If it is from Page 1 then wIndex = 1 and so on.
If you want to perform Erase, then wValue = 1 and wIndex should be the sector number that you want to erase.
S25FL127SABMFI101 flash from cypress has 16kbytes.each page is containing 256bytes totally 63 pages from 0 to 63 pages.
for the last page 63,wIndex = 0x0040.
but for higher values for wIndex ,i am able to read and write to spi flash with control center.how ?
1 of 1 people found this helpful
The size of the Flash S25FL127SABMFI101 is 16MB and not 16KB. Please check.
To isolate the problem, please load the following standard program to RAM and see if it is re-enumerating:
C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\basic_examples\cyfxbulksrcsink
You have to load .img file to FX3 and not .elf
If it is not re-enumerating you might have to look into the schematics. You can refer to AN70707 and also FX3 Super speed explorer kit schematic as reference