I have a custom board with ESP32 chip and serial flash. I'd like the board to be loaded with firmware at manufacturing. The manufacturer has the ability to program the serial flash before it's put on the board. Are there any instructions on how to properly do this? Do I just tell them to flash .bin file starting at 0? Should I generate a hex file instead?
Thanks,
K
Pre-programming flash at manufacturing
Re: Pre-programming flash at manufacturing
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:
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:
(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.
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
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
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.
Re: Pre-programming flash at manufacturing
What's the easiest way to combine the 3 separate bin files into one single bin?
Re: Pre-programming flash at manufacturing
( know it is an old question but usefull for same questions in other postings,
here an answere )
combine it
the Flash Download Tools (ESP8266 & ESP32) / windows GUI flasher tool can do this
for esptool it was marked as enhancement request
refer to an other post
you can do create an own script / expand esptool for combine the files, you must know about your addresses for each file,
or wait for futureing / update it in the esptool.
hope this helps.
best wishes
rudi
edit:
refere to an other post
add an example pic
check the params on your used clk, spi ram .. also the option "do not chng bin" ..
like you use/need this.
if you then want flash to the esp, simple flash the target.bin to 0x0
if you want multplex flash,
or need testings interfaces further tools
custom solution example for Pico-D4 (credit: Kjashzhvyktsul )
Last edited by rudi ;-) on Mon Aug 26, 2019 6:12 pm, edited 2 times in total.
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Who is online
Users browsing this forum: Majestic-12 [Bot] and 114 guests