eblot / pyspiflash

SPI data flash device drivers (pure Python)
MIT License
40 stars 30 forks source link

Support for MX25L6406E (8MB) #3

Open axel-h opened 8 years ago

axel-h commented 8 years ago

Please add support for the MX25L6406E (8MB), data sheet at http://www.macronix.com/Lists/DataSheet/Attachments/3223/MX25L6406E,%203V,%2064Mb,%20v1.9.pdf

Using a FTDI UM232H it works nicely. I've added: 0x20 : 'MX25L' at:

class Mx25lFlashDevice(_Gen25FlashDevice):
    """Macronix MX25L flash device implementation"""
    JEDEC_ID = 0xC2
    DEVICES = { 0x9E : 'MX25D', 0x26 : 'MX25E', 0x20 : 'MX25L' }

any my test app produced this:

JDEC ID: c22017
Flash device: Macronix MX25L64 8 MiB @ SPI freq 30.0 MHz
speed test: read full flash, 8 MiB (8388608 byte)
reading took 2.56 secs, 3.13 MiB/sec

I'm wondering, the class name and the comment indicates this chip should be supported already? Did you see any problems with this chip? Reading seem to work fine do far, I've not tried writing so far.

eblot commented 8 years ago

This character (after MX25) usually indicates the generation of the flash devices. The trouble is that Macronix has ... changed parts of the command set when moving from D to E for example, so I have no idea whether the L series is actually compliant with the E series.

I do not have any L series available to verify whether it works or not - and no spare time to read the datasheet :-)

Let me know if writing is ok, and I'll merge your changes. Thanks.

scowler commented 5 years ago

I ran into the same issue with MX25L part. After making this suggested change, I verified the spiflash library was working correctly on a test board. Specific part was MX25L3206E.