Compare commits

...

8 Commits

Author SHA1 Message Date
Marc Schink
a9015ba79d tcl/target/lsch3_common: Remove 'mem2array'
The 'mem2array' function is deprecated and replaced by 'read_memory'.

Change-Id: Iea54a390d67978d20dbb99ab6f7f4178dda481c2
Reported-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8962
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-06-21 07:38:58 +00:00
Vitaly Cheptsov
1040bdec79 jlink: add nickname support
Using nicknames provides a human-readable alternative to serial
numbers for convenience purposes. Allow matching adapter serial
with device nickname.

Change-Id: I03b8d28a6c89412a825d42f4f66b3b528f217d9c
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8886
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: zapb <dev@zapb.de>
2025-06-21 07:38:17 +00:00
Marc Schink
99d642ca5b doc: Fix 'add_help_text' and 'add_usage_text' usage
Remove the quotation marks as they are used for strings and not
parameter names.

Change-Id: I7bb25eb251427e89256b73cf697d8ec5c1b401dc
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8963
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-06-21 07:37:52 +00:00
Marc Schink
06a0b8451f doc: Fix 'find' and 'ocd_find' usage
Remove the quotation marks as they are used for strings and not
parameter names.

Change-Id: Ib0629e1465f821f91cd1e837f4ef8c752013b6b7
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8955
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-06-21 07:37:34 +00:00
Marc Schink
1afa12005c doc: Fix 'add_script_search_dir' usage
The 'directory' parameter is not optional.

Change-Id: Ifbc7b311692157dae0621dfa6d35a24b8fe8cbb2
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8954
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2025-06-21 07:37:03 +00:00
Tomas Vanek
82dc399e5e target/cortex_m: fix debug reason after reset halt
[1] removed target_halt() from cortex_m_assert_reset()
It broke debug_reason tracking and the previous reason
was shown after reset halt.

Set debug_reason to DBG_REASON_DBGRQ during reset halt
preparation.

Fixes: [1] commit 226085065b ("target/cortex_m: drop useless target_halt() call")
Reported-by: Marc Schink <dev@zapb.de>
Change-Id: I685618ed158abde11f6e00eeeee1dfa8ed90952d
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8945
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
2025-06-21 07:36:40 +00:00
R. Diez
9e4b6b90c9 configure.ac: show 5 ARM adapters in config summary
Adapters: bcm2835gpio, imx_gpio, am335xgpio, ep93xx and at91rm9200
Allow the user to enable them regardless of the target architecture.

Change-Id: I9fbc7cbefe770ea2e2239b95a3305fd29127fa85
Signed-off-by: R. Diez <rdiez-2006@rd10.de>

Reviewed-on: https://review.openocd.org/c/openocd/+/8892
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2025-06-21 07:35:54 +00:00
Daniel Goehring
33ebae9abd target/armv8: update MPIDR decoding
Update MPIDR decode to support the multithreading (MT) bit.

If detected, socket, cluster, core and multithread affinity levels are
decoded and displayed.

Change-Id: I43569141fa0eef8ee8fc16c187a4af3c23e97db8
Signed-off-by: Daniel Goehring <dgoehrin@os.amperecomputing.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7190
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2025-06-21 07:35:31 +00:00
7 changed files with 140 additions and 127 deletions

View File

@@ -197,6 +197,15 @@ m4_define([RSHIM_ADAPTER],
m4_define([AMTJTAGACCEL_ADAPTER],
[[[amtjtagaccel], [Amontec JTAG-Accelerator driver], [AMTJTAGACCEL]]])
m4_define([HOST_ARM_BITBANG_ADAPTERS],
[[[ep93xx], [Bitbanging on EP93xx-based SBCs], [EP93XX]],
[[at91rm9200], [Bitbanging on AT91RM9200-based SBCs], [AT91RM9200]]])
m4_define([HOST_ARM_OR_AARCH64_BITBANG_ADAPTERS],
[[[bcm2835gpio], [Bitbanging on BCM2835 (as found in Raspberry Pi)], [BCM2835GPIO]],
[[imx_gpio], [Bitbanging on NXP IMX processors], [IMX_GPIO]],
[[am335xgpio], [Bitbanging on AM335x (as found in Beaglebones)], [AM335XGPIO]]])
# The word 'Adapter' in "Dummy Adapter" below must begin with a capital letter
# because there is an M4 macro called 'adapter'.
m4_define([DUMMY_ADAPTER],
@@ -336,6 +345,16 @@ AC_ARG_ADAPTERS([
AMTJTAGACCEL_ADAPTER
],[no])
# The following adapters use bitbanging and can actually be built on all architectures,
# which is useful to verify that they still build fine.
# We could enable them automatically only on the architectures where they actually occur:
# HOST_ARM_BITBANG_ADAPTERS: when ${host_cpu} matches arm*
# HOST_ARM_OR_AARCH64_BITBANG_ADAPTERS: when ${host_cpu} matches arm*|aarch64
# However, conditionally changing the meaning of 'auto' requires
# a more flexible logic around.
AC_ARG_ADAPTERS([HOST_ARM_BITBANG_ADAPTERS],[no])
AC_ARG_ADAPTERS([HOST_ARM_OR_AARCH64_BITBANG_ADAPTERS],[no])
AC_ARG_ENABLE([parport],
AS_HELP_STRING([--enable-parport], [Enable building the pc parallel port driver]),
[build_parport=$enableval], [build_parport=no])
@@ -350,39 +369,6 @@ AC_ARG_ENABLE([parport_giveio],
[Enable use of giveio for parport (for CygWin only)]),
[parport_use_giveio=$enableval], [parport_use_giveio=])
AS_CASE(["${host_cpu}"],
[arm*|aarch64], [
AC_ARG_ENABLE([bcm2835gpio],
AS_HELP_STRING([--enable-bcm2835gpio], [Enable building support for bitbanging on BCM2835 (as found in Raspberry Pi)]),
[build_bcm2835gpio=$enableval], [build_bcm2835gpio=no])
AC_ARG_ENABLE([imx_gpio],
AS_HELP_STRING([--enable-imx_gpio], [Enable building support for bitbanging on NXP IMX processors]),
[build_imx_gpio=$enableval], [build_imx_gpio=no])
AC_ARG_ENABLE([am335xgpio],
AS_HELP_STRING([--enable-am335xgpio], [Enable building support for bitbanging on AM335x (as found in Beaglebones)]),
[build_am335xgpio=$enableval], [build_am335xgpio=no])
],
[
build_bcm2835gpio=no
build_imx_gpio=no
build_am335xgpio=no
])
AS_CASE(["${host_cpu}"],
[arm*], [
AC_ARG_ENABLE([ep93xx],
AS_HELP_STRING([--enable-ep93xx], [Enable building support for EP93xx based SBCs]),
[build_ep93xx=$enableval], [build_ep93xx=no])
AC_ARG_ENABLE([at91rm9200],
AS_HELP_STRING([--enable-at91rm9200], [Enable building support for AT91RM9200 based SBCs]),
[build_at91rm9200=$enableval], [build_at91rm9200=no])
],
[
build_ep93xx=no
build_at91rm9200=no
])
AC_ARG_ENABLE([gw16012],
AS_HELP_STRING([--enable-gw16012], [Enable building support for the Gateworks GW16012 JTAG Programmer]),
[build_gw16012=$enableval], [build_gw16012=no])
@@ -529,41 +515,6 @@ AS_IF([test "x$ADAPTER_VAR([dummy])" != "xno"], [
build_bitbang=yes
])
AS_IF([test "x$build_ep93xx" = "xyes"], [
build_bitbang=yes
AC_DEFINE([BUILD_EP93XX], [1], [1 if you want ep93xx.])
], [
AC_DEFINE([BUILD_EP93XX], [0], [0 if you don't want ep93xx.])
])
AS_IF([test "x$build_at91rm9200" = "xyes"], [
build_bitbang=yes
AC_DEFINE([BUILD_AT91RM9200], [1], [1 if you want at91rm9200.])
], [
AC_DEFINE([BUILD_AT91RM9200], [0], [0 if you don't want at91rm9200.])
])
AS_IF([test "x$build_bcm2835gpio" = "xyes"], [
build_bitbang=yes
AC_DEFINE([BUILD_BCM2835GPIO], [1], [1 if you want bcm2835gpio.])
], [
AC_DEFINE([BUILD_BCM2835GPIO], [0], [0 if you don't want bcm2835gpio.])
])
AS_IF([test "x$build_imx_gpio" = "xyes"], [
build_bitbang=yes
AC_DEFINE([BUILD_IMX_GPIO], [1], [1 if you want imx_gpio.])
], [
AC_DEFINE([BUILD_IMX_GPIO], [0], [0 if you don't want imx_gpio.])
])
AS_IF([test "x$build_am335xgpio" = "xyes"], [
build_bitbang=yes
AC_DEFINE([BUILD_AM335XGPIO], [1], [1 if you want am335xgpio.])
], [
AC_DEFINE([BUILD_AM335XGPIO], [0], [0 if you don't want am335xgpio.])
])
AS_IF([test "x$parport_use_ppdev" = "xyes"], [
AC_DEFINE([PARPORT_USE_PPDEV], [1], [1 if you want parport to use ppdev.])
], [
@@ -709,6 +660,8 @@ PROCESS_ADAPTERS([JTAG_VPI_ADAPTER], [true], [unused])
PROCESS_ADAPTERS([RSHIM_ADAPTER], ["x$can_build_rshim" = "xyes"],
[internal error: validation should happen beforehand])
PROCESS_ADAPTERS([AMTJTAGACCEL_ADAPTER], [true], [unused])
PROCESS_ADAPTERS([HOST_ARM_BITBANG_ADAPTERS], [true], [unused])
PROCESS_ADAPTERS([HOST_ARM_OR_AARCH64_BITBANG_ADAPTERS], [true], [unused])
PROCESS_ADAPTERS([DUMMY_ADAPTER], [true], [unused])
AS_IF([test "x$enable_linuxgpiod" != "xno"], [
@@ -723,6 +676,26 @@ AS_IF([test "x$enable_remote_bitbang" != "xno"], [
build_bitbang=yes
])
AS_IF([test "x$enable_bcm2835gpio" != "xno"], [
build_bitbang=yes
])
AS_IF([test "x$enable_imx_gpio" != "xno"], [
build_bitbang=yes
])
AS_IF([test "x$enable_am335xgpio" != "xno"], [
build_bitbang=yes
])
AS_IF([test "x$enable_ep93xx" != "xno"], [
build_bitbang=yes
])
AS_IF([test "x$enable_at91rm9200" != "xno"], [
build_bitbang=yes
])
AS_IF([test "x$enable_stlink" != "xno" -o "x$enable_ti_icdi" != "xno" -o "x$enable_nulink" != "xno"], [
AC_DEFINE([BUILD_HLADAPTER], [1], [1 if you want the High Level JTAG driver.])
AM_CONDITIONAL([HLADAPTER], [true])
@@ -758,11 +731,6 @@ AS_IF([test "x$enable_esp_usb_jtag" != "xno"], [
AM_CONDITIONAL([RELEASE], [test "x$build_release" = "xyes"])
AM_CONDITIONAL([PARPORT], [test "x$build_parport" = "xyes"])
AM_CONDITIONAL([GIVEIO], [test "x$parport_use_giveio" = "xyes"])
AM_CONDITIONAL([EP93XX], [test "x$build_ep93xx" = "xyes"])
AM_CONDITIONAL([AT91RM9200], [test "x$build_at91rm9200" = "xyes"])
AM_CONDITIONAL([BCM2835GPIO], [test "x$build_bcm2835gpio" = "xyes"])
AM_CONDITIONAL([IMX_GPIO], [test "x$build_imx_gpio" = "xyes"])
AM_CONDITIONAL([AM335XGPIO], [test "x$build_am335xgpio" = "xyes"])
AM_CONDITIONAL([BITBANG], [test "x$build_bitbang" = "xyes"])
AM_CONDITIONAL([USB_BLASTER_DRIVER], [test "x$enable_usb_blaster" != "xno" -o "x$enable_usb_blaster_2" != "xno"])
AM_CONDITIONAL([GW16012], [test "x$build_gw16012" = "xyes"])
@@ -884,10 +852,12 @@ m4_foreach([adapter], [USB1_ADAPTERS,
JTAG_VPI_ADAPTER,
RSHIM_ADAPTER,
AMTJTAGACCEL_ADAPTER,
HOST_ARM_BITBANG_ADAPTERS,
HOST_ARM_OR_AARCH64_BITBANG_ADAPTERS,
DUMMY_ADAPTER,
OPTIONAL_LIBRARIES,
COVERAGE],
[s=m4_format(["%-41s"], ADAPTER_DESC([adapter]))
[s=m4_format(["%-49s"], ADAPTER_DESC([adapter]))
AS_CASE([$ADAPTER_VAR([adapter])],
[auto], [
echo "$s"yes '(auto)'

View File

@@ -1382,11 +1382,11 @@ Read the OpenOCD source code (and Developer's Guide)
if you have a new kind of hardware interface
and need to provide a driver for it.
@deffn {Command} {find} 'filename'
@deffn {Command} {find} filename
Prints full path to @var{filename} according to OpenOCD search rules.
@end deffn
@deffn {Command} {ocd_find} 'filename'
@deffn {Command} {ocd_find} filename
Prints full path to @var{filename} according to OpenOCD search rules. This
is a low level function used by the @command{find}. Usually you want
to use @command{find}, instead.
@@ -2499,6 +2499,9 @@ If this command is not specified, serial strings are not checked.
Only the following adapter drivers use the serial string from this command:
arm-jtag-ew, cmsis_dap, esp_usb_jtag, ft232r, ftdi, hla (stlink, ti-icdi), jlink, kitprog, opendus,
openjtag, osbdm, presto, rlink, st-link, usb_blaster (ublast2), usbprog, vsllink, xds110.
For jlink adapters, the @var{serial_string} is also compared
against the adapter's nickname.
@end deffn
@section Interface Drivers
@@ -9335,7 +9338,7 @@ Redirect logging to @var{filename}. If used without an argument or
stderr.
@end deffn
@deffn {Command} {add_script_search_dir} [directory]
@deffn {Command} {add_script_search_dir} directory
Add @var{directory} to the file/script search path.
@end deffn
@@ -9870,11 +9873,11 @@ Requests the current target to map the specified @var{virtual_address}
to its corresponding physical address, and displays the result.
@end deffn
@deffn {Command} {add_help_text} 'command_name' 'help-string'
@deffn {Command} {add_help_text} command_name help_string
Add or replace help text on the given @var{command_name}.
@end deffn
@deffn {Command} {add_usage_text} 'command_name' 'help-string'
@deffn {Command} {add_usage_text} command_name help_string
Add or replace usage text on the given @var{command_name}.
@end deffn

View File

@@ -23,6 +23,7 @@
#include <stdint.h>
#include <math.h>
#include <string.h>
#include <jtag/interface.h>
#include <jtag/swd.h>
@@ -40,8 +41,6 @@ static struct jaylink_connection connlist[JAYLINK_MAX_CONNECTIONS];
static enum jaylink_jtag_version jtag_command_version;
static uint8_t caps[JAYLINK_DEV_EXT_CAPS_SIZE];
static uint32_t serial_number;
static bool use_serial_number;
static bool use_usb_location;
static enum jaylink_usb_address usb_address;
static bool use_usb_address;
@@ -561,8 +560,9 @@ static int jlink_open_device(uint32_t ifaces, bool *found_device)
}
use_usb_location = !!adapter_usb_get_location();
const char *adapter_serial = adapter_get_required_serial();
if (!use_serial_number && !use_usb_address && !use_usb_location && num_devices > 1) {
if (!adapter_serial && !use_usb_address && !use_usb_location && num_devices > 1) {
LOG_ERROR("Multiple devices found, specify the desired device");
LOG_INFO("Found devices:");
for (size_t i = 0; devs[i]; i++) {
@@ -575,7 +575,12 @@ static int jlink_open_device(uint32_t ifaces, bool *found_device)
jaylink_strerror(ret));
continue;
}
LOG_INFO("Device %zu serial: %" PRIu32, i, serial);
char name[JAYLINK_NICKNAME_MAX_LENGTH];
int name_ret = jaylink_device_get_nickname(devs[i], name);
if (name_ret == JAYLINK_OK)
LOG_INFO("Device %zu serial: %" PRIu32 ", nickname %s", i, serial, name);
else
LOG_INFO("Device %zu serial: %" PRIu32, i, serial);
}
jaylink_free_devices(devs, true);
@@ -585,23 +590,39 @@ static int jlink_open_device(uint32_t ifaces, bool *found_device)
*found_device = false;
uint32_t serial_number;
ret = jaylink_parse_serial_number(adapter_serial, &serial_number);
if (ret != JAYLINK_OK)
serial_number = 0;
for (size_t i = 0; devs[i]; i++) {
struct jaylink_device *dev = devs[i];
if (use_serial_number) {
uint32_t tmp;
ret = jaylink_device_get_serial_number(dev, &tmp);
if (adapter_serial) {
/*
* Treat adapter serial as a nickname first as it can also be numeric.
* If it fails to match (optional) device nickname try to compare
* adapter serial with the actual device serial number.
*/
char nickname[JAYLINK_NICKNAME_MAX_LENGTH];
ret = jaylink_device_get_nickname(dev, nickname);
if (ret != JAYLINK_OK || strcmp(nickname, adapter_serial) != 0) {
if (!serial_number)
continue;
if (ret == JAYLINK_ERR_NOT_AVAILABLE) {
continue;
} else if (ret != JAYLINK_OK) {
LOG_WARNING("jaylink_device_get_serial_number() failed: %s",
jaylink_strerror(ret));
continue;
uint32_t tmp;
ret = jaylink_device_get_serial_number(dev, &tmp);
if (ret == JAYLINK_ERR_NOT_AVAILABLE) {
continue;
} else if (ret != JAYLINK_OK) {
LOG_WARNING("jaylink_device_get_serial_number() failed: %s",
jaylink_strerror(ret));
continue;
}
if (serial_number != tmp)
continue;
}
if (serial_number != tmp)
continue;
}
if (use_usb_address) {
@@ -670,29 +691,15 @@ static int jlink_init(void)
return ERROR_JTAG_INIT_FAILED;
}
const char *serial = adapter_get_required_serial();
if (serial) {
ret = jaylink_parse_serial_number(serial, &serial_number);
if (ret == JAYLINK_ERR) {
LOG_ERROR("Invalid serial number: %s", serial);
jaylink_exit(jayctx);
return ERROR_JTAG_INIT_FAILED;
}
if (ret != JAYLINK_OK) {
LOG_ERROR("jaylink_parse_serial_number() failed: %s", jaylink_strerror(ret));
jaylink_exit(jayctx);
return ERROR_JTAG_INIT_FAILED;
}
use_serial_number = true;
if (adapter_get_required_serial())
use_usb_address = false;
}
bool found_device;
ret = jlink_open_device(JAYLINK_HIF_USB, &found_device);
if (ret != ERROR_OK)
return ret;
if (!found_device && use_serial_number) {
if (!found_device && adapter_get_required_serial()) {
ret = jlink_open_device(JAYLINK_HIF_TCP, &found_device);
if (ret != ERROR_OK)
return ret;

View File

@@ -883,12 +883,27 @@ int armv8_read_mpidr(struct armv8_common *armv8)
int retval = ERROR_FAIL;
struct arm *arm = &armv8->arm;
struct arm_dpm *dpm = armv8->arm.dpm;
uint32_t mpidr;
uint64_t mpidr;
uint8_t multi_processor_system;
uint8_t aff3;
uint8_t aff2;
uint8_t aff1;
uint8_t aff0;
uint8_t mt;
retval = dpm->prepare(dpm);
if (retval != ERROR_OK)
goto done;
/*
* TODO: BUG - routine armv8_dpm_modeswitch() doesn't re-evaluate 'arm->dpm->core_state'.
* If the core is halted in EL0 AArch32 while EL1 is in AArch64, the modeswitch moves the core
* to EL1, but there is no re-evaluation of dpm->arm->core_state. As a result, while the core
* is in AArch64, the code considers the system still in AArch32. The read of MPIDR would
* select the instruction based on the old core_state. The call to 'armv8_dpm_get_core_state()'
* below could also potentially return the incorrect execution state for the current EL.
*/
/* check if we're in an unprivileged mode */
if (armv8_curel_from_core_mode(arm->core_mode) < SYSTEM_CUREL_EL1) {
retval = armv8_dpm_modeswitch(dpm, ARMV8_64_EL1H);
@@ -896,17 +911,39 @@ int armv8_read_mpidr(struct armv8_common *armv8)
return retval;
}
retval = dpm->instr_read_data_r0(dpm, armv8_opcode(armv8, READ_REG_MPIDR), &mpidr);
retval = dpm->instr_read_data_r0_64(dpm, armv8_opcode(armv8, READ_REG_MPIDR), &mpidr);
if (retval != ERROR_OK)
goto done;
if (mpidr & 1U<<31) {
armv8->multi_processor_system = (mpidr >> 30) & 1;
armv8->cluster_id = (mpidr >> 8) & 0xf;
armv8->cpu_id = mpidr & 0x3;
LOG_INFO("%s cluster %x core %x %s", target_name(armv8->arm.target),
armv8->cluster_id,
armv8->cpu_id,
armv8->multi_processor_system == 0 ? "multi core" : "single core");
multi_processor_system = (mpidr >> 30) & 1;
aff3 = (mpidr >> 32) & 0xff;
aff2 = (mpidr >> 16) & 0xff;
aff1 = (mpidr >> 8) & 0xff;
aff0 = mpidr & 0xff;
mt = (mpidr >> 24) & 0x1;
if (armv8_dpm_get_core_state(&armv8->dpm) == ARM_STATE_AARCH64) {
if (mt)
LOG_INFO("%s socket %" PRIu32 " cluster %" PRIu32 " core %" PRIu32 " thread %" PRIu32 " %s",
target_name(armv8->arm.target),
aff3, aff2, aff1, aff0,
multi_processor_system == 0 ? "multi core" : "single core");
else
LOG_INFO("%s socket %" PRIu32 " cluster %" PRIu32 " core %" PRIu32 " %s",
target_name(armv8->arm.target),
aff3, aff1, aff0,
multi_processor_system == 0 ? "multi core" : "single core");
} else {
if (mt)
LOG_INFO("%s cluster %" PRIu32 " core %" PRIu32 " thread %" PRIu32 " %s",
target_name(armv8->arm.target),
aff2, aff1, aff0,
multi_processor_system == 0 ? "multi core" : "single core");
else
LOG_INFO("%s cluster %" PRIu32 " core %" PRIu32 " %s",
target_name(armv8->arm.target),
aff1, aff0,
multi_processor_system == 0 ? "multi core" : "single core");
}
} else
LOG_ERROR("mpidr not in multiprocessor format");

View File

@@ -195,11 +195,6 @@ struct armv8_common {
const uint32_t *opcodes;
/* mdir */
uint8_t multi_processor_system;
uint8_t cluster_id;
uint8_t cpu_id;
/* armv8 aarch64 need below information for page translation */
uint8_t va_size;
uint8_t pa_size;

View File

@@ -1779,6 +1779,7 @@ static int cortex_m_assert_reset(struct target *target)
int retval2;
retval2 = mem_ap_write_atomic_u32(armv7m->debug_ap, DCB_DEMCR,
TRCENA | VC_HARDERR | VC_BUSERR | VC_CORERESET);
target->debug_reason = DBG_REASON_DBGRQ;
if (retval != ERROR_OK || retval2 != ERROR_OK)
LOG_TARGET_INFO(target, "AP write error, reset will not halt");
}

View File

@@ -51,8 +51,8 @@ proc release_cpu {cpu} {
}
# Release the cpu; it will start executing something bogus
mem2array regs 32 $RST_BRRL 1
mww $RST_BRRL [expr {$regs(0) | 1 << $cpu}]
set reg [read_memory $RST_BRRL 32 1]
mww $RST_BRRL [expr {$reg | 1 << $cpu}]
if {$not_halted} {
resume