0
\$\begingroup\$

I am trying to use a NOR flash memory device: SST25VF016B (with STM32 discoveryboard F407VG). However, I am confused on some terms on their datasheet. You can find the datasheet here: https://www.elfa.se/Web/Downloads/_t/ds/SST25VF016Bx_eng_tds.pdf

In the datasheet, it is mentioned that this device have 16Mega bits of memory. However, in the erase section, it state that it has: 1. Full Chip Erase 2. 4KByte sector erase 3. 32 Kbyte block erase 4. 64 Kbyte block erase

What I understand after looking some references is that sector is the smallest section in a memory device, and then we have blocks. But, in that case, 4KByte sector means that it will erase from address 0 for example, until address 4000?

And one more question, when I tried to program this device, it said that we need to erase the chip first before programming. Will it be the same if I use the full chip erase, or should I erase it block by block (or sector by sector)

Can someone help me try to understand this? Thanks a lot!!

Cheers

\$\endgroup\$
1
\$\begingroup\$

First thing to understand about NOR flash is that programming individual bytes can only change 1-bits to zero but cannot modify a bit already set to zero. To set a bit back to one, the entire smallest-erasable-section must be erased.

In this chip, the smallest erasable section is a 4Kbyte sector (4096 bytes, for example bytes 0-4095). The 32Kbyte (32,768 byte) and 64Kbyte (65,536 byte) block are simple groups of sectors that can be erased as a single operation. It doesn't matter if you erase a sector, either size block, or the entire chip. All bytes in the range will be set back to all ones (0b11111111).

In most NOR chips, it is not actually required to erase a byte before programming. However, such a re-programming again, can only change ones to zeros. Writing all zeros to an already programmed non-zero byte or bytes can be useful for thing like quickly marking a block of data as invalid or obsolete.

\$\endgroup\$
  • \$\begingroup\$ Hi there ,thank you for your explanations! Now I am having trouble as well.. so I don't know why but after deleting the whole chip, when I read some addresses, it still reads the last data which i wrote there. And when I tried to write a different data, in a different location, the output is "ÿ". Do you have any suggestion what should I do to address this issue? Thanks! \$\endgroup\$ – Stanleyaley Dec 1 '18 at 19:12
  • \$\begingroup\$ Are you polling for erase completion? A full chip erase will take a long time (relatively speaking). If you try other operations before the erase completes, it will abort. \$\endgroup\$ – DoxyLover Dec 1 '18 at 20:27
  • \$\begingroup\$ What I did was after the operation, I waited for 1 seconds with a delay function. Is that what you meant by polling? I'm sorry for the stupid question, but I'm quite new :) thanks! \$\endgroup\$ – Stanleyaley Dec 2 '18 at 10:34
  • \$\begingroup\$ @Stanleyaley What I was referring to was reading the status register until you read the BUSY big as zero. However, that datasheet says the chip erase time is 50 ms so your delay should work. Second question: are you executing the write-enable instruction before you do the chip erase? \$\endgroup\$ – DoxyLover Dec 3 '18 at 6:16
  • \$\begingroup\$ ahh I see. Yes yes, I used write-enable for every operation, like when to read, write and even chip erase. I will try again today, and follow your suggestions again to see if it's working or not. But, thank you so much for your explanations! It really helps! \$\endgroup\$ – Stanleyaley Dec 3 '18 at 8:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.