Description

remove() erases the entire flash chip. This non-blocking processes take approximately 40 seconds for the 16MB flash embedded in dice devices. No other function can be called until it is finished. Use the ready() function to check if the process is still going on or has finished.

Syntax

eraseAll(b_force);
ready();

Parameters

none or
true – forces the command to erase the flash even that there are updates pending that depend on the files in the serial flash.

Returns

eraseAll() – returns: nothing
ready() – returns:
– false: until the end of the erase operation
– true: the flash is ready for new operations.

Example Code

#include "SerialFlash.h"
void setup()
{
  while(!Serial);
  SerialFlash.begin();
  Serial.print("Erasing entire serial flash chip. Please wait");
  delay(100);
  SerialFlash.eraseAll();
  while(!SerialFlash.ready())
  {
    mp_cons_Serial->print(".");
    delay(1000);
  }
  Serial.println(" - DONE -");
}
void loop () 
{ }

Notes and Warnings

See also

GitHub – PaulStoffregen/SerialFlash – org. code this library is based on