0
\$\begingroup\$

Our product has flash memory chip, but we have used more than one variant. The first is a SST/Microchip one and the second is a Spansion/Cypress.

To determine which type is mounted, I read the flash ID and the CFI info from the chip. But this is not working stable.

Read ID: 
  write 0x0AAA, 0xAA
  write 0x0554, 0x55
  write 0x0AAA, 0x90

Enter CFI:
  write 0x00AA, 0x98

Before reading the ID, I send a reset (write 0x0AAA, 0xF0 ).

Now the first problem is: for the Cypress chips, I need to send a reset before the 'Enter CFI', otherwise the 'Enter CFI' will fail. But for the SST it's the other way around.

And second problem is that even the 'read ID' will sometimes fail for the Cypress chips.

How can i create a generic and stable solution for this?

\$\endgroup\$
  • \$\begingroup\$ Much depends on the devices and just how you are accessing them; is this part of the startup code or are you using something else (such as a JTAG port)? \$\endgroup\$ – Peter Smith Oct 31 '19 at 11:51
  • \$\begingroup\$ This code is part of the startup code. At this point the device is already powered up for a couple of seconds. \$\endgroup\$ – Hneel Oct 31 '19 at 11:54
  • 1
    \$\begingroup\$ What specific devices are you using? \$\endgroup\$ – Peter Smith Oct 31 '19 at 11:55
  • \$\begingroup\$ SST 39VF6401B (ID = 0x236D00BF) and Cypress S29GL064S (ID = 0x227E0001) \$\endgroup\$ – Hneel Oct 31 '19 at 12:01
  • 1
    \$\begingroup\$ I would suggest using the command sequences found in table 21 for the Spansion device (using the device ID entry with note 17) and table 6 (software ID entry) for the Microchip part; these are identical sequences but do not use the same addresses as yours above. \$\endgroup\$ – Peter Smith Oct 31 '19 at 13:03
1
\$\begingroup\$

There is a method listed in both datasheets (S29GL064S datasheet, SST39V6401B datasheet).

From Table 6 for the SST part, we can get the device ID from this sequence:

SST39V Software ID sequence

This is the same as the sequence (named Autoselect) for the Spansion part:

Spansion S29G ID read sequence

The SST datasheet also helpfully includes a timing diagram:

SST39V read ID timing

So:

Write: Address 0x555, data 0xXXAA (note that XX may be 00 or FF)
Write: Address 0x2AA, data 0xXX55
Write: Address 0x555, data 0xXX90
Read:  Address 0x0000, data <MFR ID>
Read:  Address 0x0001, data <Device ID>

Then issue an exit code (write 0xF0 to any address for both parts).

That should work consistently for both devices assuming the timing is solid.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

I found out that SST chips don't need to seperatly open the 'Manufacturer ID' mode and 'CFI' mode. Entering 'Manufacturer ID' mode also gives access to CFI information:

0000.0000:  BF 00 6D 23 FF FF FF FF - 01 00 FF FF FF FF FE 00  ..m#............  
0000.0010:  FF FF FF FF 18 00 FF FF - FF FF FF FF FF FF FF FF  ................  
0000.0020:  51 00 52 00 59 00 02 00 - 00 00 00 00 00 00 00 00  Q.R.Y...........  
0000.0030:  00 00 00 00 00 00 27 00 - 36 00 00 00 00 00 03 00  ......'.6.......  
0000.0040:  00 00 04 00 05 00 01 00 - 00 00 01 00 01 00 17 00  ................  
0000.0050:  01 00 00 00 00 00 00 00 - 02 00 FF 00 07 00 10 00  ................  

But unfortunatly this doeesn't work the same way for Cypress. Entering 'Manufacturer ID':

0000.0000:  01 00 7E 22 00 00 1A FF - FF FF FF FF FF FF FF FF  ..~"............  
0000.0010:  FF FF FF FF FF FF FF FF - FF FF FF FF 10 22 01 22  ............."."  
0000.0020:  01 00 7E 22 00 00 1A FF - FF FF FF FF FF FF FF FF  ..~"............  
0000.0030:  FF FF FF FF FF FF FF FF - FF FF FF FF 10 22 01 22  ............."."  
0000.0040:  01 00 7E 22 00 00 1A FF - FF FF FF FF FF FF FF FF  ..~"............  
0000.0050:  FF FF FF FF FF FF FF FF - FF FF FF FF 10 22 01 22  ............."."  

But when entering 'CFI' mode, the ID was visible on address 0.

0000.0000:  01 00 7E 22 FF FF 1A FF - FF FF FF FF FF FF FF FF  ..~"............  
0000.0010:  FF FF FF FF FF FF FF FF - FF FF FF FF 10 22 01 22  ............."."  
0000.0020:  51 00 52 00 59 00 02 00 - 00 00 40 00 00 00 00 00  Q.R.Y.....@.....  
0000.0030:  00 00 00 00 00 00 27 00 - 36 00 00 00 00 00 08 00  ......'.6.......  
0000.0040:  08 00 09 00 10 00 03 00 - 03 00 01 00 00 00 17 00  ................  
0000.0050:  02 00 00 00 08 00 00 00 - 02 00 07 00 00 00 20 00  .............. .  

Anyhew. I didn't find a true generic solution, but ended up by using a switch statement based on the found ID. Things are running stable now. The failure on reading the ID on the Cypress chips seems to have been just a glitch.

| improve this answer | |
\$\endgroup\$

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.