From 634b97cc4053230e0a844179fdc780b075c47e3b Mon Sep 17 00:00:00 2001 From: Robert Cross Date: Thu, 9 May 2024 16:44:23 -0400 Subject: [PATCH] Use the correct openocd flash driver for ATSAMD51 devices see openocd docs ( https://github.com/openocd-org/openocd/blob/v0.11.0/doc/openocd.texi#L5827C1-L5827C54 ) --- platform.txt | 4 ++-- scripts/openocd/daplink_samd21.cfg | 2 ++ scripts/openocd/daplink_samd51.cfg | 2 ++ scripts/openocd/jlink_samd21.cfg | 2 ++ scripts/openocd/jlink_samd51.cfg | 2 ++ 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/platform.txt b/platform.txt index f7bf37f3e..a8b0606b0 100644 --- a/platform.txt +++ b/platform.txt @@ -195,7 +195,7 @@ tools.openocd.erase.pattern= tools.openocd.bootloader.params.verbose=-d2 tools.openocd.bootloader.params.quiet=-d0 -tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/{build.openocdscript}" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown" +tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/{build.openocdscript}" -c "telnet_port disabled; init; halt; $_FLASHDRIVER bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown" # # OpenOCD sketch upload - version with configurable bootloader size @@ -221,7 +221,7 @@ tools.openocd-withbootsize.erase.pattern= tools.openocd-withbootsize.bootloader.params.verbose=-d2 tools.openocd-withbootsize.bootloader.params.quiet=-d0 -tools.openocd-withbootsize.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/{build.openocdscript}" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown" +tools.openocd-withbootsize.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/{build.openocdscript}" -c "telnet_port disabled; init; halt; $_FLASHDRIVER bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown" # ---------------------------------------- # Debugger configuration (general options) diff --git a/scripts/openocd/daplink_samd21.cfg b/scripts/openocd/daplink_samd21.cfg index 84c41d309..6c60b8832 100644 --- a/scripts/openocd/daplink_samd21.cfg +++ b/scripts/openocd/daplink_samd21.cfg @@ -24,4 +24,6 @@ transport select swd # chip name set CHIPNAME samd21 +set _FLASHDRIVER at91samd + source [find target/at91samdXX.cfg] diff --git a/scripts/openocd/daplink_samd51.cfg b/scripts/openocd/daplink_samd51.cfg index f87fdeeb6..6aa96d40b 100644 --- a/scripts/openocd/daplink_samd51.cfg +++ b/scripts/openocd/daplink_samd51.cfg @@ -24,4 +24,6 @@ transport select swd # chip name set CHIPNAME samd51 +set _FLASHDRIVER atsame5 + source [find target/atsame5x.cfg] diff --git a/scripts/openocd/jlink_samd21.cfg b/scripts/openocd/jlink_samd21.cfg index 8fbe21bb8..423a5e6bb 100644 --- a/scripts/openocd/jlink_samd21.cfg +++ b/scripts/openocd/jlink_samd21.cfg @@ -24,4 +24,6 @@ transport select swd # chip name set CHIPNAME samd21 +set _FLASHDRIVER at91samd + source [find target/at91samdXX.cfg] diff --git a/scripts/openocd/jlink_samd51.cfg b/scripts/openocd/jlink_samd51.cfg index fd398ef6c..8e9db6bdb 100644 --- a/scripts/openocd/jlink_samd51.cfg +++ b/scripts/openocd/jlink_samd51.cfg @@ -24,4 +24,6 @@ transport select swd # chip name set CHIPNAME samd51 +set _FLASHDRIVER atsame5 + source [find target/atsame5x.cfg]