Compare commits

...

15 Commits

Author SHA1 Message Date
Paul Fertser
646566e006 The openocd-0.10.0 release
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2017-01-22 23:31:28 +03:00
Paul Fertser
0e7bcf850b NEWS: last pre-release changes
Change-Id: I93203717f9096880298c10efebf05d59f888f34b
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/3954
Tested-by: jenkins
2017-01-22 13:22:51 +00:00
Matthias Welwarsky
59820c18d0 arm_dpm: avoid duplicating the register cache
This bug was already attempted to fix in an earlier patch but
merging the "defer-examine" feature caused a regression, which this patch
tries to fix again.

Change-Id: Ie1ad1516f0d7f130d44e003d6c29dcc1a02a82ca
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/3951
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2017-01-20 08:28:35 +00:00
Paul Fertser
1c4aa20b21 Restore -dev suffix
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2017-01-15 19:14:37 +03:00
Paul Fertser
9e74171775 The openocd-0.10.0-rc2 release candidate
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2017-01-15 19:12:48 +03:00
Paul Fertser
f6279c00c3 NEWS: mention SWO capture facility of the new J-Link driver
Change-Id: I4fc150584f3f0c5df5c39ae512125b42893331f0
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/3948
Tested-by: jenkins
2017-01-15 15:20:16 +00:00
Paul Fertser
af4a2f3518 jtag: core: report TRST and SRST as asserted only when they really are
When SRST is never enabled, the global jtag_srst variable is left at its
initial state, that is, -1, and it does _not_ mean SRST is currently
asserted. Same about TRST.

Fixes "reset halt" in cases when srst_pulls_trst but srst usage is not
enabled.

Change-Id: I8d2e9120479de4cfbf5561033926c9ef945eecc9
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/3943
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2017-01-15 11:02:14 +00:00
Tomas Vanek
93bc4ec40f flash/nor: fix doc/help and range test for flash protect
Commit 77a1c01ccb introduced infrastructure
for utilizing protection blocks of different size than erase sector.
Parts of doc/help kept reading 'sector' instead of 'protection block'.
flash_driver_protect() parameter range testing did not switched
to bank->num_prot_blocks.
This change fixes it.

Change-Id: Iec301761190a1a1bcc4cb005a519b9e5e4fede51
Reported-by: Mark Odell <mark@odell.ws>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3917
Tested-by: jenkins
Reviewed-by: Mark Odell <mrfirmware@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2017-01-15 11:01:36 +00:00
Tomas Vanek
390c9aca1f tcl at91samdXX.cfg: partially revert change 3722
Commit 25d7ba19c9 introduced a problem
with 'reset halt' due to setting srst_pulls_trst:

Error: cortex_m.c:595 cortex_m_halt(): can't request a halt while
  in reset if nSRST pulls nTRST

Sorry, I don't know why I overlooked it when I tested #3722.

Change-Id: I41e9473dd91a86d93cf3e78b1fbbdfe1dd188d83
Reported-by: Ladislav Laska <laska@kam.mff.cuni.cz>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3942
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2017-01-15 11:01:00 +00:00
Matthias Welwarsky
2934ac454e adi_v5_jtag: make sure SSTICKYERR is cleared after a POR
Don't terminate the transaction end-check early if debug power-loss
was detected, without clearing SSTICKYERR.

Change-Id: I83b6a4a20523eea42e48a15297f972a730aa21a8
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/3947
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2017-01-15 11:00:32 +00:00
Andreas Fritiofson
52a396656a doc: Improve ftdi driver section
Fix typo and a sentence that sounds strange since the ft2232 driver
was removed.

Add documentation for the SWD signal usage.

Remove the text mentioning a default VID:PID which doesn't exist.

