S25FL512S issue with r/w commands using extended addressing.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
JaEn_4672641
Level 1
Level 1

I was using standard 24-bit addressing on this part for read, write, sector erase and bulk erase.  The hardware is a Enclustra ZX3 SoM, so a Xilinx Zynq.

However, when switching to the extended addressing commands described in  9.1.1 of the data sheet, I am no longer reading the correct values.  I am, instead, always receiving a value of 0x00.  Other commands, such as reading flash ID, register read/write, etc. seem to continue to work properly.  My guess is that bulk erase is also still working but I can't confirm that since I am always reading a value of 0x00.

I am wondering if I might be doing something wrong with these reads and writes or what else I may have missed to cause this problem.

Thanks!

pastedImage_1.png

pastedImage_0.png

0 Likes
3 Replies
Apurva_S
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi Jason,

I would like to point out that the command which you have used for read operation (0x6C) is the Quad Output Read command, which means that the output data from the flash comes on all four IO lines. See figure below.

pastedImage_0.png

For using quad commands, you need to first enable the Quad mode by setting the Quad bit (CR1[1]) in Configuration Register 1. Can you please confirm whether you have enabled quad mode on your flash device?

If you don't want to use the quad mode, and are only going to use the Single SPI read command that expects four bytes of address then you should be using the 4READ (0x13) command.

Hope this solves your problem. If not, please let me know your queries.

Best Regards,

Apurva

0 Likes

Hello Apurva.

To be clear, Quad Mode does work with 3-byte addresses.  It is when I switch to the 4-byte addresses and the associated commands that I seem to be getting the incorrect data.

A couple of things to clear up and add:

1) I am actually receiving values of 0xFF for all extended address quad reads (not 0x00).

2) The code I showed you above didn't have the offset correction to account for the dummy byte on a quad read (I had been testing non-quad and didn't get it changed back).  Correct code below.

3) I have noticed by switching back and forth between 3/4 byte addressing that the 4-byte addressing seems to work for writes only. The reads always return 0xFF.

4) I also noticed an interesting difference in behavior between the commands 0x02 (Page Program) and 0x12 (Ext Addr Page Program): When writing a single byte, 0x02 seems to modify the subsequent 3 bytes by setting them to 0x00.  0x12 does not exhibit this behavior.  I've seen this with two different qspi drivers.

pastedImage_0.png

0 Likes

Hi Jason,

Thank you so much for the clarification.

"Quad Mode does work with 3-byte addresses.  It is when I switch to the 4-byte addresses and the associated commands that I seem to be getting the incorrect data."

>> Are you reading the same memory location every time and getting the wrong result with 3 byte address command but correct result with 4 byte address command ?

Please answer my below questions based on the information you have provided -

1. I would like to inform you that when a flash memory part is shipped, it is a completely erased part, which means all memory locations have data 0xFF. Can you please confirm that you are not reading an erased sector? If you are reading an erased sector, 0xFF is the correct output.

3. How have you confirmed that the program operation has completed successfully? Are you capturing the SPI waveforms? Have you tried reading the Status Register at the end of the program operation? Are you observing any of error bits being set?

4. Is it possible for you to provide SPI waveforms for the below operations?

  • Program operation using 0x02 command
  • Program operation using 0x12 command
  • Read operation using 3 byte addressing Quad read command (0x6B)
  • Read operation using 0x6C command

Regards,

Apurva

0 Likes