tools/esp32: Continue the build if the QEMU script fails.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
Abdelatif Guettouche 2021-03-09 13:48:47 +01:00 committed by Alan Carvalho de Assis
parent e94bf12929
commit 05f1f3518b
2 changed files with 9 additions and 3 deletions

View File

@ -70,7 +70,11 @@ ifdef ESPTOOL_BINDIR
endif
ifeq ($(CONFIG_ESP32_QEMU_IMAGE),y)
MK_QEMU_IMG=$(TOPDIR)/tools/esp32/mk_qemu_img.sh -b $(BOOTLOADER) -p $(PARTITION_TABLE)
# The "echo" part makes sure that the QEMU script doesn't abort the rest of
# the make process. So, if the script fails, the help message is printed.
MK_QEMU_IMG=$(TOPDIR)/tools/esp32/mk_qemu_img.sh -b $(BOOTLOADER) -p $(PARTITION_TABLE) \
|| echo "Try make ESPTOOL_BINDIR=bins_path"
else
MK_QEMU_IMG=
endif

View File

@ -36,6 +36,7 @@ usage() {
echo " -n <nuttx> path to the nuttx image (default nuttx.bin)"
echo " -i <image_name> name of the resulting image (default esp32_qemu_img.bin)"
echo " -h will show this help and terminate"
echo ""
}
while [ -n "${1}" ]; do
@ -71,7 +72,8 @@ done
# Make sure we have the required argument(s)
if [ -z "${BOOTLOADER_IMG}" ] || [ -z "${PARTITION_IMG}" ] ; then
echo "Missing bootloader and partition table binary images."
echo ""
echo "${SCRIPT_NAME}: Missing bootloader and partition table binary images."
usage
exit 1
fi
@ -86,7 +88,7 @@ dd if="${PARTITION_IMG}" bs=1 seek="$(printf '%d' 0x8000)" of="${FLASH_IMG}" con
dd if="${NUTTX_IMG}" bs=1 seek="$(printf '%d' 0x10000)" of="${FLASH_IMG}" conv=notrunc
if [ ${?} -ne 0 ]; then
printf "Failed to generate %s.\n" "${FLASH_IMG}"
printf "Failed to generate %s!\n" "${FLASH_IMG}"
exit 1
fi