How to Erase QSPI flash

Razon

Member
I'm using the LittleFS and MTP libraries to easily transfer data to-from a Teensy4.1 with a W25Q128JV qspi flash soldered on the bottom side.

Everything was working fine until I tried to transfer a file that exceeded the remaining available memory.
The file explorer shows the memory is full, but when i look under QSPI i can't see any files.
MemFull.png


Any suggestions on how to recover from this?
I looked for a command to erase the entire memory chip, but couldn't find one.
 
Either of these should work. From: ...\libraries\LittleFS\examples\Test_Integrity\QSPI\functions.ino

Code:
	case 'F': // Low Level format
		Serial.print( "\nFormatting Low Level:\n\t" );
		lastTime = micros();
		timeMe = micros();
[B]		myfs.lowLevelFormat('.');
[/B]		timeMe = micros() - timeMe;
		Serial.printf( "\n Done Formatting Low Level in %lu us.\n", timeMe );
		errsLFS = 0; // No Errors on new Format
		warnLFS = 0; // No warning on new Format
		bCheckFormat  = false;
		parseCmd( 'u' );
		break;
	case 'q': // quick format
		lastTime = micros();
[B]		myfs.quickFormat();
[/B]		errsLFS = 0; // No Errors on new Format
		parseCmd( 'u' );
		break;
 
I would probably format the flash FS...

For example look at the LittleFS example LittleFS_Usage

You will see it starts off calling: myfs.quickFormat();

You can also do low level format as well.

Some of this is shown in the library file README1.md
 
Back
Top