1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:12:57 +01:00

tools/openocd: Make verifying flashed image optional

Checksumming flash is not supported on xtensa platform:

Warn : not implemented yet

make: *** [.../RIOT/examples/saul/../../Makefile.include:796: flash] Error 1
This commit is contained in:
Erik Ekman 2021-09-28 01:26:07 +02:00
parent 2df7d499c8
commit 1c6d7dcdaf
3 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -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'

View File

@ -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)