jamesbowman / spidriver

SPI driver public repo
https://spidriver.com/
BSD 3-Clause "New" or "Revised" License
178 stars 56 forks source link

python/samples/flash.py: Add size option #15

Closed pehjota closed 5 years ago

pehjota commented 5 years ago

Some flash chips do not provide the flash size in the second byte of the device ID, which can either cause the wrong number of bytes to be read/written or cause idcode() to be called infinitely. The user must check their chip's datasheet to know whether its device ID includes its size or they need to specify the size with the -s option.

Read tested with an Atmel AT26DF321 (manufacturer ID 0x1F, device ID 0x4700).

jamesbowman commented 5 years ago

Looks good, thanks.