-->
Page 1 of 1

64 byte SPI flash read hangs

PostPosted: Sat Jul 16, 2016 9:00 am
by shein
Hi All,

I use only SPI registers to read/write flash and experience strange problem.
64 bytes write work fine, but 64 bytes read hangs.

There're 16 SPI data registers, each register is 32 bit. (W0-W15)
So, it seems like I should be able to read/write 64 bytes blocks of data.
For writing it is the case. I can write up to 64 byte block at a time. And can verify that operation is successful.
But reading works up to 63 bytes block. If attempt to read 64 bytes block system hangs.
The cause of the hang is that SPI operation is never completed and the loop that waits for SPI operation to finish never ends.

There's a sample project that demonstrates this problem https://github.com/sheinz/esp-spi-flash-test
It doesn't use any SDK libraries.

PS. Espressif uses 32bytes blocks to read/write SPI flash inside bootrom. But why to restrict to 32 bytes if 64 bytes buffer is available... they might know something...

Thanks.