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 Flashing ESP32 without VS/VM (Read 1895 times)
Chevelle
Junior Member
**
Offline


Posts: 35
Joined: Feb 29th, 2020
Flashing ESP32 without VS/VM
Sep 7th, 2023 at 5:14pm
Print Post  
Hi.  I do all my programming for the family of ESP32 devices using VS2022 w/VM.  The latest project is a custom board with an ESP32C3 device.  I have also included a CP2102 UART for programming and communication with a host computer.

All is well.  The program compiles, loads, and runs fine.

I want to be able to not have to use the VS2022 IDE for flashing additional boards.  I have tried the Espressif Dowloader Tool for this purpose but no joy.

In VS2022/VM I have the options for creating and saving the combined binary file checked.  When I flash the ESP32, the upload process indicates success but the board does not work properly as it would if the source was compiled and uploaded in VS2022 or the Arduino IDE.

In the Espressif downloader tool, I have the SPI Speed set at 80Mhz and the mode at QIO, just as it is in VM.  The DoNotChgBin is checked and the offset address for the file is 0x0.

Am I creating the bin file correctly?
Are there multiple bin files that need to be created?
Is the offset(s) correct?
Should I be doing this another way?

Any help is greatly appreciated.

Thanks.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2707
Joined: Feb 13th, 2019
Re: Flashing ESP32 without VS/VM
Reply #1 - Sep 8th, 2023 at 9:03am
Print Post  
Thanks for the report.  It is likely you are not flashing all images

The simplest option to flash the same code outside of vMicro and VS, would be to use the exact same tools which are triggered when using vMicro.

If you enable vMicro > Uploader > Verbose, and perform an upload, you will see it is calling esptool.exe, with a number of parameters.

This can be called from the command line or a batch script, and it also exposes all binary files which are needed to fully flash the chip (bootloader, partitions, app0, project code) and their offsets, as well as the COM port and flash speed/mode flags.

This can be used with the Espressif Flash Downloader tool in theory as well using the same binary images and offsets.

Does this help?

  
Back to top
IP Logged
 
Chevelle
Junior Member
**
Offline


Posts: 35
Joined: Feb 29th, 2020
Re: Flashing ESP32 without VS/VM
Reply #2 - Sep 8th, 2023 at 11:48am
Print Post  
I will give this a try.  Thanks very much.
  
Back to top
 
IP Logged
 
Chevelle
Junior Member
**
Offline


Posts: 35
Joined: Feb 29th, 2020
Re: Flashing ESP32 without VS/VM
Reply #3 - Sep 9th, 2023 at 12:28pm
Print Post  
Hey, it worked!

I compiled with verbose on and got the one line that evoked esptool.exe.  To check it, I then just ran that in a command window and it worked.  Next, I opened up the Flash Download Tool (what a dumb name) and entered in the four BIN files and their offsets.  That worked, kind of.

In VM, the upload option is set to QIO and so I used that in the Flash tool but the line from the compiler has that set to DIO.  When I set the Flash tool to DIO, it worked.

Finally, I used the option in the Flash tool to create the combined BIN file.  Uploading that file from either the command window or the Flash tool worked great.

Thanks very much for the help.

One more question though, can VM create the combined BIN file?  That seems like a worthwhile feature.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Flashing ESP32 without VS/VM
Reply #4 - Sep 9th, 2023 at 3:38pm
Print Post  
If you enable "vMicro>Compiler>Always Export Binary" and then compile, does that provide what you need?

Note the binary is exported to the project folder.
  
Back to top
IP Logged
 
Chevelle
Junior Member
**
Offline


Posts: 35
Joined: Feb 29th, 2020
Re: Flashing ESP32 without VS/VM
Reply #5 - Sep 9th, 2023 at 5:17pm
Print Post  
The BIN file created that way does not seem to be the full combined file.  The device doesn't work when that file is flashed but does work when I use the combined file that is generated by the Espressif Flash tool.  The two files aren't even the same size.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2707
Joined: Feb 13th, 2019
Re: Flashing ESP32 without VS/VM
Reply #6 - Sep 11th, 2023 at 9:39am
Print Post  
The combined binary created in vMicro (and Arduino IDE) is the bootloader combined with the sketch binary, which is the standard for most boards.

The ESP boards do have the additional app0 and partitions binaries which are unique to these boards, which is why they are not combined in either vMicro or Arduino.

The standard upload tools in vMicro and Arduino will upload all binaries (as you have seen with esptool.exe), so there is no need generally to combine them.  It is only in a production scenario where a single file is simpler to manage and upload, which is why Espressif supply the functionality to combine the binaries (shown in the tip for the CombineBin button).
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint