Add SWD and dmem support for AM64x and J784s4 in OpenOCD
v2 cover Add SWD and dmem support for AM64x and J784s4 in OpenOCD
From: Joao Lima <[email protected]>
This patch series updates OpenOCD to support direct memory access (dmem) via SWD emulation for Texas Instruments AM64x and J784s4 platforms.
Changes include:
1. Version bumps:
- openocd: 91bd431 -> 66ea461
- jimtcl: fcbb449 -> f160866
- libjaylink: 9aa7a59 -> 0d23921
2. Platform support patches:
- Add SWD native configuration files for AM64x and J784s4 boards
- Configure DMEM access parameters in ti_k3.cfg for direct memory operations
- Set up DAPBUS debugger and emulated AP descriptions
3. Add fallback mirror for repository:
- Append MIRRORS with reference to github mirror
v1 -> v2
- Add a fallback repository mirror
Joao Lima (3):
openocd: bump the openocd, jimtcl versions
openocd: add dmem support to am64xx and j784s4 platforms
openocd: add fallback repository mirror
...wd_native.cfg-Add-support-for-direct.patch | 77 +++++++++++++++++++ ....cfg-Add-support-for-direct-memory-a.patch | 65 ++++++++++++++++ .../recipes-devtools/openocd/openocd_git.bb | 12 ++- 3 files changed, 151 insertions(+), 3 deletions(-) create mode 100644 meta-oe/recipes-devtools/openocd/openocd/0001-tcl-board-ti_-_swd_native.cfg-Add-support-for-direct.patch create mode 100644 meta-oe/recipes-devtools/openocd/openocd/0002-tcl-target-ti_k3.cfg-Add-support-for-direct-memory-a.patch
PATCH v2 1/3 openocd: bump the openocd, jimtcl versions
From: Joao Lima <[email protected]>
Version bumps:
- openocd: 91bd431 -> 66ea461
- jimtcl: fcbb449 -> f160866
- libjaylink: 9aa7a59 -> 0d23921
--- meta-oe/recipes-devtools/openocd/openocd_git.bb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
meta-oe/recipes-devtools/openocd/openocd_git.bb +3 -3
@@ -13,10 +13,10 @@ SRC_URI = " \ " SRCREV_FORMAT = "openocd" -SRCREV_openocd = "91bd4313444c5a949ce49d88ab487608df7d6c37" +SRCREV_openocd = "66ea461846a3a4a96687c9287c3f61ae8ce0b775" SRCREV_git2cl = "8373c9f74993e218a08819cbcdbab3f3564bbeba" -SRCREV_jimtcl = "fcbb4499a6b46ef69e7a95da53e30796e20817f0" -SRCREV_libjaylink = "9aa7a5957c07bb6e862fc1a6d3153d109c7407e4" +SRCREV_jimtcl = "f160866171457474f7c4d6ccda70f9b77524407e" +SRCREV_libjaylink = "0d23921a05d5d427332a142d154c213d0c306eb1" PV = "0.12+git"
Re: [meta-oe][PATCH v2 1/3] openocd: bump the openocd, jimtcl versions
How did you test it ?
I am seeing patching errors
NOTE: Applying patch '0001-Makefile.am-Use-SOURCE_DATE_EPOCH-environment-variab.patch' (sources/meta-openembedded/meta-oe/recipes-devtools/openocd/openocd/0001-Makefile.
↪ am-Use-SOURCE_DATE_EPOCH-environment-variab.patch)
ERROR: Applying patch
'0001-Makefile.am-Use-SOURCE_DATE_EPOCH-environment-variab.patch' on target directory '/home/kraj200/yoe/build/tmp/work/x86-64-v3-yoe-linux-musl/
↪ openocd/0.12+git/sources/openocd-0.12+git'
Quoted 31 lines · João
From: Joao Lima <[email protected]>
Version bumps:
- openocd: 91bd431 -> 66ea461
- jimtcl: fcbb449 -> f160866
- libjaylink: 9aa7a59 -> 0d23921Signed-off-by Joao Lima <[email protected]>--- meta-oe/recipes-devtools/openocd/openocd_git.bb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)meta-oe/recipes-devtools/openocd/openocd_git.bb +3
-3@@ -13,10 +13,10 @@ SRC_URI = " \ " SRCREV_FORMAT = "openocd" -SRCREV_openocd = "91bd4313444c5a949ce49d88ab487608df7d6c37" +SRCREV_openocd = "66ea461846a3a4a96687c9287c3f61ae8ce0b775" SRCREV_git2cl = "8373c9f74993e218a08819cbcdbab3f3564bbeba" -SRCREV_jimtcl = "fcbb4499a6b46ef69e7a95da53e30796e20817f0" -SRCREV_libjaylink = "9aa7a5957c07bb6e862fc1a6d3153d109c7407e4" +SRCREV_jimtcl = "f160866171457474f7c4d6ccda70f9b77524407e" +SRCREV_libjaylink = "0d23921a05d5d427332a142d154c213d0c306eb1" PV = "0.12+git"
Re: [meta-oe][PATCH v2 1/3] openocd: bump the openocd, jimtcl versions
Once I remove the patch it fails to configure thats next problem see -
https://autobuilder.yoctoproject.org/valkyrie/api/v2/logs/3764711/raw_inline
Quoted 47 lines · Khem Raj
How did you test it ?
I am seeing patching errorsNOTE: Applying patch '0001-Makefile.am-Use-SOURCE_DATE_EPOCH-environment-variab.patch' (sources/meta-openembedded/meta-oe/recipes-devtools/openocd/openocd/0001-Makefile.
↪ am-Use-SOURCE_DATE_EPOCH-environment-variab.patch)
ERROR: Applying patch
'0001-Makefile.am-Use-SOURCE_DATE_EPOCH-environment-variab.patch' on target directory '/home/kraj200/yoe/build/tmp/work/x86-64-v3-yoe-linux-musl/
↪ openocd/0.12+git/sources/openocd-0.12+git'Quoted 31 lines · João
From: Joao Lima <[email protected]>
Version bumps:
- openocd: 91bd431 -> 66ea461
- jimtcl: fcbb449 -> f160866
- libjaylink: 9aa7a59 -> 0d23921Signed-off-by Joao Lima <[email protected]>--- meta-oe/recipes-devtools/openocd/openocd_git.bb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)meta-oe/recipes-devtools/openocd/openocd_git.bb +3
-3@@ -13,10 +13,10 @@ SRC_URI = " \ " SRCREV_FORMAT = "openocd" -SRCREV_openocd = "91bd4313444c5a949ce49d88ab487608df7d6c37" +SRCREV_openocd = "66ea461846a3a4a96687c9287c3f61ae8ce0b775" SRCREV_git2cl = "8373c9f74993e218a08819cbcdbab3f3564bbeba" -SRCREV_jimtcl = "fcbb4499a6b46ef69e7a95da53e30796e20817f0" -SRCREV_libjaylink = "9aa7a5957c07bb6e862fc1a6d3153d109c7407e4" +SRCREV_jimtcl = "f160866171457474f7c4d6ccda70f9b77524407e" +SRCREV_libjaylink = "0d23921a05d5d427332a142d154c213d0c306eb1" PV = "0.12+git"
Re: [meta-oe][PATCH v2 1/3] openocd: bump the openocd, jimtcl versions
Hello Khem
Thank you for sharing the log.
I figured out what was wrong with my test setup.
Since I had to create a separate setup, I didn't configure it properly to include the recipe.
I have already submitted a new series.
I tested them by generating a minimal image.
Thank you.
Best Regards,
Joao Lima
Khem Raj <[email protected]> escreveu (quarta, 8/10/2025 à(s) 04:32):
Quoted 56 lines
Once I remove the patch it fails to configure thats next problem see -
https://autobuilder.yoctoproject.org/valkyrie/api/v2/logs/3764711/raw_inline
Quoted 7 lines · Khem Raj
How did you test it ?
I am seeing patching errorsNOTE: Applying patch '0001-Makefile.am-Use-SOURCE_DATE_EPOCH-environment-variab.patch'
(sources/meta-openembedded/meta-oe/recipes-devtools/openocd/openocd/0001-Makefile.
Quoted 9 lines
↪ am-Use-SOURCE_DATE_EPOCH-environment-variab.patch)
ERROR: Applying patch
'0001-Makefile.am-Use-SOURCE_DATE_EPOCH-environment-variab.patch' on target directory '/home/kraj200/yoe/build/tmp/work/x86-64-v3-yoe-linux-musl/
↪ openocd/0.12+git/sources/openocd-0.12+git'On Tue, Oct 7, 2025 at 3:54 AM Lima, João <[email protected]>
Quoted 8 lines · wrote:
Quoted 8 lines
From: Joao Lima <[email protected]>
Version bumps:
- openocd: 91bd431 -> 66ea461
- jimtcl: fcbb449 -> f160866
- libjaylink: 9aa7a59 -> 0d23921Quoted 6 lines
Review
Quoted 6 lines
Signed-off-by Joao Lima <[email protected]>--- meta-oe/recipes-devtools/openocd/openocd_git.bb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)(quoted diff) +0
-0b/meta-oe/recipes-devtools/openocd/openocd_git.bb
Quoted 17 lines
Quoted 17 lines
index
3bbe33ca1d..3b7705c41d100644meta-oe/recipes-devtools/openocd/openocd_git.bb +3
-3@@ -13,10 +13,10 @@ SRC_URI = " \ " SRCREV_FORMAT = "openocd" -SRCREV_openocd = "91bd4313444c5a949ce49d88ab487608df7d6c37" +SRCREV_openocd = "66ea461846a3a4a96687c9287c3f61ae8ce0b775" SRCREV_git2cl = "8373c9f74993e218a08819cbcdbab3f3564bbeba" -SRCREV_jimtcl = "fcbb4499a6b46ef69e7a95da53e30796e20817f0" -SRCREV_libjaylink = "9aa7a5957c07bb6e862fc1a6d3153d109c7407e4" +SRCREV_jimtcl = "f160866171457474f7c4d6ccda70f9b77524407e" +SRCREV_libjaylink = "0d23921a05d5d427332a142d154c213d0c306eb1" PV = "0.12+git"
PATCH v2 2/3 openocd: add dmem support to am64xx and j784s4 platforms
In reply to Lima, JoãoFrom: Joao Lima <[email protected]>
Platform support patches:
- Add SWD native configuration files for AM64x and J784s4 boards
- Configure DMEM access parameters in ti_k3.cfg for direct memory operations
- Set up DAPBUS debugger and emulated AP descriptions
--- ...wd_native.cfg-Add-support-for-direct.patch | 77 +++++++++++++++++++ ....cfg-Add-support-for-direct-memory-a.patch | 65 ++++++++++++++++ .../recipes-devtools/openocd/openocd_git.bb | 2 + 3 files changed, 144 insertions(+) create mode 100644 meta-oe/recipes-devtools/openocd/openocd/0001-tcl-board-ti_-_swd_native.cfg-Add-support-for-direct.patch create mode 100644 meta-oe/recipes-devtools/openocd/openocd/0002-tcl-target-ti_k3.cfg-Add-support-for-direct-memory-a.patch
meta-oe/recipes-devtools/openocd/openocd/0001-tcl-board-ti_-_swd_native.cfg-Add-support-for-direct.patch new file +77 -0
@@ -0,0 +1,77 @@ +From 5c55d79ecfecc4a1b5a5ebcf649227ca1e1bf38e Mon Sep 17 00:00:00 2001 +From: Joao Lima <[email protected]> +Date: Tue, 30 Sep 2025 12:13:04 +0000 +Subject: [PATCH 1/2] tcl/board/ti_*_swd_native.cfg: Add support for direct + memory access via SW + +Add support for SWD emulation as a transport method for +direct memory operations of boards TI AM64x and TI J784s4 + +Upstream-Status: Submitted [http://openocd.zylin.com/#/c/9020/] + +Change-Id: I17fe9b2bef5c58886625bfdb88d92645ba4d7da7 +Signed-off-by: Joao Lima <[email protected]> +--- + tcl/board/ti_am64xx_swd_native.cfg | 23 +++++++++++++++++++++++ + tcl/board/ti_j784s4_swd_native.cfg | 22 ++++++++++++++++++++++ + 2 files changed, 45 insertions(+) + create mode 100644 tcl/board/ti_am64xx_swd_native.cfg + create mode 100644 tcl/board/ti_j784s4_swd_native.cfg + +diff --git a/tcl/board/ti_am64xx_swd_native.cfg b/tcl/board/ti_am64xx_swd_native.cfg +new file mode 100644 +index 000000000..d3727149e +--- /dev/null ++++ b/tcl/board/ti_am64xx_swd_native.cfg +@@ -0,0 +1,23 @@ ++# SPDX-License-Identifier: GPL-2.0-or-later ++# Copyright (C) 2022-2023 Texas Instruments Incorporated - http://www.ti.com/ ++# ++# Texas Instruments am642 ++# Link: https://www.ti.com/product/AM642 ++# ++# This configuration file is used as a self hosted debug configuration that ++# works on every AM642 platform based on firewall configuration permitted ++# in the system. ++# ++# In this system openOCD runs on one of the CPUs inside AM625 and provides ++# network ports that can then be used to debug the microcontrollers on the ++# SoC - either self hosted IDE OR remotely. ++ ++# We are using dmem, which uses dapdirect_swd transport ++adapter driver dmem ++transport select swd ++ ++if { ![info exists SOC] } { ++ set SOC am642 ++} ++ ++source [find target/ti_k3.cfg] +diff --git a/tcl/board/ti_j784s4_swd_native.cfg b/tcl/board/ti_j784s4_swd_native.cfg +new file mode 100644 +index 000000000..13b2ac3b8 +--- /dev/null ++++ b/tcl/board/ti_j784s4_swd_native.cfg +@@ -0,0 +1,22 @@ ++# SPDX-License-Identifier: GPL-2.0-or-later ++# Copyright (C) 2022-2023 Texas Instruments Incorporated - http://www.ti.com/ ++# ++# Texas Instruments TDA4VM/J721E ++# Link: https://www.ti.com/product/TDA4VM ++# ++# This configuration file is used as a self hosted debug configuration that ++# works on every TDA4VM platform based on firewall configuration permitted ++# in the system. ++# ++# In this system openOCD runs on one of the CPUs inside TDA4VM and provides ++# network ports that can then be used to debug the microcontrollers on the ++# SoC - either self hosted IDE OR remotely. ++ ++# We are using dmem, which uses dapdirect_swd transport ++adapter driver dmem ++transport select swd ++ ++if { ![info exists SOC] } { ++ set SOC j784s4 ++} ++source [find target/ti_k3.cfg]
meta-oe/recipes-devtools/openocd/openocd/0002-tcl-target-ti_k3.cfg-Add-support-for-direct-memory-a.patch new file +65 -0
65 lines not on this page · raw message
meta-oe/recipes-devtools/openocd/openocd_git.bb +2 -0
@@ -10,6 +10,8 @@ SRC_URI = " \ git://github.com/msteveb/jimtcl.git;protocol=https;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/jimtcl;name=jimtcl;branch=master \ git://repo.or.cz/r/libjaylink.git;protocol=http;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/src/jtag/drivers/libjaylink;name=libjaylink;branch=master \ file://0001-Makefile.am-Use-SOURCE_DATE_EPOCH-environment-variab.patch \ + file://0001-tcl-board-ti_-_swd_native.cfg-Add-support-for-direct.patch \ + file://0002-tcl-target-ti_k3.cfg-Add-support-for-direct-memory-a.patch \ " SRCREV_FORMAT = "openocd"
PATCH v2 3/3 openocd: add fallback repository mirror
In reply to Lima, JoãoFrom: Joao Lima <[email protected]>
Add a fallback mirror for the openocd repository fetch process, so that if the primary source repo.or.cz is unavailable, the build system will attempt to download the source code from the gitHub mirror.
--- meta-oe/recipes-devtools/openocd/openocd_git.bb | 4 ++++ 1 file changed, 4 insertions(+)
meta-oe/recipes-devtools/openocd/openocd_git.bb +4 -0
@@ -4,6 +4,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=599d2d1ee7fc84c0467b3d19801db870" DEPENDS = "libusb-compat libftdi" RDEPENDS:${PN} = "libusb1" +MIRRORS += " \ + git://repo.or.cz/openocd.git git://github.com/openocd-org/openocd.git \ +" + SRC_URI = " \ git://repo.or.cz/openocd.git;protocol=http;name=openocd;branch=master \ git://repo.or.cz/r/git2cl.git;protocol=http;destsuffix=tools/git2cl;name=git2cl;branch=master \