Are you sure that the first sector is not protected ?
Did you try writing to other sectors ? If yes, are you facing the same issue ? If no can you please try and check if you are facing the same issue.
Also erase the first sector and try to read with out programming any data and let us know what is the data you are observing.
I executed the things that you asked me to do.
1. I tried writing in sector 2 (one page at a time and reading right away), same behavior, reading fails.
2. I tried writing in sector 3 (one page at a time and reading right away), same behavior, reading fails.
3. I tried erasing sector 1 and reading it, I am quite surprised that reading fails as well (first page reads 0x77 (512 bytes) and subsequent pages read 0xBB (512 bytes).
I have the data and results in excel/csv format which i am not able to attach here.
Thanks and Regards,
1. sector1 erase image
2. sector2 write image
3. sector3 write image
2 of 2 people found this helpful
Thanks for providing the images.
In the first image, you erased sector 0 (D8 00 00 00), but you read sector 2 (03 08 00 00). The FL512S has 256kB (=0x40000) sectors.
Below is the sequence of sector address looks like ;
Sector 0: address 0x000000
Sector 1: address 0x040000
Sector 2: address 0x080000 and so on.
Can you please provide Your schematic and full part number of FL512S for review
Mean while we suggest you do the below experiments and update us :
- Erase a sector and verify if the read data is 0xFF
- Program fewer number of bytes like 1, 2, 3, or 4 bytes and read back
- Program incremental data pattern 0x00, 0x01, 0x02… and read back to see any trends of read data
- Check signal integrity if it meets the AC spec. Oscilloscope is needed. Please send the Oscilloscope images.
I realized something after reading the datasheet properly.
Once I program a page in a sector then I cannot program it again unless I erase the whole sector in which that particular page resides.
That was the problem that every time I try to write on the same page with new data, it was getting corrupted. Bits can be changed from 1 to 0, but bits can't be changed from 0 to 1.
I was treating the flash like I treated EEPROM.
Thanks for your guidance and help, eventually it lead me to find the solution.
Thanks and Regards,