Brief - How do I erase all the flash?
Detail - I moved up from developing ESP8266 devices from the Arduino environment for about a week now. I’m now using Visual Studio Code, PlatformIO. I was generally amazed at how everything worked fine first time. I compiled and run the sample programs within five minutes of finishing the install process. Over the last week, I’ve been porting some of my programs over. Everything has worked fine. I have discovered that the upload process must only clear the program flash area. I’ve had the program display all 4MB of the flash memory on a ESP8266 WeMos board and it is quite cluttered from its time being used in the Arduino environment.
I’ve done a search on the Internet. Many links land on this forum. All suggestions either don’t work for me or they’re talking about some files deep in the bowls of PlatformIO. I’ve tried…
In the UI, there is an “Erase Flash” option under PROJECT TASKS/d1_mini/Platform/Erase Flash - This returns an error ***** [erase] Error 1** and lots of details, but finally says: “serial.serialutil.SerialException: could not open port ‘COM5’: PermissionError(13, ‘Access is denied.’, None, 5)” This, even though the project uploads/runs just fine.
Tried this https://community.platformio.org/t/esp8266-erase-flash-mode-config/5867. It suggests that simply doing pio run --target erase should do what I need. This is what I get when I try:
PS C:\Users\user\Documents\PlatformIO\Projects\InqPortal> pio run --target erase
*pio : The term ‘pio’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct *
and try again.
At line:1 char:1
+ pio run --target erase
- CategoryInfo : ObjectNotFound: (pio:String) , CommandNotFoundException*
- FullyQualifiedErrorId : CommandNotFoundException*
I confirmed that its running the newest as of last week.
I know I must be missing something simple as this is a fundamental need. Thanks for any help you can provide.