From 634b97cc4053230e0a844179fdc780b075c47e3b Mon Sep 17 00:00:00 2001 From: Robert Cross Date: Thu, 9 May 2024 16:44:23 -0400 Subject: [PATCH 1/3] 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] From 61da91c518335286315c5ca28950558d51aecd88 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 17 May 2024 09:24:46 +0700 Subject: [PATCH 2/3] bump up version to 1.7.15 --- platform.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.txt b/platform.txt index a8b0606b0..1d8613ea3 100644 --- a/platform.txt +++ b/platform.txt @@ -20,7 +20,7 @@ # https://arduino.github.io/arduino-cli/0.33/platform-specification/ name=Adafruit SAMD (32-bits ARM Cortex-M0+ and Cortex-M4) Boards -version=1.7.14 +version=1.7.15 # Compile variables # ----------------- From ffb6935392c194f82a56b1513e4bbf19a602d72a Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 17 May 2024 09:58:01 +0700 Subject: [PATCH 3/3] update makeboards.py, fix board name typo --- boards.txt | 3 +-- tools/makeboards.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/boards.txt b/boards.txt index 05ab68d34..c5dd7cd26 100644 --- a/boards.txt +++ b/boards.txt @@ -941,9 +941,8 @@ adafruit_TRRStrinkey_m0.menu.debug.on=On adafruit_TRRStrinkey_m0.menu.debug.on.build.flags.debug=-g - # ----------------------------------- -# Adafruit TRRS Trinkey M0 (SAMD21) +# Adafruit Thumbstick Trinkey M0 (SAMD21) # ----------------------------------- adafruit_thumbsticktrinkey_m0.name=Adafruit Thumbstick Trinkey M0 (SAMD21) diff --git a/tools/makeboards.py b/tools/makeboards.py index 131c0aedb..f467feb58 100755 --- a/tools/makeboards.py +++ b/tools/makeboards.py @@ -275,6 +275,21 @@ def make_board(mcu, name, variant, vendor, product, vid, pid_list, boarddefine, "SHT4XTRINKEY_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_SHT4XTRINKEY_M0", "sht4xtrinkey_m0/bootloader-sht4xtrinkey_m0.bin"], + ["adafruit_pixeltrinkey_m0", "pixeltrinkey_m0", "Adafruit", "Pixel Trinkey M0", + "0x239A", ["0x8155", "0x0155", "0x8156"], + "PIXELTRINKEY_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_PIXELTRINKEY_M0", + "pixeltrinkey_m0/bootloader-pixeltrinkey_m0.bin"], + + ["adafruit_TRRStrinkey_m0", "TRRStrinkey_m0", "Adafruit", "TRRS Trinkey M0", + "0x239A", ["0x8157", "0x0157", "0x8158"], + "TRRSTRINKEY_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_TRRSTRINKEY_M0", + "TRRStrinkey_m0/bootloader-TRRStrinkey_m0.bin"], + + ["adafruit_thumbsticktrinkey_m0", "thumbsticktrinkey_m0", "Adafruit", "Thumbstick Trinkey M0", + "0x239A", ["0x8159", "0x0159", "0x8160"], + "THUMBSTICKTRINKEY_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_THUMBSTICKTRINKEY_M0", + "thumbsticktrinkey_m0/bootloader-thumbsticktrinkey_m0.bin"], + ["adafruit_itsybitsy_m0", "itsybitsy_m0", "Adafruit", "ItsyBitsy M0 Express", "0x239A", ["0x800F", "0x000F", "0x8012"], "ITSYBITSY_M0", "-D__SAMD21G18A__ -DCRYSTALLESS -DADAFRUIT_ITSYBITSY_M0",