diff --git a/Documentation/platforms/risc-v/esp32c3/index.rst b/Documentation/platforms/risc-v/esp32c3/index.rst index 0ad497a270..44f8fc2b0b 100644 --- a/Documentation/platforms/risc-v/esp32c3/index.rst +++ b/Documentation/platforms/risc-v/esp32c3/index.rst @@ -58,14 +58,14 @@ The `esptool.py` command to flash all the binaries is:: However, this is also included in the build process and we can build and flash with:: - make download ESPTOOL_PORT= ESPTOOL_BINDIR=../esp-bins + make flash ESPTOOL_PORT= ESPTOOL_BINDIR=../esp-bins Where ```` is typically ``/dev/ttyUSB0`` or similar and ``../esp-bins`` is the path to the folder containing the bootloader and the partition table for the ESP32-C3 as explained above. Note that this step is required only one time. Once the bootloader and partition table are flashed, we don't need to flash them again. So subsequent builds -would just require: ``make download ESPTOOL_PORT=/dev/ttyUSBXX`` +would just require: ``make flash ESPTOOL_PORT=/dev/ttyUSBXX`` Debugging with OpenOCD ====================== diff --git a/Documentation/platforms/xtensa/esp32/index.rst b/Documentation/platforms/xtensa/esp32/index.rst index d965ef0e4d..9cb5b72185 100644 --- a/Documentation/platforms/xtensa/esp32/index.rst +++ b/Documentation/platforms/xtensa/esp32/index.rst @@ -60,7 +60,7 @@ It's a two step process where the first converts the ELF file into a ESP32-compa and the second flashes it to the board. These steps are included into the build system and you can flash your NuttX firmware simply by running:: - $ make download ESPTOOL_PORT= + $ make flash ESPTOOL_PORT= where ```` is typically ``/dev/ttyUSB0`` or similar. You can change the baudrate by passing ``ESPTOOL_BAUD``. @@ -73,7 +73,7 @@ Once you downloaded both binaries, you can flash them by adding an ``ESPTOOL_BIN .. code-block:: console - $ make download ESPTOOL_PORT= ESPTOOL_BINDIR= + $ make flash ESPTOOL_PORT= ESPTOOL_BINDIR= .. note:: It is recommended that if this is the first time you are using the board with NuttX that you perform a complete SPI FLASH erase. diff --git a/README.md b/README.md index 65ef5abd62..594c8c0a0a 100644 --- a/README.md +++ b/README.md @@ -1546,12 +1546,12 @@ build directory. build. (2) The logic in tools/mkexport.sh only supports GCC and, for example, explicitly assumes that the archiver is 'ar' - * `download` + * `flash` (or `download` : DEPRECATED) - This is a helper target that will rebuild NuttX and download it to the target + This is a helper target that will rebuild NuttX and flash it to the target system in one step. The operation of this target depends completely upon - implementation of the DOWNLOAD command in the user Make.defs file. It will - generate an error an error if the DOWNLOAD command is not defined. + implementation of the FLASH command in the user Make.defs file. It will + generate an error if the FLASH command is not defined. The following targets are used internally by the make logic but can be invoked from the command under certain conditions if necessary. diff --git a/boards/arm/stm32/photon/scripts/Make.defs b/boards/arm/stm32/photon/scripts/Make.defs index 7636535afa..60eae124b0 100644 --- a/boards/arm/stm32/photon/scripts/Make.defs +++ b/boards/arm/stm32/photon/scripts/Make.defs @@ -71,7 +71,7 @@ endif ifeq ($(CONFIG_DFU_BINARY),y) -define DOWNLOAD +define FLASH $(Q) echo "DFUSUFFIX: $(1).dfu" $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O binary $(1) $(1).dfu $(Q) $(DFUSUFFIX) -v $(subst 0x,,$(CONFIG_DFU_VID)) -p $(subst 0x,,$(CONFIG_DFU_PID)) -a $(1).dfu @@ -80,7 +80,7 @@ endef else -define DOWNLOAD +define FLASH $(Q) $(ECHO) "Photon firmware upload through JTAG is not supported" endef diff --git a/boards/arm/stm32f7/stm32f746g-disco/scripts/Make.defs b/boards/arm/stm32f7/stm32f746g-disco/scripts/Make.defs index 7947c07cc9..cb56c75909 100644 --- a/boards/arm/stm32f7/stm32f746g-disco/scripts/Make.defs +++ b/boards/arm/stm32f7/stm32f746g-disco/scripts/Make.defs @@ -71,7 +71,7 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y) endif ifneq ($(CONFIG_CYGWIN_WINTOOL),y) -define DOWNLOAD +define FLASH $(Q) st-flash write nuttx.bin 0x8000000 endef endif diff --git a/boards/arm/stm32l4/b-l475e-iot01a/scripts/Make.defs b/boards/arm/stm32l4/b-l475e-iot01a/scripts/Make.defs index 2235dcc236..e67ae6df9b 100644 --- a/boards/arm/stm32l4/b-l475e-iot01a/scripts/Make.defs +++ b/boards/arm/stm32l4/b-l475e-iot01a/scripts/Make.defs @@ -62,7 +62,7 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif -define DOWNLOAD +define FLASH $(Q) echo "Download firmware $(1).bin" $(Q) st-flash write $(1).bin 0x08000000 endef diff --git a/tools/Makefile.unix b/tools/Makefile.unix index 6ed821313a..73b5a853ed 100644 --- a/tools/Makefile.unix +++ b/tools/Makefile.unix @@ -449,15 +449,18 @@ ifeq ($(CONFIG_UBOOT_UIMAGE),y) endif $(call POSTBUILD, $(TOPDIR)) -# download +# flash (or download : DEPRECATED) # -# This is a helper target that will rebuild NuttX and download it to the target +# This is a helper target that will rebuild NuttX and flash it to the target # system in one step. The operation of this target depends completely upon -# implementation of the DOWNLOAD command in the user Make.defs file. It will -# generate an error if the DOWNLOAD command is not defined. +# implementation of the FLASH command in the user Make.defs file. It will +# generate an error if the FLASH command is not defined. + +flash: $(BIN) + $(call FLASH, $<) download: $(BIN) - $(call DOWNLOAD, $<) + $(call FLASH, $<) # bootloader # diff --git a/tools/Makefile.win b/tools/Makefile.win index 3ff9bd2ad7..d72cca06a0 100644 --- a/tools/Makefile.win +++ b/tools/Makefile.win @@ -408,15 +408,18 @@ ifeq ($(CONFIG_RAW_BINARY),y) endif $(call POSTBUILD, $(TOPDIR)) -# download +# flash (or download : DEPRECATED) # -# This is a helper target that will rebuild NuttX and download it to the target +# This is a helper target that will rebuild NuttX and flash it to the target # system in one step. The operation of this target depends completely upon -# implementation of the DOWNLOAD command in the user Make.defs file. It will -# generate an error an error if the DOWNLOAD command is not defined. +# implementation of the FLASH command in the user Make.defs file. It will +# generate an error if the FLASH command is not defined. + +flash: $(BIN) + $(call FLASH, $<) download: $(BIN) - $(call DOWNLOAD, $<) + $(call FLASH, $<) # bootloader # diff --git a/tools/esp32/Config.mk b/tools/esp32/Config.mk index 00a3c87db9..d8c4cf5cff 100644 --- a/tools/esp32/Config.mk +++ b/tools/esp32/Config.mk @@ -188,12 +188,12 @@ endif ESPTOOL_BAUD ?= 921600 -# DOWNLOAD -- Download binary image via esptool.py +# FLASH -- Download a binary image via esptool.py -define DOWNLOAD +define FLASH $(Q) if [ -z $(ESPTOOL_PORT) ]; then \ - echo "DOWNLOAD error: Missing serial port device argument."; \ - echo "USAGE: make download ESPTOOL_PORT= [ ESPTOOL_BAUD= ] [ ESPTOOL_BINDIR= ]"; \ + echo "FLASH error: Missing serial port device argument."; \ + echo "USAGE: make flash ESPTOOL_PORT= [ ESPTOOL_BAUD= ] [ ESPTOOL_BINDIR= ]"; \ exit 1; \ fi esptool.py -c esp32 -p $(ESPTOOL_PORT) -b $(ESPTOOL_BAUD) write_flash $(ESPTOOL_WRITEFLASH_OPTS) $(ESPTOOL_BINS) diff --git a/tools/esp32c3/Config.mk b/tools/esp32c3/Config.mk index 4550c6f101..af3f0aeb60 100644 --- a/tools/esp32c3/Config.mk +++ b/tools/esp32c3/Config.mk @@ -181,12 +181,12 @@ endif ESPTOOL_BAUD ?= 921600 -# DOWNLOAD -- Download binary image via esptool.py +# FLASH -- Download a binary image via esptool.py -define DOWNLOAD +define FLASH $(Q) if [ -z $(ESPTOOL_PORT) ]; then \ - echo "DOWNLOAD error: Missing serial port device argument."; \ - echo "USAGE: make download ESPTOOL_PORT= [ ESPTOOL_BAUD= ]"; \ + echo "FLASH error: Missing serial port device argument."; \ + echo "USAGE: make flash ESPTOOL_PORT= [ ESPTOOL_BAUD= ]"; \ exit 1; \ fi esptool.py -c esp32c3 -p $(ESPTOOL_PORT) -b $(ESPTOOL_BAUD) write_flash $(ESPTOOL_WRITEFLASH_OPTS) $(ESPTOOL_BINS) diff --git a/tools/esp32s2/Config.mk b/tools/esp32s2/Config.mk index 9e39b880f5..26a7b76bef 100644 --- a/tools/esp32s2/Config.mk +++ b/tools/esp32s2/Config.mk @@ -181,12 +181,12 @@ endif ESPTOOL_BAUD ?= 921600 -# DOWNLOAD -- Download binary image via esptool.py +# FLASH -- Download a binary image via esptool.py -define DOWNLOAD +define FLASH $(Q) if [ -z $(ESPTOOL_PORT) ]; then \ - echo "DOWNLOAD error: Missing serial port device argument."; \ - echo "USAGE: make download ESPTOOL_PORT= [ ESPTOOL_BAUD= ] [ ESPTOOL_BINDIR= ]"; \ + echo "FLASH error: Missing serial port device argument."; \ + echo "USAGE: make flash ESPTOOL_PORT= [ ESPTOOL_BAUD= ] [ ESPTOOL_BINDIR= ]"; \ exit 1; \ fi esptool.py -c esp32s2 -p $(ESPTOOL_PORT) -b $(ESPTOOL_BAUD) write_flash $(ESPTOOL_WRITEFLASH_OPTS) $(ESPTOOL_BINS)