diff --git a/tools/esp32/Config.mk b/tools/esp32/Config.mk index d814505ea3..e153c39877 100644 --- a/tools/esp32/Config.mk +++ b/tools/esp32/Config.mk @@ -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 diff --git a/tools/esp32/mk_qemu_img.sh b/tools/esp32/mk_qemu_img.sh index d33b815887..357b964792 100755 --- a/tools/esp32/mk_qemu_img.sh +++ b/tools/esp32/mk_qemu_img.sh @@ -36,6 +36,7 @@ usage() { echo " -n path to the nuttx image (default nuttx.bin)" echo " -i 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