Change-Id: I27eba571f2f7c46bdb6ae623ab285595018e99d9
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3935
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2017-01-15 10:38:51 +00:00
Andreas Fritiofson
7436f7c2c0 helper,rtos,server: Restore missing warning flags
These libraries override the used CFLAGS without adding the
defaults. This didn't have any effect until change
http://openocd.zylin.com/3870 (ef4c139). Restore by adding
AM_CLAGS to the per-target CFLAGS.

Interestingly, automake seems to clear the CFLAGS for the target
even if the override variable is only mentioned within a non-active
conditional branch, such as the IS_MINGW for the affected libraries.

Change-Id: I805206865e59e3fa33a7ea3c0d3472e51219351c
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3927
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2017-01-15 10:16:16 +00:00
Paul Fertser
7851207cf0 jtag: drivers: build usb_blaster only if enabled
Fix build failure when libusb dev files are not available and
so usb_blaster is disabled.

Change-Id: I4cda7df689cdb4b62b733cbbab813241cf561e29
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/3920
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2017-01-15 10:14:53 +00:00
Marc Schink
33db10a158 libjaylink: Update to 0.1.0 release
Change-Id: I5a905ccda346c09187f7f8e8229ae71d3353128f
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/3946
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2017-01-15 10:10:48 +00:00
Paul Fertser
c404ff5d3a Restore -dev suffix
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2016-12-25 18:15:24 +03:00
14 changed files with 52 additions and 38 deletions

4
NEWS
View File

@@ -3,7 +3,7 @@ source archive release.
JTAG Layer:
* New driver for J-Link adapters based on libjaylink
(including support for FPGA configuration and EMUCOM)
(including support for FPGA configuration, SWO and EMUCOM)
* FTDI improvements to work at 30MHz clock
* BCM2835 native driver SWD and Raspberry Pi2 support
* BCM2835 is set to 4ma drive, slow slew rate
@@ -144,7 +144,7 @@ This release also contains a number of other important functional and
cosmetic bugfixes. For more details about what has changed since the
last release, see the git repository history:
http://sourceforge.net/p/openocd/code/ci/v0.10.0-rc1/log/?path=
http://sourceforge.net/p/openocd/code/ci/v0.10.0/log/?path=
For older NEWS, see the NEWS files associated with each release

View File

