diff --git a/cpu/esp32/Makefile.include b/cpu/esp32/Makefile.include index 4ed2013888..f8dd0b2fcb 100644 --- a/cpu/esp32/Makefile.include +++ b/cpu/esp32/Makefile.include @@ -88,4 +88,6 @@ ifneq (,$(filter esp_jtag,$(USEMODULE))) -c 'echo "Installing partition table at $(PARTITION_POS)"' \ -c 'flash write_image erase "$(BINDIR)/partitions.bin" $(PARTITION_POS) bin' IMAGE_OFFSET = 0x10000 + # Flash checksumming not supported on xtensa + OPENOCD_SKIP_VERIFY = yes endif diff --git a/dist/tools/openocd/openocd.sh b/dist/tools/openocd/openocd.sh index ee7141465c..d70d4638db 100755 --- a/dist/tools/openocd/openocd.sh +++ b/dist/tools/openocd/openocd.sh @@ -113,6 +113,8 @@ : ${OPENOCD_CMD_RESET_RUN:="-c 'reset run'"} # Select core on multi-core processors. : ${OPENOCD_CORE:=} +# Set to any value to skip verifying after flashing. +: ${OPENOCD_SKIP_VERIFY:=} # This is an optional offset to the base address that can be used to flash an # image in a different location than it is linked at. This feature can be useful # when flashing images for firmware swapping/remapping boot loaders. @@ -328,6 +330,9 @@ do_flash() { exit $RETVAL fi fi + if [ -z "${OPENOCD_SKIP_VERIFY}" ]; then + OPENOCD_VERIFY="-c 'verify_image \"${IMAGE_FILE}\" ${IMAGE_OFFSET}'" + fi # In case of binary file, IMAGE_OFFSET should include the flash base address # This allows flashing normal binary files without env configuration @@ -358,7 +363,7 @@ do_flash() { ${OPENOCD_PRE_FLASH_CMDS} \ -c 'flash write_image erase \"${IMAGE_FILE}\" ${IMAGE_OFFSET} ${IMAGE_TYPE}' \ ${OPENOCD_PRE_VERIFY_CMDS} \ - -c 'verify_image \"${IMAGE_FILE}\" ${IMAGE_OFFSET}' \ + ${OPENOCD_VERIFY} \ -c 'reset run' \ -c 'shutdown'" && echo 'Done flashing' diff --git a/makefiles/tools/openocd.inc.mk b/makefiles/tools/openocd.inc.mk index f58af2fe23..2f23225e03 100644 --- a/makefiles/tools/openocd.inc.mk +++ b/makefiles/tools/openocd.inc.mk @@ -61,6 +61,11 @@ ifneq (,$(OPENOCD_PRE_VERIFY_CMDS)) $(call target-export-variables,$(OPENOCD_FLASH_TARGETS),OPENOCD_PRE_VERIFY_CMDS) endif +ifneq (,$(OPENOCD_SKIP_VERIFY)) + # Export OPENOCD_SKIP_VERIFY only to the flash/flash-only target + $(call target-export-variables,$(OPENOCD_FLASH_TARGETS),OPENOCD_SKIP_VERIFY) +endif + ifneq (,$(OPENOCD_PRE_FLASH_CMDS)) # Export OPENOCD_PRE_FLASH_CMDS only to the flash/flash-only targets $(call target-export-variables,$(OPENOCD_FLASH_TARGETS),OPENOCD_PRE_FLASH_CMDS)