diff --git a/docs/api-guides/build-system.rst b/docs/api-guides/build-system.rst index 54660741e6..ab9ed64923 100644 --- a/docs/api-guides/build-system.rst +++ b/docs/api-guides/build-system.rst @@ -592,14 +592,7 @@ To override the name of this file, set the ``SDKCONFIG_DEFAULTS`` environment va 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:: +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. We can use command ``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 diff --git a/make/project.mk b/make/project.mk index deaba74a3a..19e4b42504 100644 --- a/make/project.mk +++ b/make/project.mk @@ -38,6 +38,7 @@ help: @echo "make app - Build just the app" @echo "make app-flash - Flash just the app" @echo "make app-clean - Clean just the app" + @echo "make print_flash_cmd - Print the arguments for esptool when flash" @echo "" @echo "See also 'make bootloader', 'make bootloader-flash', 'make bootloader-clean', " @echo "'make partition_table', etc, etc." @@ -496,6 +497,10 @@ list-components: $(info COMPONENT_PATHS (paths to all components):) $(foreach cp,$(COMPONENT_PATHS),$(info $(cp))) +# print flash command, so users can dump this to config files and download somewhere without idf +print_flash_cmd: + echo $(ESPTOOL_WRITE_FLASH_OPTIONS) $(ESPTOOL_ALL_FLASH_ARGS) | sed -e 's:'$(PWD)/build/'::g' + # Check toolchain version using the output of xtensa-esp32-elf-gcc --version command. # The output normally looks as follows # xtensa-esp32-elf-gcc (crosstool-NG crosstool-ng-1.22.0-59-ga194053) 4.8.5