Commit Graph

3838 Commits

Author SHA1 Message Date
Øyvind Harboe 559d08c19e jim tests: use installed
Delete obsolete jim that comes with OpenOCD.
2010-10-29 15:10:51 +02:00
Spencer Oliver 4617cd0f91 src: add loader src description
- add comment where to find the various loaders src files.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-10-28 10:08:16 +01:00
Øyvind Harboe 2ff1adfa79 help: help now works on configuration commands
help would not show help for commands when the command
interpreter was in the wrong mode, which means that
e.g. "help newtap" didn't work, it wouldn't show the
"jtag newtap" help as it was a configuration command.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-10-27 08:50:45 +02:00
Peter Stuge f176278e98 Make systesetreq typos read sysresetreq instead
Signed-off-by: Peter Stuge <peter@stuge.se>
2010-10-25 08:05:23 +02:00
Michal Demin 1ceb2c7e7a buspirate: change handling of communication speed setting + create serial port open function
Signed-off-by: Michal Demin <michaldemin@gmail.com>
2010-10-25 08:01:44 +02:00
Michal Demin d4de14dafe buspirate: Serial port was not correctly closed.
Signed-off-by: Michal Demin <michaldemin@gmail.com>
2010-10-25 08:01:44 +02:00
Antonio Borneo ed44447e3d TARGET: review handle_load_image_command()
Collect variable definitions.
Report syntax error to command dispatcher.
Propagate error when unable to open file.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-10-12 11:22:32 +02:00
Antonio Borneo 2ee47b22c6 TARGET: fix segfault in handle_dump_image_command()
The struct fileio is used after fileio_close().
Move fileio_close() after last usage.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-10-12 11:22:26 +02:00
David Brownell 3864da1ab8 add JLINK protocol doc ref
Provide URL for a recent
version of JLINK protocol.
Signed-Off-By: David Brownell <dbrownell@users.sourceforge.net>
2010-10-10 14:27:35 -07:00
Spencer Oliver 6229e438dd build: remove warn_unused_result errors
Remove any build errors for strtol when building release
version of openocd.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-10-05 16:29:37 +01:00
Spencer Oliver ebe431879d gdbderver: fix gdb pipe startup overflow
When usng gdb pipes we need to keep openocd output at a minimum,
otherwise the gdb stdin will overflow and fail.
Make the calls to gdb_port and log_output synchronous to stop this.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-10-05 15:00:40 +01:00
Spencer Oliver 7e4cf8db58 gdbserver: fix gdb_port memory leak
Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-10-04 20:35:33 +01:00
Spencer Oliver 45de3b1fbe server: fix server pipe windows support
commit 50d5441e2a caused
native windows build to fail.

Firstly this patch fixes the build issue, but it also disables support
for named pipes under Windows. Windows does not support posix named
pipes.
A cross-platfom access layer will need creating before support can be
enabled again.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-10-04 20:34:47 +01:00
Øyvind Harboe d543aa0148 zy1000: add : port number syntax for tftp filing system
Allows using non-standard port number. Default to port 69.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-10-01 14:18:15 +02:00
Øyvind Harboe 96a56ba086 pipes: add documentation for pipes
Stick with the name "gdb_port" even if this command
can be used for other things(disable, named pipes,
anonymous stdin/out pipe). "port" is correct for
probably more than 90% of use cases, if not more.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-10-01 10:26:10 +02:00
Øyvind Harboe 50d5441e2a server: add support for pipes
-p/--pipe is now deprecated. Use '-c "gdb_port pipe;log_output openocd.log"'
instead. Warning logged.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-10-01 10:26:08 +02:00
Øyvind Harboe 6c137a2fc0 server: specify port as a string
This will allow switching to using named pipes.

Split this out as a seperate commit to make changes
easier to follow.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-10-01 10:21:33 +02:00
Øyvind Harboe cb2dba2c12 server: read/write now goes through connection fn's
depending on whether the connection is over a socket
or pipe, the read is done differently.

pipes can return -1 when writing 0 bytes, make 0 byte
writes a successful no-op. 0 byte writes falls out
naturally of tcl server code.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-10-01 10:21:33 +02:00
Øyvind Harboe 5a41435e45 server: split file descriptors in in/out fd's
pipes have different fd's for in/out. This makes the
code more orthogonal and prepares for adding pipes.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-10-01 10:21:33 +02:00
Øyvind Harboe a60a57d8ed server: rely on ctrl-c to stop openocd
there was special support to support pressing 'x' to quit
openocd. ctrl-c is sufficient. The main server loop is already
complicated enough.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-10-01 10:21:33 +02:00
Øyvind Harboe d623832685 log: remove hack to redirect logs when pipes are in use
There is an explicit command "log_output" that can
be used to redirect log output to a file, no need
for a hack in the first place.

