build: Replace 'make download' with 'make flash'
This commit is contained in:
parent
a7d8d9dd98
commit
e0389ce1fb
@ -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
|
||||
======================
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
#
|
||||
|
@ -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
|
||||
#
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user