About testing the flash itself, maybe you can write a script to create a binary file which will hold some bit pattern (such 32bits numbers) to test the full Flash space and simply use esptool.py to write into it, then re-read it to another file and diff them.
About testing the flash itself, maybe you can write a script to create a binary file which will hold some bit pattern (such 32bits numbers) to test the full Flash space and simply use esptool.py to write into it, then re-read it to another file and diff them.