Before enabling pipes, use "log_output foo" to redirect
log output to the "foo" files.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-10-01 10:21:33 +02:00
Luca Bruno fb7235f12a Update ep93xx and at91rm9200 drivers
ep93xx and at91rm9200 are conditionally built only on arm and were not
updated to reflect changes in command registration handler.
This patch makes them properly compile again, fixing a build failure
experienced on Debian armel.

Signed-off-by: Luca Bruno <lucab@debian.org>
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
2010-09-30 18:14:36 -07:00
Øyvind Harboe 3931b99d14 fileio: fileio_size() can now fail
Part of making the fileio API more robust.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-29 18:56:07 +02:00
Øyvind Harboe 3a693ef526 fileio: refactor struct fileio to be an opaque structure
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-29 08:43:27 +02:00
Øyvind Harboe 45e5d1d90a flash: fix error handling
memory leaks and missing check on memory allocation.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-27 16:46:13 +02:00
Øyvind Harboe 19167a7af6 image: fix spelling mistake
struct imageection => struct imagesection

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-27 16:29:51 +02:00
Øyvind Harboe 6468c593c7 zy1000: fix non-JTAG master build
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-26 20:38:29 +02:00
Øyvind Harboe 9f26aff39c gdb: fix blank line at top
snuck in at some point...

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-26 18:02:23 +02:00
Øyvind Harboe cb0de21d0c jtagdp: remove #if 0'd kludges and explain why the code is correct
short story: if the JTAG clock is too high, then the
behavior will be flaky and kludging the code may
seem to make things beter, but really it's just a red
herring.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-21 22:17:38 +02:00
Øyvind Harboe 22911a3aed flash: fix error handling
sensible error must be reported at failure site

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-21 22:17:38 +02:00
Øyvind Harboe 9aafd42853 embeddedice: fix error handling
error is now reported at failure site.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-21 22:17:38 +02:00
Øyvind Harboe ea48794210 startup: removed capture_catch
not used.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-20 20:45:48 +02:00
Øyvind Harboe 1abc26d7a2 helper: fix flaky capture command
capture of progress output would get polling
results. This will break in the example below
where polling output would override the tcl
return value.

capture {sleep 10000; set abc def}

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-20 20:45:48 +02:00
Øyvind Harboe 6000411ddd tcl_server: switch to ctrl-z
by using ctrl-z instead of line end, multi-line tcl scripts
can be handled.

Testing: send ctrl-z a couple of times to make telnet enter the
mode where it sends ctrl-z unencoded.

Programs that talk to the tcl_server can send ctrl-z to
indicate end of tcl-let to be executed without having
to worry about telnet protocols.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-20 20:45:48 +02:00
Øyvind Harboe 241fd0b5a8 logging: turn of stdout/stderr buffering
with this buffering disabled fancier logging scripts will
be able to process each line as it is output.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-20 20:45:48 +02:00
Øyvind Harboe 61780558e1 zy1000: add support for Linux host
used /dev/mem and mmem() to memory map JTAG registers
into user space and used new configure options to exclude
eCos specific code.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-20 20:45:16 +02:00
Øyvind Harboe 549d974814 jtag: build jtag first because it generates header files
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-20 13:44:36 +02:00
Øyvind Harboe f6a3fc818b warnings: fix alignment warnings
These warnings are for architectures that do not
support non-aligned word access.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-20 13:12:35 +02:00
Øyvind Harboe 1dbb7ba472 zy1000: remove obsolete debug code
Obsolete code clutter

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-20 13:08:16 +02:00
Mike Dunn ebfb2f4f37 xscale: check that wp length does not exceed address
Hi everyone,

A while back I sent in a patch that adds support for watchpoint lengths greater
than four on xscale.  It's been working well, until the other day, when it
caused an unexpected debug exception.  Looking into this I realized there is a
case where it breaks: when the length arg is greater than the base address.
This is a consequence of the way the hardware works.  Don't see a work-around,
so I added code to xscale_add_watchpoint() to check for and disallow this
combination.

Some more detail... xscale watchpoint hardware does not support a length
directly.  Instead, a mask value can be specified (not to be confused with the
optional mask arg to the wp command, which xscale does not support).  Any bits
set in the mask are ignored when the watchpoint hardware compares the access
address to the watchpoint address.  So as long as the length is a power of two,
setting the mask to length-1 effectively specifies the length.  Or so I thought,
until I realized that if the length exceeds the base address, *all* bits of the
base address are ignored by the comaparator, and the watchpoint range
effectively becomes 0 .. length.

Questions, comments, criticisms gratefully received.

