eblot / pyspiflash

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

chip erase function should be improved #27

Open RoccoMatano opened 1 year ago

RoccoMatano commented 1 year ago

The chip erase functionality is using only one pair of timeout values (typical, maximum) even when a whole family of devices is supported (e.g. W25xFlashDevice). While the pair for W25xFlashDevice seems to have been taken from a the data sheet of 4 MBit device (4, 11), those values are much too low for devices with a larger memory size (e.g for 128MBit the data sheet says the pair is (40, 200)). That is because chip erase time is approx. proportional to memory size.

I think that either there has to be such a pair for each supported size or - if the code for waiting is not going to be changed - one could stick with just one pair and set 'typical' value to the typical value of the smallest device and set the 'maximum' value to the maximum value of the largest device.

FYI: I am writing this, because trying to erase a Winbond W25Q128JV with pyspiflash fails, because 11 seconds is not enough for this chip.

RoccoMatano commented 6 months ago

nobody cares...

eblot commented 6 months ago

It is not that nobody care, but I just do not have enough spare time these days to work on PyFtdi and PySpiFlash.

Whenever I can spend some time on this, I'll be happy check out these issues. Meanwhile, patches are always welcome.