I have a custom FX3 board with S25FS064S. I programmed the spi flash via control center. I changed the PMODE[0:2] 11F to 1F0 to enable boot from spi flash. When i program a new flash, FX3 can boot from the flash. But when i want to change the img file in the flash, FX3 can't be programmed anymore. I tested the img files with a evaluation board and it worked well with both of the img files. What could be the problem?
Thank you for your reply.
I am aware of that article. But the flash in my design is S25FS064S, not S25FS128S. In AN76405 EZ-USB® FX3™/FX3S™ Boot Options, the "selecting SPI flash" subsection says that S25FS064S is suitable for FX3. What should i modify in CyBootProgrammer.img ?
S25FS064S also has hybrid sectors and hence needs Flash register (CR3NV) write to disable 4KB Erase. The changes mentioned in above KBA is only for S25FS128S and we need to check if it can be applied to S25FS064S as well (Small changes might be required with respect to address length)
I modified the cyfxflashprog according to the article. Then i programmed the SPI flash with two different image to see whether i can change the program in the flash. I used Control Center to read SPI flash data. I read first 4096 bytes and detect some differences between reads. So it seems i can change program in the flash. Yet, when i set booting from SPI flash, FX3 still can't boot from SPI flash.
In Control Center, FX3 USB Bootloader device seems to be connected. When i attemp to read SPI flash again, i got the following error.
CONTROL IN transfer
CONTROL IN transfer failed with Error Code:997
As far as i know, 3 bytes addressing is used. Since the default of CR2V is CR2NV and default state of CR2NV is 3 byte adressing, i don't know what to modify. Can you explain what to do?
As the address length is 3-byte, no change to the code in KBA is needed. But I think you are already aware of the fact that CR3NV is OTP type register. Please make sure whether the register write you are making is taking effect.
Also please read out entire fx3 image from Flash after you used modified flashprog. Ensuring correct image in Flash is important for booting.