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 Location of bin files used when compiling (Read 209 times)
Chevelle
Junior Member
**
Offline


Posts: 40
Joined: Feb 29th, 2020
Location of bin files used when compiling
Sep 29th, 2025 at 10:09am
Print Post  
I am trying to work with the Espressif javascript utility that willl flash an ESP32.  This will eventually be used as part of a website that will let the user update their product when new firmware is available.

We intend to make it simpler than the utility is at present.  One reason is that things can get messed up if the few options present are not set correctly.

As a test example, I am using a development board provided by AutoSport Labs.  It may have it's own idiosyncrocies and I will try other boards as well but I did have an issue with this one.

At one point, I got the board into that loop where the ESP32-S3 kept resetting. Manually putting the board into program mode stopped that and allowed the reflashing of the program.  It took but did not work, even after erasing the flash before programming.

The only way to fix the issue was to use the VS/VM IDE to reflash the board.  This "repaired" things and all was well.

This is a long start to what I believe to be a simple solution.  I think that in the java utilility, I need to load the same bin files that are used when loading from the VS/VM UI.   

In verbose mode, I can see that four bin files are loaded.  They are loaded at 0x0, 0x8000, 0xE000, and the program bin at 0x10000.

I believe that two of the first three are the bootloader and the partition bin files.  Don't know what the third is.

So my question is, what are the first three bin files, and where are they located?  This way, I can have the javascript routine always load the right files in the right place without the user having to deal with it.

Hope this all makes sense.

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


Posts: 12201
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Location of bin files used when compiling
Reply #1 - Sep 29th, 2025 at 12:36pm
Print Post  
If you follow the guide in yellow at the top of this page you will see all of the build commands. If you also switch on vMicro>Uploader>verbose that will show you the upload commands. They change for every board. Visual Micro reads the instructions from the simple text based patterns you see in that output to perform compile and upload. Nothing is known to visual micro before reading those instructions. The instructions are provided/installed by the manufacturer of the core along with the core.

The output also shows the build location.

There is also a "vMicro>Compiler>Show Build Folder" option you can enable that always shows the build folder after each build.

It is also possible to set the "Intermediate Directory" (in the standard VS project properties) to a specific folder. then, on the vMicro>Compiler menu enable "always copy to intermediate". Then each build will dump the build files in the specified folder. 

  
Back to top
IP Logged
 
Chevelle
Junior Member
**
Offline


Posts: 40
Joined: Feb 29th, 2020
Re: Location of bin files used when compiling
Reply #2 - Sep 30th, 2025 at 12:25pm
Print Post  
Great progress.  I was able to locate all of the bin files and we figured out how to load them, in what order, and at what address so that the ESP32 is completely reflashed, even after it goes into that reboot loop.

Just one more small thing that would help....

Yes, the release folder does have the application bin file.  As you already know, all of the bin files are created in a folder under VMBuilds under the user folder on the computer.  It also contains a file that is a merge of all the bin files.  This file just needs to be loaded to 0x0 and all it well!!

So my question is, can VM put that merged bin file in the release folder or some other place that is more convenient than having it buried deep into bowels of the user folder.

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


Posts: 2807
Joined: Feb 13th, 2019
Re: Location of bin files used when compiling
Reply #3 - Sep 30th, 2025 at 1:14pm
Print Post  
If you enable vMicro > Compiler > Always Export Binary, this will clone the main app bin to the project folder.

If you enable vMicro > Compiler > Always Copy Build Output to Intermediate, will clone the build output/bin/hex files to the Project/obj/<Configuration>/<BuildConfiguration> folder (e.g. /obj/ARM/Debug).

A link is outputted at the end of the build if these options are enabled.
  
Back to top
IP Logged
 
Acuario
Senior Member
****
Offline


Posts: 258
Location: Spain
Joined: Aug 28th, 2015
Re: Location of bin files used when compiling
Reply #4 - Oct 2nd, 2025 at 5:10am
Print Post  
I copy my bin files automatically at the end of a build to (in my case) c:\temp
I also use the command to build the "supporting files" (the files from the data folder) and to save it to c:\temp. It also includes the possibility to copy a version file I have in the build called FWVersion.h that I update before each build.

In the board.txt file I have added:

#Copy bin file to directory
recipe.objcopy.hex.pattern.1.pattern=cmd.exe /c {build.project_path}\copyme.bat {build.project_path}\FWVersion.h {vm.last.buildpath}\{build.project_name}.bin c:\temp\ "{menu.fsupload.littlefs.runtime.tools.mklittlefs.path}\mklittlefs.exe" {build.project_path}\data

In my project I have a batch file called copyme.bat
The batch file has the following:

@echo off
setlocal EnableDelayedExpansion
set file=%1

for /F "tokens=1-3 delims=N " %%a in (%file%) do (
   for %%A in (%%a %%b %%c) do set "i=%%A"
)

set from=%2
set dest=%3

copy %from% %dest%AHRS.ino.bin

set mkspiffs=%4
set littlefsdir=%5

%mkspiffs% -c %littlefsdir% -p 256 -b 4096 -s 307200 "c:\temp/AHRS.ino.littlefs.bin"

I have hard coded the name (AHRS) of my bin files but it would be possible to make them one of the parameters passed in to the batch file.

Maybe this is what you want. Hope this helps.
« Last Edit: Oct 2nd, 2025 at 5:16am by Acuario »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint