You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gu...@apache.org on 2021/10/14 19:34:42 UTC
[incubator-nuttx] branch master updated: build: Replace 'make
download' with 'make flash'
This is an automated email from the ASF dual-hosted git repository.
gustavonihei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new e0389ce build: Replace 'make download' with 'make flash'
e0389ce is described below
commit e0389ce1fb73920da3ac41de75bece443dbcf080
Author: Alan C. Assis <ac...@gmail.com>
AuthorDate: Thu Oct 14 10:57:21 2021 -0300
build: Replace 'make download' with 'make flash'
---
Documentation/platforms/risc-v/esp32c3/index.rst | 4 ++--
Documentation/platforms/xtensa/esp32/index.rst | 4 ++--
README.md | 8 ++++----
boards/arm/stm32/photon/scripts/Make.defs | 4 ++--
boards/arm/stm32f7/stm32f746g-disco/scripts/Make.defs | 2 +-
boards/arm/stm32l4/b-l475e-iot01a/scripts/Make.defs | 2 +-
tools/Makefile.unix | 13 ++++++++-----
tools/Makefile.win | 13 ++++++++-----
tools/esp32/Config.mk | 8 ++++----
tools/esp32c3/Config.mk | 8 ++++----
tools/esp32s2/Config.mk | 8 ++++----
11 files changed, 40 insertions(+), 34 deletions(-)
diff --git a/Documentation/platforms/risc-v/esp32c3/index.rst b/Documentation/platforms/risc-v/esp32c3/index.rst
index 0ad497a..44f8fc2 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=<port> ESPTOOL_BINDIR=../esp-bins
+ make flash ESPTOOL_PORT=<port> ESPTOOL_BINDIR=../esp-bins
Where ``<port>`` 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 d965ef0..9cb5b72 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=<port>
+ $ make flash ESPTOOL_PORT=<port>
where ``<port>`` 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=<port> ESPTOOL_BINDIR=<dir>
+ $ make flash ESPTOOL_PORT=<port> ESPTOOL_BINDIR=<dir>
.. 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 65ef5ab..594c8c0 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 7636535..60eae12 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 7947c07..cb56c75 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 2235dcc..e67ae6d 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 6ed8213..73b5a85 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 3ff9bd2..d72cca0 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 00a3c87..d8c4cf5 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=<port> [ ESPTOOL_BAUD=<baud> ] [ ESPTOOL_BINDIR=<dir> ]"; \
+ echo "FLASH error: Missing serial port device argument."; \
+ echo "USAGE: make flash ESPTOOL_PORT=<port> [ ESPTOOL_BAUD=<baud> ] [ ESPTOOL_BINDIR=<dir> ]"; \
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 4550c6f..af3f0ae 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=<port> [ ESPTOOL_BAUD=<baud> ]"; \
+ echo "FLASH error: Missing serial port device argument."; \
+ echo "USAGE: make flash ESPTOOL_PORT=<port> [ ESPTOOL_BAUD=<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 9e39b88..26a7b76 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=<port> [ ESPTOOL_BAUD=<baud> ] [ ESPTOOL_BINDIR=<dir> ]"; \
+ echo "FLASH error: Missing serial port device argument."; \
+ echo "USAGE: make flash ESPTOOL_PORT=<port> [ ESPTOOL_BAUD=<baud> ] [ ESPTOOL_BINDIR=<dir> ]"; \
exit 1; \
fi
esptool.py -c esp32s2 -p $(ESPTOOL_PORT) -b $(ESPTOOL_BAUD) write_flash $(ESPTOOL_WRITEFLASH_OPTS) $(ESPTOOL_BINS)