Go Down

Topic: Weird behavior of several libraries with external SPI Flash (Read 347 times) previous topic - next topic

I connected a Winbond W25Q256JV 256 MB SPI flash to Arduino Uno. Pin connections are as follows:

CS: 6 or 10 (depending upon which library I used).
DO (IO1) / MISO: 12.
IO2: 3.3V
DI(IO0)/ MOSI: 11
CLK: 13
IO3: 3.3V
VCC: 3.3V

First I tried the following library: https://github.com/PaulStoffregen/SerialFlash

When I try running the following sketch from the above library: https://github.com/PaulStoffregen/SerialFlash/blob/master/examples/RawHardwareTest/RawHardwareTest.ino , incorrect flash capacity is shown. Instead of showing 256 MB, the code shows 32 MB of flash (which is only the first of eight 32 MB sectors within the flash). Also the sketch gets stuck at the following line:
chipsize = SerialFlash.capacity(buf);

I then tried the following library:

When I run the following sketch in the library: https://github.com/Marzogh/SPIMemory/blob/master/examples/TestFlash/TestFlash.ino, the same wrong capacity is shown, but apart from it other functionalities seem to work fine.

Lastly, I tried running the Adafruit SPI Flash Library, the simplest of all libraries: https://github.com/adafruit/Adafruit_SPIFlash

None of the examples compile and show the following error: No QSPI/SPI flash are defined on your board variant.h !

Any help on the issue would be appreciated.


Your device is 256m-bits, not 256m-bytes. 256m-bits = 32m-bytes.

Thanks. Ya I figured out the capacity later. However, the other behaviors persist.

Go Up