David Brownell [Sun, 21 Feb 2010 04:47:38 +0000 (20:47 -0800)]
arm920t line length cleanup
The recent patch to fixbreakpoints and dcache handling added
a bunch of overlong lines (80+ chars) ... shrink them, and do
the same to a few lines which were already overlong.
Also add a few FIXME comments to nudge (a) replacement of some
magic numbers with opcode macros, which will be much better at
showing what's actually going on, and (b) correct return codes.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Øyvind Harboe [Fri, 12 Feb 2010 07:39:56 +0000 (08:39 +0100)]
arm720t: virt2phys callback added
This is a copy and paste of arm926ejs. Not tested, but
ready for testing at least. There is a good chance that
it will work if the generic armv4_5 fn's are robust enough...
Øyvind Harboe [Wed, 10 Feb 2010 19:04:00 +0000 (20:04 +0100)]
arm11: fix another infinite loop bug
reset init would get stuck in an infinite loop when
e.g. khz was too high. Added timeout. This is a copy
of paste of a number of such bugfixes in the arm11
code.
Arm11 code reviewed for further such infinite loop bugs
and I couldn't find any more. Xing fingers it's the last
one...
David Brownell [Sun, 7 Feb 2010 03:19:25 +0000 (19:19 -0800)]
Re-title Developer's Guide
The Doxygen output was previously titled "OpenOCD Reference Manual",
which was quite misleading ... the User's Guide is the reference
manual which folk should consult about how to use the software.
Just rename it to match how it's been discussed previously, and to
bring out its intended audience: developers of this software. As a
rule, Doxygen is only for folk who work with the code it documents.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Thu, 4 Feb 2010 22:39:51 +0000 (14:39 -0800)]
ARMv7-M: make DAP commands verify target is an ARMv7-M
Init the ARMv7-M magic number. Define predicate verifying it.
Use it to resolve a lurking bug/FIXME: make sure the ARMv7-M
specific DAP ops reject non-ARMv7-M targets.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Spencer Oliver [Thu, 4 Feb 2010 10:33:33 +0000 (10:33 +0000)]
CMD: duplicate cmd error msg
When registering cmds we report duplicate attempts to register a cmd
as a LOG_ERROR.
Some situations need this, such as when registering dual flash banks.
http://www.mail-archive.com/openocd-development@lists.berlios.de/msg11152.html
Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
David Brownell [Tue, 2 Feb 2010 18:53:13 +0000 (10:53 -0800)]
NOR: User's Guide updates
Remove long-obsolete text about "erase_check" affecting "flash info" output.
Move parts of that text to "protect_check", where it's still relevant; and
update the "flash info" description to mention the issue.
(This is still awkward. It might be best to make "protect_check" mirror
"erase_check" by dumping what it finds, so "flash info" doesn't dump any
potentially-stale cache info.)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Edgar Grimberg [Tue, 2 Feb 2010 12:17:26 +0000 (13:17 +0100)]
tcl/str7x: Reset init unlocks the flash
For STR7x flash, the device cannot be queried for the protect status.
The solution is to remove the protection on reset init. The driver
also initialises the sector protect field to unprotected.
[dbrownell@users.sourceforge.net: line length shrinkage]
Signed-off-by: Edgar Grimberg <edgar.grimberg@zylin.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Edgar Grimberg [Tue, 2 Feb 2010 09:39:52 +0000 (10:39 +0100)]
flash/str7x: After reset init the flash is unlocked
The default state of the STR7 flash after a reset init is unlocked.
The information in the flash driver now reflects this.
The information about the lock status cannot be read from the
flash chip, so the user is informed that flash info might not
contain accurate information.
[dbrownell@users.sourceforge.net: line length shrinkage]
Signed-off-by: Edgar Grimberg <edgar.grimberg@zylin.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Nicolas Pitre [Tue, 2 Feb 2010 05:05:42 +0000 (00:05 -0500)]
ARM semihosting: fix EOF handling with SYS_READ
The semihosting interface has a strange convention for read/write where
the unused amount of buffer must be returned. We failed to return the
total buffer size when the local read() call returned 0.
Øyvind Harboe [Thu, 21 Jan 2010 15:41:54 +0000 (16:41 +0100)]
telnet: fix strage blank spaces at beginning of telnet lines
Sometimes we saw two strange blank spaces at the beginning
of the telnet lines.
progress
ogress
>
This patch fixes this problem:
progress
progress
>
The code changes are *reasonably* clean, but perhaps it could be
made a bit more elegant, but I didn't want to change things after
I finished diagnosis/testing & submitting the patch.
The problem was that logging can send the text and the newline
separately in two different requests and the telnet code would
incorrectly remove the prompt from the end of a line.
David Brownell [Sun, 31 Jan 2010 08:26:21 +0000 (00:26 -0800)]
Subject: ADIv5: fix more diagnostics
If the MEM-AP cache is invalid, don't display it; just report that
invalidity as an error. (This bug has been observed with "mdw 0 32"
after just a "reset halt". Some code is being wrongly bypassed...)
If it's valid, display that cache at DEBUG level, not ERROR. Also,
don't assume it's an AHB-AP; it could be another flavor of MEM-AP.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Make messages reference "DAP" if they're actually transport-agnostic, or
"JTAG-DP" when they're JTAG-specific. Saying SWJ-DP is often wrong (on
most Cortex-A8 chips) and is confusing even if correct (since we don't
yet support SWD).
Rename a JTAG-specific routine to jtagdp_transaction_endcheck() to highlight
that it's JTAG-specific, and that identify DAP clients undesirably depending
on JTAG. (They will all need to change for SWD support.)
Shrink a few overlong lines of code. Copy a comment from code removed
in a previous patch (for the ARMv7-M "dap baseaddr" command).
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Alex Austin [Fri, 29 Jan 2010 06:41:44 +0000 (00:41 -0600)]
Clang buildfixes
Building with clang took a few very small changes. The change to
helper/log.h is because clang doesn't like an expression where the
result is unused. In helper/system.h, I just defined true and false
since clang doesn't have them builtin.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Thu, 28 Jan 2010 22:03:29 +0000 (14:03 -0800)]
doc clarifications for server flags
The "-f" is a shortcut for "-c" ... and providing any "-c" options
means the "openocd.cfg" file isn't implicitly used. Both the User's
Guide and the manual page were weak on these points, which has led
to some confusion.
Also update the manual page to include highlights of the search path
mechanism, including the facts that it exists and that "-s" adds to it.
Stop saying only the current directory is involved; the OpenOCD
script library is quite significant.
(Missing: complete manpage coverage of the search path, including a
FILES section listing all components and saying where the script
library is found.)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Thu, 28 Jan 2010 21:58:20 +0000 (13:58 -0800)]
ARM: reference DPM defn from v6/v7 arch spec
The term "DPM" is probably not well known ("Device Power Management"?),
so identify its source in the current ARM architecture specification.
It's relevant to ARMv6, ARMv7-A, and ARMv7-R ... but not "M" profiles.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Spencer Oliver [Wed, 27 Jan 2010 21:20:18 +0000 (21:20 +0000)]
ARM semihosting: fix writing to stdout
SYS_FLEN would be called before a write on a descriptor to check its size.
Currently lseek would fail with -1 when given the stdout/stderr descriptor.
Changing to use fstat seems to be the standard way of handling this.
Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
David Brownell [Wed, 27 Jan 2010 21:47:48 +0000 (13:47 -0800)]
Cortex-M3: report lockup, and recover
ARMv7-M defines a "lockup" state that's entered in certain double
fault sequences which can't be recovered from without external help.
OpenOCD has previously ignored this.
Issue a diagnostic saying the chip has locked up, and force exit
from this state by halting the core. It's not clear this is the
best way to handle lockup; but there should now be less confusion.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
simon qian [Sun, 17 Jan 2010 20:56:08 +0000 (04:56 +0800)]
SVF: insert space before '(' and after ')'
See http://forum.sparkfun.com/viewtopic.php?p=90983#90983 for discussion;
basically, the SVF parser wrongly expects "TDI (123)" but the space is
optional and it should accept "TDI(123)" too.
In the same way, "TDI(123)TDO(456)" should work too.
Rather than update the command parsing, this just makes sure the expected
spaces are present.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Sat, 23 Jan 2010 06:37:15 +0000 (22:37 -0800)]
ARM11: fix breakpoints with GDB
This fixes a bug whereby GDB's breakpoints weren't activated.
The root cause is a confused interface to resume(). Fix by
almost ignoring the "handle breakpoints" parameter; it only
seems related to the case of skipping breakpoint-at-PC.
Update a few coments to clarify what's happening.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Fri, 22 Jan 2010 00:45:00 +0000 (16:45 -0800)]
Various doc/comment updates
Doxygen: don't be needlessly verbose; alphabetically sort members
TODO: add random bits; clarify which manuals are referenced
ARM disassembler: mention a few opcodes that still aren't handled
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Fri, 22 Jan 2010 00:15:41 +0000 (16:15 -0800)]
User's Guide secton on target hardware setup
Highlight the needs to properly jumper development boards; to
make the OpenOCD configuration match the jumpering; and to have
a usable "reset-init" method when debugging early boot code.
Specific mention of the "ATX Mode" that seems useful on
many i.MX boards, forcing NAND boot.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Øyvind Harboe [Thu, 21 Jan 2010 09:16:42 +0000 (10:16 +0100)]
target: print reason why GDB halts
If GDB halts unexpectedly, print reason: srst assert or power
out detected.
If polling fails, then things are a bit trickier. We do not
want to spam telnet or the log with polling failed messages.
Leave that case be w/a comment in a code for now.
David Brownell [Wed, 20 Jan 2010 18:43:32 +0000 (10:43 -0800)]
gdb_server: correctly report flash sector sizes
Report each region of same-size sectors separately, instead of
incorrectly reporting that every sector has the same size.
This is a longstanding bug on NOR flash chips with non-uniform
sector sizes. It was largely hidden by other bugs in flash
handling. When some of those were recently fixed, this one was
exposed as a regression on str710.
[oyvind.harboe@zylin.com: update the loop to behave on str7 ]
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Wed, 20 Jan 2010 08:04:17 +0000 (00:04 -0800)]
User's guide: mention lpc2000 checksum issue
Folk almost certainly want to have OpenOCD compute the checksum
when they modify the vector table. However, that almost guarantees
that "verify_image" will fail.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
The default script search path on Windows is out of date with
the current layout (from installation and documentation), which
makes the standard script library not be found after a normal
./configure && make && make install
under msys/MinGW. The same should hold true for cygwin native builds
(not verified).
Update search path to ../share/openocd/scripts not ../lib/openocd,
relative to the openocd executable.
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Øyvind Harboe [Mon, 18 Jan 2010 20:54:58 +0000 (21:54 +0100)]
zy1000: flush jtag buffer before changing speed
It is conceivable that there could be commands in the
queue when a speed change request comes in. Flush the
hw queue before changing speed. Not observed, found by
inspection.
simon qian [Mon, 18 Jan 2010 07:37:15 +0000 (23:37 -0800)]
read target voltage first in vsllink
The very first command after init command should be "read target voltage".
This is a tweak for the Old Versaloon firmware. Without this, in most
most cases, it works. Under Ubuntu9.04, there is a chance that the USB
will fail. The problem disappears if I read target voltage first.
For the lastest Versaloon firmware, it's OK.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Fri, 15 Jan 2010 20:53:26 +0000 (12:53 -0800)]
ARM DPM: disable some nyet-ready breakpoint code
Until we manage breakpoints at runtime (patches not ready for 0.4)
the only way this code should touch them is to disable them at server
startup (a previous debug session may have left them active).
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Thu, 14 Jan 2010 20:45:58 +0000 (12:45 -0800)]
ARM7/ARM9: improved reset support
Teach most remaining ARM cores how to use the "reset-assert" event.
Same model as elsewhere: iff a handler is provided for that event,
use that instead of trying to assert SRST (which may be unavailable,
or inappropriate since it resets too much). Else no change.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Laurentiu Cocanu [Thu, 14 Jan 2010 12:59:36 +0000 (13:59 +0100)]
str9x.c: remove optimization when erasing the whole bank
Using the erase bank command will cause a time out error. Replacing
this with the erase sector bank will provide a slower but safer and
stable method to erase the flash.