@@ -1,5 +1,5 @@
AC_PREREQ(2.64)
AC_INIT([openocd], [0.10.0-rc1],
AC_INIT([openocd], [0.10.0],
[OpenOCD Mailing List <openocd-devel@lists.sourceforge.net>])
AC_CONFIG_SRCDIR([src/openocd.c])

View File

@@ -2408,11 +2408,10 @@ This driver is for adapters using the MPSSE (Multi-Protocol Synchronous Serial
Engine) mode built into many FTDI chips, such as the FT2232, FT4232 and FT232H.
The driver is using libusb-1.0 in asynchronous mode to talk to the FTDI device,
bypassing intermediate libraries like libftdi of D2XX.
bypassing intermediate libraries like libftdi or D2XX.
A major improvement of this driver is that support for new FTDI based adapters
can be added competely through configuration files, without the need to patch
and rebuild OpenOCD.
Support for new FTDI based adapters can be added competely through
configuration files, without the need to patch and rebuild OpenOCD.
The driver uses a signal abstraction to enable Tcl configuration files to
define outputs for one or several FTDI GPIO. These outputs can then be
@@ -2421,6 +2420,12 @@ are reserved for nTRST, nSRST and LED (for blink) so that they, if defined,
will be used for their customary purpose. Inputs can be read using the
@command{ftdi_get_signal} command.
To support SWD, a signal named SWD_EN must be defined. It is set to 1 when the
SWD protocol is selected. When set, the adapter should route the SWDIO pin to
the data input. An SWDIO_OE signal, if defined, will be set to 1 or 0 as
required by the protocol, to tell the adapter to drive the data output onto
the SWDIO pin or keep the SWDIO pin Hi-Z, respectively.
Depending on the type of buffer attached to the FTDI GPIO, the outputs have to
be controlled differently. In order to support tristateable signals such as
nSRST, both a data GPIO and an output-enable GPIO can be specified for each
@@ -2439,9 +2444,8 @@ These interfaces have several commands, used to configure the driver
before initializing the JTAG scan chain:
@deffn {Config Command} {ftdi_vid_pid} [vid pid]+
The vendor ID and product ID of the adapter. If not specified, the FTDI
default values are used.
Currently, up to eight [@var{vid}, @var{pid}] pairs may be given, e.g.
The vendor ID and product ID of the adapter. Up to eight
[@var{vid}, @var{pid}] pairs may be given, e.g.
@example
ftdi_vid_pid 0x0403 0xcff8 0x15ba 0x0003
@end example
@@ -4710,12 +4714,15 @@ and possibly stale information.
@anchor{flashprotect}
@deffn Command {flash protect} num first last (@option{on}|@option{off})
Enable (@option{on}) or disable (@option{off}) protection of flash sectors
in flash bank @var{num}, starting at sector @var{first}
Enable (@option{on}) or disable (@option{off}) protection of flash blocks
in flash bank @var{num}, starting at protection block @var{first}
and continuing up to and including @var{last}.
Providing a @var{last} sector of @option{last}
Providing a @var{last} block of @option{last}
specifies "to the end of the flash bank".
The @var{num} parameter is a value shown by @command{flash banks}.
The protection block is usually identical to a flash sector.
Some devices may utilize a protection block distinct from flash sector.
See @command{flash info} for a list of protection blocks.
@end deffn
@deffn Command {flash padded_value} num value

View File

@@ -50,10 +50,17 @@ int flash_driver_erase(struct flash_bank *bank, int first, int last)
int flash_driver_protect(struct flash_bank *bank, int set, int first, int last)
{
int retval;
int num_blocks;
if (bank->num_prot_blocks)
num_blocks = bank->num_prot_blocks;
else
num_blocks = bank->num_sectors;
/* callers may not supply illegal parameters ... */
if (first < 0 || first > last || last >= bank->num_sectors) {
LOG_ERROR("illegal sector range");
if (first < 0 || first > last || last >= num_blocks) {
LOG_ERROR("illegal protection block range");
return ERROR_FAIL;
}
@@ -69,11 +76,11 @@ int flash_driver_protect(struct flash_bank *bank, int set, int first, int last)
* the target could have reset, power cycled, been hot plugged,
* the application could have run, etc.
*
* Drivers only receive valid sector range.
* Drivers only receive valid protection block range.
*/
retval = bank->driver->protect(bank, set, first, last);
if (retval != ERROR_OK)
LOG_ERROR("failed setting protection for areas %d to %d", first, last);
LOG_ERROR("failed setting protection for blocks %d to %d", first, last);
return retval;
}

View File

@@ -936,10 +936,11 @@ static const struct command_registration flash_exec_command_handlers[] = {
.name = "protect",
.handler = handle_flash_protect_command,
.mode = COMMAND_EXEC,
.usage = "bank_id first_sector [last_sector|'last'] "
.usage = "bank_id first_block [last_block|'last'] "
"('on'|'off')",
.help = "Turn protection on or off for a range of sectors "
"in a given flash bank.",
.help = "Turn protection on or off for a range of protection "
"blocks or sectors in a given flash bank. "
"See 'flash info' output for a list of blocks.",
},
{
.name = "padded_value",

View File

@@ -37,7 +37,7 @@ else
%C%_libhelper_la_SOURCES += %D%/ioutil_stubs.c
endif
%C%_libhelper_la_CFLAGS =
%C%_libhelper_la_CFLAGS = $(AM_CFLAGS)
if IS_MINGW
# FD_* macros are sloppy with their signs on MinGW32 platform
%C%_libhelper_la_CFLAGS += -Wno-sign-compare

View File

@@ -1717,11 +1717,11 @@ void jtag_set_reset_config(enum reset_types type)
int jtag_get_trst(void)
{
return jtag_trst;
return jtag_trst == 1;
}
int jtag_get_srst(void)
{
return jtag_srst;
return jtag_srst == 1;
}
void jtag_set_nsrst_delay(unsigned delay)

View File

@@ -78,6 +78,7 @@ DRIVERFILES += %D%/jtag_vpi.c
endif
if USB_BLASTER_DRIVER
%C%_libocdjtagdrivers_la_LIBADD += %D%/usb_blaster/libocdusbblaster.la
include %D%/usb_blaster/Makefile.am
endif
if AMTJTAGACCEL
DRIVERFILES += %D%/amt_jtagaccel.c
@@ -171,4 +172,3 @@ DRIVERHEADERS = \
%D%/versaloon/versaloon_include.h \
%D%/versaloon/versaloon_internal.h
include %D%/usb_blaster/Makefile.am

View File

@@ -24,7 +24,7 @@ noinst_LTLIBRARIES += %D%/librtos.la
%D%/rtos_mqx_stackings.h \
%D%/rtos_ucos_iii_stackings.h
%C%_librtos_la_CFLAGS =
%C%_librtos_la_CFLAGS = $(AM_CFLAGS)
if IS_MINGW
# FD_* macros are sloppy with their signs on MinGW32 platform

View File

@@ -10,7 +10,7 @@ noinst_LTLIBRARIES += %D%/libserver.la
%D%/tcl_server.c \
%D%/tcl_server.h
%C%_libserver_la_CFLAGS =
%C%_libserver_la_CFLAGS = $(AM_CFLAGS)
if IS_MINGW
# FD_* macros are sloppy with their signs on MinGW32 platform
%C%_libserver_la_CFLAGS += -Wno-sign-compare

View File

@@ -574,8 +574,6 @@ static int jtagdp_transaction_endcheck(struct adiv5_dap *dap)
if ((ctrlstat & (CDBGPWRUPREQ | CDBGPWRUPACK | CSYSPWRUPREQ | CSYSPWRUPACK)) !=
(CDBGPWRUPREQ | CDBGPWRUPACK | CSYSPWRUPREQ | CSYSPWRUPACK)) {
LOG_ERROR("Debug regions are unpowered, an unexpected reset might have happened");
retval = ERROR_JTAG_DEVICE_ERROR;
goto done;
}
if (ctrlstat & SSTICKYERR)
@@ -590,10 +588,7 @@ static int jtagdp_transaction_endcheck(struct adiv5_dap *dap)
if (retval != ERROR_OK)
goto done;
if (ctrlstat & SSTICKYERR) {
retval = ERROR_JTAG_DEVICE_ERROR;
goto done;
}
retval = ERROR_JTAG_DEVICE_ERROR;
}
done:

View File

@@ -972,11 +972,14 @@ int arm_dpm_setup(struct arm_dpm *dpm)
arm->read_core_reg = arm_dpm_read_core_reg;
arm->write_core_reg = arm_dpm_write_core_reg;
cache = arm_build_reg_cache(target, arm);
if (!cache)
return ERROR_FAIL;
/* avoid duplicating the register cache */
if (arm->core_cache == NULL) {
cache = arm_build_reg_cache(target, arm);
if (!cache)
return ERROR_FAIL;
*register_get_last_cache_p(&target->reg_cache) = cache;
*register_get_last_cache_p(&target->reg_cache) = cache;
}
/* coprocessor access setup */
arm->mrc = dpm_mrc;

View File

@@ -50,7 +50,8 @@ $_TARGETNAME configure -event reset-deassert-post {
}
# SRST (wired to RESET_N) resets debug circuitry
reset_config srst_gates_jtag srst_pulls_trst
# srst_pulls_trst is not configured here to avoid an error raised in reset halt
reset_config srst_gates_jtag
# Do not use a reset button with other SWD adapter than Atmel's EDBG.
# DSU usually locks MCU in reset state until you issue a reset command