There is a newer version of the record available.

Published May 21, 2018 | Version v3.2.1
Software Open

Marzogh/SPIMemory: Arduino Library for SPI Flash memory chips

Description

SPIMemory <hr>

Formerly known as SPIFlash.

<hr>

<hr>

Please report any bugs in issues

<hr> Arduino library for Flash Memory Chips (SPI based only)

<sup> Download the latest stable release (v3.2.0) from <a href = "https://github.com/Marzogh/SPIMemory/releases/latest">here</a>. Please report any bugs in issues.</sup>

This Arduino library is for use with flash memory chips that communicate using the SPI protocol. In its current form it supports identifying the flash chip and its various features; automatic address allocation and management; writing and reading a number of different types of data, ranging from 8-bit to 32-bit (signed and unsigned) values, floats, Strings, arrays of bytes/chars and structs to and from various locations; sector, block and chip erase; and powering down for low power operation.

Compatibility Arduino IDEs supported (actually tested with)
  • IDE v1.5.x
  • IDE v1.6.0-v1.6.5
  • IDE v1.6.9-v1.6.12
  • IDE v1.8.1-v1.8.5
Boards Completely supported
  • ATmega328P (Arduino Uno, Arduino Micro, Arduino Fio, Arduino Nano)
  • ATmega32u4 (Arduino Leonardo, Arduino Fio v3)
  • ATmega2560 (Arduino Mega)
  • ATSAMD21G18 ARM Cortex M0+ (Adafruit Feather M0, Adafruit Feather M0 Express)
  • AT91SAM3X8E ARM Cortex M3 (Arduino Due)
  • ATSAMD51J19 ARM Cortex M4 (Adafruit Metro M4)
  • STM32F091RCT6 (Nucleo-F091RC)
  • ESP8266 Boards (Adafruit ESP8266 Feather)
  • Simblee Boards (Sparkfun Simblee)
In BETA
  • ESP32 Boards (Tested on the Adafruit ESP32 Feather) The library is known to work with the ESP32 core as of the commit <a href = "https://github.com/espressif/arduino-esp32/tree/25dff4f044151f7f766c64b9d2ad90398472e6b3">25dff4f</a> on 05.04.2018. ESP32 support will remain in beta till the ESP32 core can be installed via the Arduino boards manager. NOTE: ESP32 boards usually have an SPI Flash already attached to their SS pin, so the user has to declare the ChipSelect pin being used when the constructor is declared - for example
    SPIFlash flash(33);
    
Flash memory compatibility Completely supported (Actually tested with)
  • Winbond
    • W25Q16BV
    • W25Q64FV
    • W25Q80BV
    • W25Q256FV
  • Microchip
    • SST25VF064C
    • SST26VF064B
  • Cypress/Spansion
    • S25FL032P
    • S25FL116K
    • S25FL127S
  • ON Semiconductor
    • LE25U40CMC
  • AMIC
    • A25L512A0
  • Micron
    • M25P40
  • Adesto
    • AT25SF041
Should work with (Similar enough to the ones actually tested with)
  • Winbond (All SPI Flash chips)
  • Microchip (SST25 & SST26 series)
  • Cypress/Spansion (S25FL series)
  • Any flash memory that is compatible with the SFDP standard as defined in JESD216B
Installation Option 1
  • Open the Arduino IDE.
  • Go to Sketch > Include Library > Manage libraries.
  • Search for SPIMemory.
  • Install the latest version.
Option 2
  • Click on the 'Clone or download' button above the list of files on this <a href = "https://github.com/Marzogh/SPIMemory/tree/master"> page </a>.
  • Select Download ZIP. A .zip file will download to your computer.
  • Unzip the archive and rename resulting folder to 'SPIMemory'
  • Move the folder to your libraries folder (~/sketches/libraries)
<hr> Change log v3.2.1 Enhancements & Optimizations:
  • The way the basic functions execute has been modified to keep the function runtime the same (or improved) while reducing their memory footprint.

Test sketch - FlashDiagnostics.ino from v3.2.0 with #RUNDIAGNOSTIC commented out Test platform - Arduino Pro Mini 8MHz 3.3V

Library version Compiled code size SFDP discovery % Difference from v3.1.0 v3.1.0 17652 bytes Not supported 0% v3.2.0 20104 bytes Supported & enabled by default +13.9% v3.2.1 17854 bytes Supported & enabled +1.1% v3.2.1 15316 bytes Supported & disabled -13.75% Bugs squashed
  • Fixes issue #135 : The addition of the SFDP checking to _chipID resulted in a sudden (very large) increase in compiled code size. As of the current version (v3.2.1), SFDP checking is an user controlled option. To get the library to work with SFDP compatible flash memory that is not officially supported, the user must uncomment '//#define USES_SFDP' in 'SPIMemory.h'.

  • Moved bool _loopedOver from being a local variable in getAddress() to a global one. Now it actually does what it was meant to do - i.e. prevent looping over data a second time.

Files

Marzogh/SPIMemory-v3.2.1.zip

Files (3.3 MB)

Name Size Download all
md5:3bfa71c979e8f4cb8872e5e9122a1a58
3.3 MB Preview Download

Additional details

Related works