Hi kostyan,
In order to program a working ESP32, a number of pieces of data need to be flashed at different offsets. If you run "make" in IDF then it will output a flashing command at the end of the build:
Code: Select all
...
AR libnvs_flash.a
LD hello-world.elf
esptool.py v2.0-beta3
To flash all build output, run 'make flash' or:
python /home/gus/esp/32/idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 /home/gus/esp/32/idf/examples/get-started/hello_world/build/bootloader/bootloader.bin 0x10000 /home/gus/esp/32/idf/examples/get-started/hello_world/build/hello-world.bin 0x8000 /home/gus/esp/32/idf/examples/get-started/hello_world/build/partitions_singleapp_coredump.bin
The part at the end contains the flash offsets and file names of all the binary files required to flash the app. In the above output:
Code: Select all
0x1000 /home/gus/esp/32/idf/examples/get-started/hello_world/build/bootloader/bootloader.bin
0x10000 /home/gus/esp/32/idf/examples/get-started/hello_world/build/hello-world.bin
0x8000 /home/gus/esp/32/idf/examples/get-started/hello_world/build/partitions_singleapp_coredump.bin
(The exact output may/will vary depending on configuration.)
You can convert these to a single .bin file for easier flashing if you wish, or if your manufacturer doesn't support flashing from multiple files.
Regarding .bin vs .hex, this depends on what file format(s) your manufacturer accepts. The .bin files from IDF are raw binary files (no formatting.)
Another tip, set the flash size in "make menuconfig" (under "Serial Flasher Parameters") before building the firmware - the default is "detect" but this depends on esptool.py being used for flashing. You may also want to double-check the related settings in this menu.