Page 1 of 1

What files to keep from a specific revision build, and how to flash

Posted: Thu Apr 16, 2020 1:21 pm
by lalleglad
While in development mode, I am continuously using the command 'idf.py -p COMX flash monitor' (X=port#) at the top of my source and build tree.

I would like to regularly save specific revisions, with as few files as possible, which I may at a later time flash my device with.

So, what files do I minimum need to keep, and how do I flash those to an ESP32-WROOM-32?

While developing for the ESP32-WROOM-32 using the 'idf.py flash' command, it always compares with the source tree and builds it if changes have been made, and I would like to avoid that.
I just want to flash a device with previously made binary or binaries, if possible.

With STM32 I can keep just one .hex file and then use an ST-LINK to flash the hardware, and I would like to know the equivalent method of this on ESP32?

I am working from both Win10 and Linux platforms, but I don't suppose there are differences regarding this?

Please let me know of any pointers you may have, or feel free to ask if it is unclear?

Re: What files to keep from a specific revision build, and how to flash

Posted: Thu Apr 16, 2020 10:42 pm
by gunar.kroeger
most of the times you'll have one yourproject.bin for your flash partition, you also need the partition-table.bin, bootloader.bin and sometimes ota_data_initial.bin if you are using OTA

you can program with esptool.py

Code: Select all

esptool.py --chip esp32 -p ${config:idf.port} -b ${config:idf.baudRate} --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0xd000 build/ota_data_initial.bin 0x1000 build/bootloader/bootloader.bin 0x10000 build/yourproject.bin 0x8000 build/partition_table/partition-table.bin"
there is also a flasher tool ESPFlashDownloadTool, that you can setup to flash your binaries without cmd

Re: What files to keep from a specific revision build, and how to flash

Posted: Fri Apr 17, 2020 8:49 am
by lalleglad
Thank you for the pointers, that was helpful.

Copying all the mentioned .bin files to the same folder, I was able to flash it with this command:

esptool.py --chip esp32 -p COM14 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x8000 partition-table.bin 0x90000 ota_data_initial.bin 0x1000 bootloader.bin 0x10000 my_app.bin

Re: What files to keep from a specific revision build, and how to flash

Posted: Fri Apr 17, 2020 11:12 am
by ESP_Sprite
Do note that 'idf.py build' also spits out the exact command line needed to flash the program (it's effectively the command it executes when you run 'idf.py flash'.) Backup that and the files mentioned there and you should be good.

Re: What files to keep from a specific revision build, and how to flash

Posted: Sat Apr 18, 2020 7:22 am
by ESP_igrr
One more thing, the build systems produces some metadata files with flashing information. Please check https://docs.espressif.com/projects/esp ... -arguments