mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
build: add document about how to save flash args
This commit is contained in:
parent
2b273388dd
commit
6c5e60943e
@ -506,3 +506,22 @@ For example projects or other projects where you don't want to specify a full sd
|
||||
|
||||
To override the name of this file, set the ``SDKCONFIG_DEFAULTS`` environment variable.
|
||||
|
||||
|
||||
Save flash arguments
|
||||
-------------------------
|
||||
|
||||
There're some scenarios that we want to flash the target board without IDF. For this case we want to save the built binaries, esptool.py and esptool write_flash arguments. It's simple to write a script to save binaries and esptool.py. For flash arguments, we can add the following code to application project makefile:
|
||||
::
|
||||
print_flash_cmd:
|
||||
echo $(ESPTOOL_WRITE_FLASH_OPTIONS) $(ESPTOOL_ALL_FLASH_ARGS) | sed -e 's:'$(PWD)/build/'::g'
|
||||
|
||||
the original ESPTOOL_ALL_FLASH_ARGS are absolute file name. Usually we want to save relative file name so we can move the bin folder to somewhere else. For this case we can use ``sed`` to convert to relative file name, like what we did in the example above.
|
||||
|
||||
When running ``make print_flash_cmd``, it will print the flash arguments:
|
||||
::
|
||||
--flash_mode dio --flash_freq 40m --flash_size detect 0x1000 bootloader/bootloader.bin 0x10000 example_app.bin 0x8000 partition_table_unit_test_app.bin
|
||||
|
||||
Then use flash arguments as the arguemnts for esptool write_flash arguments:
|
||||
::
|
||||
python 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 bootloader/bootloader.bin 0x10000 example_app.bin 0x8000 partition_table_unit_test_app.bin
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user