Go Down

Topic: SPIMemory library - Formerly SPIFlash - now supports SPI FRAM as well! :) (Read 78464 times) previous topic - next topic


Hi Etienne, let me try to answer your questions in order:
  • I can access the built-in flash on the ESP12 module in the Huzzah without any issues.
  • Use FlashDiagnostics to test - its cleaner and runs with less of a memory footprint than TestFlash
  • The SPI frequency is not set to 104 MHz. Its set to operate unto a maximum of 104 MHz.
  • You don't need to force the SPI to SPI0 by any method outside the library. If you look at the ReadMe file that comes with the library, under the usage section, you'll see the following note about how to use a non-default SPI interface.

Every version of the library >= v3.0.0 supports the ability to use any of multiple SPI interfaces (if your micro-controller supports them). Switching to use another SPI interface is done by calling SPIFlash flash(csPin, &SPI1); (or &SPI2 and so on), instead of SPIFlash flash(csPin)[/u]


HI! I'm using SPIMemory to work with board Heltec Wifi Kit 32(pinout https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/blob/master/PinoutDiagram/WIFI%20Kit%2032.pdf) + Winbond w25q128jvsq (installed on board), and allways, in all samples i can't see this flash

Init class:

SPIFlash flash(5);


configsip: 0, SPIWP:0xee
mode:DIO, clock div:1
ho 0 tail 12 room 4
entry 0x4008069c

SPIMemory Library version: < 2.5.0

No comms. Check wiring. Is chip supported? If unable to fix, raise an issue on Github

What i'm doing wrong?

P.S. Sorry for my english


I'm trying to use SPIMemory with FM25L16-G and get get understanding how to change defines to successfully work with examples. I need a little guide through there. I'm using ATMega 2560.
Thank in advance.


Hi everyone,

first: thank you to everyone for all your great work, I would have given up on so many things if it wasn't for you.

I have a Sparkfun Redboard Turbo, and I can use SPIMemory up until version 3.3, with some changes in the variant.h file and the diagnostics.cpp (all thanks to replies in this thread).
For some reason, it won't work with the newest version of SPIMemory though. If I run FlashDiagnostics, it says the wiring is wrong. Am I doing something wrong?

Also, with the older library versions that I use, when I use flash.writeStr(), and the string is longer than 255 bytes, my code hangs at the write command. I use the readWriteString example.

If I then reset my board after trying to write a much longer string with flash.writeStr(), and just use flash.readStr(), it reads the whole, longer string. So the writeStr command actually does write the longer string to flash, but for some reason it hangs after or when it does it.

I hope someone can help me fix the writeStr :) so I can write my long string to flash.




Are there any plans to add support for SPI NAND flash chips?




I tried with STM32F103C8T6 SPI port 2, but it didn't work, maybe someone can compare the code with the SdFat library, because SdFat already provides for use with SPI2 port:

Code: [Select]
// Use second SPI port
SPIClass SPI_2(2);
SdFat sd2(&SPI_2);

Source: https://github.com/greiman/SdFat/blob/master/examples/STM32Test/STM32Test.ino
Please avoid private messages, your question may be someone's answer in the future!


Hi Marzogh,
   great job indeed, Kudos!

I would like to use it with a STM32 Nucleo Board, which would support Dual SPI. Does your library support such a configuration?




This library SPIMemory can be very useful for saving RAM and Flash memory space, but if you want to use a more powerful microcontroller like STM32, and have greater compatibility with an SD card, you might want to look at this other library:


Here is an example of using a W25Q64 Flash being accessed like a USB stick:

[Blue Pill STM32F103C8T6] USB Mass Storage Flash W28Q64 (Like a SD card Reader)


"P.S. Example above uses second SPI port, but you can use another port"
Please avoid private messages, your question may be someone's answer in the future!


Thanks a lot @rtek1000, i will look into this new possibility.



is it possible to write files on an spi flash module with an W25Q64 ?
Ich bin ein noob und kenne mich nicht so gut aus. Daher frage ich die netten Menschen hier im Forum.

Go Up