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?