#### zazas321

Joined Nov 29, 2015
838
Hey. Can someone help me understand how does uploading a sketch to ESP32 works exactly? I am using Arduino IDE to program ESP32 devices and it was working fine until someone shared .bin file with me that I wanted to upload to my ESP32 device.

I have tried to upload .bin file to my ESP32 using linux. I have connected esp32 to raspberry PI using USB cable and esptool.py write_flash command as following:

but my ESP32 goes into infinitive SPI_FLASH_RESET loop..

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html

It is still quite difficult to understand what exactly I need to do to properly upload a binary file to my ESP32 device.
Code:
C:\Users\petrikas.lu\Documents\ArduinoData\packages\esp32\tools\esptool_py\2.6.1/esptool.exe --chip esp32 --port COM14 --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 C:\Users\petrikas.lu\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.4/tools/partitions/boot_app0.bin 0x1000 C:\Users\petrikas.lu\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.4/tools/sdk/bin/bootloader_qio_80m.bin 0x10000 C:\Users\petrikas.lu\AppData\Local\Temp\arduino_build_299430/mqtt_esp32_working.ino.bin 0x8000 C:\Users\petrikas.lu\AppData\Local\Temp\arduino_build_299430/mqtt_esp32_working.ino.partitions.bin
I have checked what arduino IDE is doing and it seems that it is uploading 4 binary files:

boot_app0.bin 0xe000
mqtt_esp32_working.ino.bin 0x10000
mqtt_esp32_working.ino.partitions.bin 0x8000

My question is what is the simplest way to upload a compiled binary file without using Arduino IDE ( I cannot compile program). Also, Do I need to have multiple binary files? because I only have 1 binary file from the main program

#### KeithWalker

Joined Jul 10, 2017
1,581

Keith

#### zazas321

Joined Nov 29, 2015
838

Keith
It works when I upload my program using Arduino IDE but does not work from raspberry PI.

Do i need to write flash to 0x10000 addres?

#### KeithWalker

Joined Jul 10, 2017
1,581
What do you mean "it does not work from raspberry Pi" ? What does not work?

#### zazas321

Joined Nov 29, 2015
838
What do you mean "it does not work from raspberry Pi" ? What does not work?
Flashing using raspberry pi esptool write_flash command. Do I have to write my binary in 0x10000 address? Do I also have to manually add the bootloader binary when I flash using raspberry Pi ir thats not necessary?