- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
We are using S25FL127SABMFI101 flash for booting in FX3. Its connected as in the schematic attached to this thread.
Before testing fFX3 boot, i am trying to read and write data to this SPI flash by using the example code in C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\serialif_examples\cyfxusbspidmamode. I am not able to read from the SPI flash, this example code is tested in the control center. I have attached the control center screenshots.
I am getting 00 as control in transfer that is SPI read from the FLASH.
Regards,
Geetha
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
- Before writing to the flash, the flash needs to be erased. Please go through the vendor commands for erasing the flash.
Note: For erasing wIndex value is the sector address and not page address. S25FL127SABMFI101 flash is of 16MB so 65536 pages ( each of 256 bytes) and as per the firmware each sector is of 64KB. To erase the page, that whole sector should be deleted.
- S25FL127SABMFI101 flash (16MB) will have 256 sectors and each sector will have 256 pages.
- for reading /writing from/to flash the wIndex will take the page number to be read/written from/to.
Please find the attached results of the cyfxusbspidmamode firmware example for reading and writing to page 0x00FF
Regards,
Rashi
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Can you please send the vendor command as follows?
1. READ
2. ERASE
3. WRITE - all 'A' s for one sector
4. READ
Please let me know the results of two reads.
You may probe the SPI lines and see whethe there is proper communication.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
it works for windex is < 0x00EF,if windex is =>0X00FF it will give only 00 as control in transfer.
how this windex is related to page address and sector number,please let me know.
thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please check how the Windex is parsed in the setupcb in the firmware.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
uint16_t glSpiPageSize = 0x100; /* SPI Page size to be used for transfers.
pageAddress=windex
byteAddress =pageAddress *glSpiPageSize
location[1] = (byteAddress >> 16) & 0xFF; /* MS byte */
location[2] = (byteAddress >> 😎 & 0xFF;
location[3] = byteAddress & 0xFF; /* LS byte */
I tried calculating page address,but it is not matched with spi page address.
can you help me.
regards
geetha.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Geetha,
Please let me know what is the expected page address and what did you get.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello ,
I couldnot find the page address in S25FL127SABMFI101 datasheet and not able to verify address in datasheet and fx3 code.This flash is from cypress.if you find any answer please let me know.
regards,
geetha.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
For getting the page address / page count, refer to the code snippet
CyU3PDmaBuffer_t buf_p;
uint8_t location[4];
uint32_t byteAddress = 0;
uint16_t pageCount = (byteCount / glSpiPageSize);
The page size is 256 bytes as mentioned in firmware
uint16_t glSpiPageSize = 0x100; /* SPI Page size to be used for transfers. */
Please refer to 9.5.1.2 Page Programming in https://www.cypress.com/file/177961/download (S25FL127SABMFI101 datasheet)
Regards,
Rashi
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
- Before writing to the flash, the flash needs to be erased. Please go through the vendor commands for erasing the flash.
Note: For erasing wIndex value is the sector address and not page address. S25FL127SABMFI101 flash is of 16MB so 65536 pages ( each of 256 bytes) and as per the firmware each sector is of 64KB. To erase the page, that whole sector should be deleted.
- S25FL127SABMFI101 flash (16MB) will have 256 sectors and each sector will have 256 pages.
- for reading /writing from/to flash the wIndex will take the page number to be read/written from/to.
Please find the attached results of the cyfxusbspidmamode firmware example for reading and writing to page 0x00FF
Regards,
Rashi
Rashi