Home icon indicating copy to clipboard operation
Home copied to clipboard

Helper Method to Re-Format Internal Flash Drives on Boards that Support It

Open gligorov opened this issue 2 years ago • 5 comments

Description

At present there is no way to reformat the internal flash on devices. If for any reason, format is needed, ( security, troubleshooting etc.), there is no way to do that.

How to solve the problem

Add a simple helper method like Format(string driveLetter) or something similar to be used from a library that is best suited for this.

Describe alternatives you've considered

none at present

Aditional context

No response

gligorov avatar Feb 22 '23 18:02 gligorov

You can already do this by getting all the files and deleting all of them. Wouldn't that be enough? It's especially easy on an internal storage as no folder is supported. But it will just work the same way with a recurring function.

Ellerbach avatar Apr 18 '23 07:04 Ellerbach

Nope. This requires a native call in order to restart/format the file system or SPIFFs. When it comes to this, it's because the file system got unusable.

josesimoes avatar Apr 19 '23 00:04 josesimoes

Maybe command with nanoff will be sufficient?

torbacz avatar Dec 29 '23 22:12 torbacz

@josesimoes should this be closed now?

networkfusion avatar Feb 05 '24 07:02 networkfusion

@josesimoes should this be closed now?

The linked PR has added support for this only for SPIFFs storage. I think it should be extended to the other supported storage: SD Cards and USB MSD. That's why I left it open.

josesimoes avatar Feb 06 '24 10:02 josesimoes