Thanks,
Mike

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
2010-09-20 09:21:12 +02:00
Mike Dunn 7e888741d1 xscale: bp/wp: additional LOG_ERROR on failure
Hi everyone,

Added more LOG_ERROR messsages to watchpoint and breakpoint code, given that the
infrastructure no longer interprets returned error codes.  Also changed
existing LOG_INFO and LOG_WARNING to LOG_ERROR for cases where an error is
returned.

Note that the check of the target state is superflous, since the infrastruture
code currently checks this before calling target code.  Is this being
reconsidered as well?  Also, should we stop returning anything other than
ERROR_OK and ERROR_FAIL?

Comments gratefully received.

Thanks,
Mike

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
2010-09-20 09:21:12 +02:00
Flemming Futtrup c14852385f cfi: add sst39vf6401b
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-15 11:35:29 +02:00
Øyvind Harboe 4a47d87e47 breakpoints: fix error handling
do not try to interpret "retval" into a string, just
amend a bit about the context of the already reported
error.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-14 16:25:48 +02:00
Mike Dunn 35691065f7 xscale: fix sw breakpoints for thumb; set bp immediately
Hi everyone,

Version 2 of this patch.  Code added to breakpoints.c was removed from previous
patch, and item 3 added, per discussion with Øyvind regarding error reporting.
Item 4 added, which I just noticed.

I tried to use a software breakpoint in thumb code on the xscale for the first
time recently, and was surprised to find that it didn't work.  The result was
this patch, which does four things:

1): fix trivial cut-n-paste error that caused thumb breakpoints to not work
2): call xscale_set_breakpoint() from xscale_add_breakpoint()
3): log error on data abort in xscale_write_memory()
4): fixed incorrect error code returned by xscale_set_breakpoint() when no
    breakpoint register is available; added comment

Item 2 not only makes the xscale breakpoint code consistent with other targets,
but also alerts the user immediately if an error occurs when writing the
breakpoint instruction to target memory (previously, xscale_set_breakpoint() was
not called until execution resumed).  Also, calling xscale_breakpoint_set() as
part of the call chain starting with handle_bp_command() and propagating the
return status back up the chain avoids the situation where OpenOCD "thinks" the
breakpoint is set when in reality an error ocurred.

Item 3 provides a helpful message for a common reason for failure to set sw
breakpoint.

This was thoroughly tested, mindful of the fact that breakpoint management is
somewhat dicey during single-stepping.

Comments and criticisms of course gratefully received.

Mike

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-13 21:52:43 +02:00
Mike Dunn 81e0d4438e propagate return status of set_breakpoint() up call chain
Hi everyone,

I figured since I was poking around in the breakpoint code on other arches, I'd
add this change to those arches that don't do it already.  This patch propagates
the return code of <arch>_set_breakpoint() up the call stack.  This ensures that
the higher layer breakpoint infrastructure is aware that an error ocurred, in
which case the breakpoint is not recorded.

Normally I wouldn't touch code that I can't test, but the code is very
uniform across architectures, and the change is rather benign, so I figured
after careful inspection that it is safe.  If the maintainers or others think
this is imprudent, the patch can be dropped.

Also changed the error code to something more appropriate in two cases where
hardware resources are unavailable.

Comments and criticisms of course gratefully received.

Mike

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-13 19:45:42 +02:00
Øyvind Harboe 8afd2309a4 helper: add stacktrace command that returns error stacktrace
Ability to access the stacktrace from a script is quite
handy.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-12 20:18:43 +02:00
Øyvind Harboe 73e5dffdfd jim: fix crash when using Jim_ListInsertElements
Jim_ListInsertElements was simply forgotten from the
fn that registered all the APIs.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-12 20:18:43 +02:00
Øyvind Harboe 505d4633cd version command: make it scriptable
you can now set a variable in a script like set version [version].

Also version takes an optional argument "git" to show git version
of source. If git is not installed during the build, then this
will yield an error that is ignored during the build and "version git"
returns an empty string.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-11 11:42:44 +02:00
Øyvind Harboe ac86f4ccba command: capture command now handles both types commands
Commands that output progress output and no return value
will have the progress output captured.

Commands that do not output progress output(tcl commands)
will return the tcl return value instead.

The advantage here is that it is no longer necessary to
consider which command one is capturing, it works for
either.

Example #1: capture progress output:

set foo [capture help]

Example #2: capture tcl return value

set foo [capture {set abc def}]

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-11 11:42:38 +02:00
Øyvind Harboe 8c21659d2a cfi: random crash in cfi_probe() fixed
for non_cfi cfi chips free() was invoked on rodata.

The mystery is why this bug has survived for so long.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-11 10:37:32 +02:00