- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm using S25FL256 connected to stm32f7 via SPI (single mode), and I'm trying to erase sector at address 0x600000.
The problem is that when I issue the command "sector erase" (0x21), 2 sectors are erased: address 0x600000, and address 0x6F0000.
Here's the sequence of operations:
tmp_buffer1 = {0,2,4,6,8,10,12,14,16,18}; //10 elements
//WRITE
slld_WriteOp(device_num, (ADDRESS)(0x600000), tmp_buffer1, 10, &dev_st);
slld_WriteOp(device_num, (ADDRESS)(0x6F0000), tmp_buffer1, 10, &dev_st);
//READ
slld_ReadOp( device_num, (ADDRESS)(0x600000), tmp_buffer11, 10); // => tmp_buffer11 now has the following data: {0,2,4,6,8,10,12,14,16,18}
slld_ReadOp( device_num, (ADDRESS)(0x6F0000), tmp_buffer22, 10); // => tmp_buffer22 now has the following data: {0,2,4,6,8,10,12,14,16,18}
//ERASE
slld_P4EOp(device_num, (ADDRESS)0x600000, &erase_res); //this is the sector erase operation (0x21)
//READ
slld_ReadOp( device_num, (ADDRESS)(0x600000), tmp_buffer11, 10); // => tmp_buffer11 is now all 0xFF
slld_ReadOp( device_num, (ADDRESS)(0x6F0000), tmp_buffer22, 10); // => tmp_buffer22 is now all 0xFF
The problem happens also in other sectors, for example 0x200000 (which erases also 0x2F0000). Should I try more sectors...?
The driver code is attached.
Please help... I've been debugging this for days with no avail...
Thanks in advance
Update:
I noticed that also the opposite happens: erasing 0x6F0000 erases also 0x600000
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the assistance. The problem is fixed. The problem was that something was flipping the address bytes. For example if I sent address 0x00F0000, it was sent as 0x0000F00. Perhaps something inside HAL_SPI functions does that (although my SPI is configured as MSB first). Now I send the address byte by byte and the problem doesn't happen anymore.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Could you please let us know the complete part number?
Thanks and Regards,Sudheesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sdhk wrote:
Hi,
Could you please let us know the complete part number?
Thanks and Regards,Sudheesh
Hi,
Thanks for the reply. Here's the complete part number:
S25FL256LAGMFI003
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
1. How many devices are showing this behavior? Are you observing this with all of the devices that you tested?
2. Can you provide waveform for Program, erase and read operations?
Thanks and Regards,
Sudheesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. How many devices are showing this behavior? Are you observing this with all of the devices that you tested?
I tested on 4 different devices and all of them had the problem.
2. Can you provide waveform for Program, erase and read operations?
Top (green) is MISO and bottom (yellow) is CS:
Erase of address 0x600000:
Write to address 0x600000:
Read from address 0x600000:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Any help please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here are more images of the CLK (yellow, up) and MOSI (green, bottom) during erase operation (0x21):
Write Enable:
Erase:
Poll:
Write Disable:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Update:
Turns out that more data is deleted than I thought.
If I delete sector at 0x600000, looks like all the data from 0x600000 to 0x6F1000 is deleted!
That is 964KB, or 241 sectors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I need a clarification about the waveform that you provided on December 19th. Why the CS# pin is toggling multiple times during erase and write operations? Please clarify.
Please provide waveform of MOSI and CS# pin for erase and write operations.
Thanks and Regards,
Sudheesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the assistance. The problem is fixed. The problem was that something was flipping the address bytes. For example if I sent address 0x00F0000, it was sent as 0x0000F00. Perhaps something inside HAL_SPI functions does that (although my SPI is configured as MSB first). Now I send the address byte by byte and the problem doesn't happen anymore.