Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Erase flash before uploading (part of the upload process) (Read 850 times)
Martinus Maxiumus
Newbies
*
Offline


Posts: 6
Joined: Jul 28th, 2022
Erase flash before uploading (part of the upload process)
Aug 16th, 2022 at 11:54am
Print Post  
Hi,

For factory release testing i need to be able to erase the flash to clean out all WiFi settings, file systems etc. 

Esptool has the -e (Erase) or erase_flash argument which can be configured that should perform this task. How can this be achieved within VisualMicro (VS2022)? 

So what do i want to achieve:

- After the build
- Erase the flash (all settings all file systems)
- flash the new firmware
- after flashing the system should be like 'factory' delivered.

How can i do that?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2174
Joined: Feb 13th, 2019
Re: Erase flash before uploading (part of the upload process)
Reply #1 - Aug 16th, 2022 at 1:08pm
Print Post  
If you add a local board.txt to your project (vMicro > Add Code > Add Local Board.txt) and then add the below contents to it, it should perform the erase action before upload:

Code
Select All
# Add Additional Pre-Upload command to Erase Flash before Upload
sptool_py.cmd} --port {serial.port} erase_flash 

  
Back to top
 
IP Logged
 
Martinus Maxiumus
Newbies
*
Offline


Posts: 6
Joined: Jul 28th, 2022
Re: Erase flash before uploading (part of the upload process)
Reply #2 - Aug 17th, 2022 at 4:14pm
Print Post  
I've been searching for board.txt (i know where boards.txt is and added new profiles to it as well) as i found a similar article online. 

Never found out how / where to create the board.txt

Thank you for the solution  Smiley
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2174
Joined: Feb 13th, 2019
Re: Erase flash before uploading (part of the upload process)
Reply #3 - Aug 17th, 2022 at 4:21pm
Print Post  
Thanks for the update, and glad it has worked.

Just to be clear there is a boards.txt included in each board package (e.g. esp32), however manipulating this, or adding the boards.local.txt into the board package folder, will be removed whenever you update the package (e.g. v2.0.1 > 2.0.2).  There are alternative routes using the sketchbook\hardware folder, however these become complex to understand and maintain generally.

This is why we have the "Local Board.txt" in Visual Micro, which lives alongside your project so you can override settings per-project, without losing them when updating the board package. It also allows overrides for multiple boards depending on the items being added to the file (e.g. Build Hook Overrides).
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint