esptool paths and defaults

How does esptool.py know where to find the bin files? And does it automatically find the com port and baud rate?

As an example, I was given this file. It doesn't specify the com port. Also, has a path to somewhere with a subfolder called "at"? To where do I unzip the file?

esptool.py write_flash --flash_size 2MB-c1 0x0 boot_v1.7.bin 0x01000 at/1024+1024/user1.2048.new.5.bin 0x1fb000 blank.bin 0x1fc000 esp_init_data_default_v08.bin 0xfe000 blank.bin 0x1fe000 blank.bin

usage: esptool [-h] [--chip {auto,esp8266,esp32}] [--port PORT] [--baud BAUD]
               [--before {default_reset,no_reset,no_reset_no_sync}]
               [--after {hard_reset,soft_reset,no_reset}] [--no-stub]
               [--trace] [--override-vddsdio [{1.8V,1.9V,OFF}]]
               {load_ram,dump_mem,read_mem,write_mem,write_flash,run,image_info,make_image,elf2image,read_mac,chip_id,flash_id,read_flash_status,write_flash_status,read_flash,verify_flash,erase_flash,erase_region,version}

If you just run the tool, suppose it runs, it should give you this. So yes, give port and baud rate manually. Port is critical to get it right but baud could be say 460800 to 2000000 depending on your board's USB UART chip's quality. This tool is not strictly speaking an arduino tool. If you were given firmware images that go with esptool.py, it's possible the firmware was compiled with esp-arduino or not. You should ask the person who gave you the code for support.

As an example, here is a command:

/esptool.py --chip esp32 --port COM24 --baud 460800 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x10000 /home/user/esp/Projects/tests/hello_world/build/hello-world.bin

That "at/1024+1024/user1.2048.new.5.bin" seems to be the path to this file you should flash to address 0x01000
I don't know what you're doing with this but I don't see any partition table file etc.

1 Like

I am trying to write documentation for other people and got a bit of help months ago from Jurag. I know how to use the Expressif Download tool for Windows, but not how to help people on Mac and Linux. The image below is a working configuration. Is the equivalent esptool command correct? I want to just include a zip file with the 4 files they need, where do I put them? I tried the command as first written in the previous email and did not put in a port or baud rate, so that must be automatic too in most cases? All the examples don't have a path to the files, yet it seems to find them. I don't know why that is. Oh, and I have to flash the NONOS AT command firmware ver 1.7.4 from Expressif which may be something not many people here would do. I put the files in c:\esp.

It would be so much easier if I could use a tool like ESPEasy Flasher that is just a small window with a dropdown for port and for .bin file and you press start. But that appears to require all the bin files to be compiled into one it appears. There really needs to be a way (other than OTA) to allow non-technical users to install firmware on these things. There also seems to be a exe version of esptool that encapsulates python, since having to have users install python is another complication.

esptool.py write_flash --flash_size 2MB-c1 0x0 esp/boot_v1.7.bin 0x01000 esp/user1.2048.new.5.bin 0x1fc000 esp/esp_init_data_default_v08.bin 0xfe000 esp/blank.bin 0x1fe000 esp/blank.bin

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.