jamesbowman / spidriver

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

flash.py: size is erased with read option #35

Open biboc opened 1 year ago

biboc commented 1 year ago

I read my SPI memory with

The flash.py program reads only two bytes, why? In the code, I don't get why you replace size variable at line https://github.com/jamesbowman/spidriver/blob/master/python/samples/flash.py#L97

    if '-r' in optdict:
        read(0)
        chunk = 8 * 1024
        size,chunk = 128,128
        with open(optdict['-r'], "wb") as f:

By commenting the line size,chunk = 128,128, it works