Commit Graph

111 Commits

Author SHA1 Message Date
Zachary T Welch
d660721ba8 Improve etm command argument parsing. 2009-11-05 18:03:20 -08:00
David Brownell
344bed2f7e ETM: rename registers, doc tweaks
The register names are perversely not documented as zero-indexed,
so rename them to match that convention.  Also switch to lowercase
suffixes and infix numbering, matching ETB and EmbeddedICE usage.

Update docs to be a bit more accurate, especially regarding what
the "trigger" event can cause; and to split the issues into a few
more paragraphs, for clarity.

Make "configure" helptext point out that "oocd_trace" is prototype
hardware, not anything "real".

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-22 12:01:27 -07:00
David Brownell
a0b1e05b53 printf format warning fixes
Observed on a Cygwin build.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-10 11:32:39 -07:00
dbrownell
1033633321 Minor ETB and ETM bugfixes and doc updates
- ETB
    * report _actual_ hardware status, not just expected status
    * add a missing diagnostic on a potential ETB setup error
    * prefix any diagnostics with "ETB"
 - ETM
    * make "etm status" show ETM hardware status too, instead of
      just traceport status (which previously was fake, sigh)
 - Docs
    * flesh out "etm tracemode" docs a bit
    * clarify "etm status" ... previously it was traceport status
    * explain "etm trigger_percent" as a *traceport* option

ETM+ETB tracing still isn't behaving, but now I can see that part of 
the reason is that the ETB turns itself off almost immediately after
being enabled, and before collecting any data.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2790 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-10-02 09:19:03 +00:00
dbrownell
d96e3eae23 ETM: fix build issue on MinGW.
The Win32 global namespace is rather cluttered...


git-svn-id: svn://svn.berlios.de/openocd/trunk@2773 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-29 18:08:16 +00:00
dbrownell
22045fa6f2 When setting up an ETM, cache its ETM_CONFIG register. Then
only expose the registers which are actually present.  They
could be missing for two basic reasons:

 - This version might not support them at all; e.g. ETMv1.1
   doesn't have some control/status registers.  (My sample of
   ARM9 boards shows all with ETMv1.3 support, FWIW.)

 - The configuration on this chip may not populate as many
   registers as possible; e.g. only two data value comparators
   instead of eight.

Includes a bugfix in the "etm info" command:  only one of the
two registers is missing on older silicon, so show the first
one before bailing.

Update ETM usage docs to explain that those registers need to be
written to configure what is traced, and that some ETM configs
are not yet handled.  Also, give some examples of the kinds of
constrained trace which could be arranged.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2752 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-23 21:52:40 +00:00
dbrownell
d9ce8a2f60 Start cleaning up ETM register handling. On one ARM926 ETM+ETB
system, removes 20 non-existent registers ... but still includes
over 45 (!) ETM registers which don't even exist there ...

 - Integrate the various tables to get one struct per register
 - Get rid of needless per-register dynamic allocation
 - Double check list of registers:
    * Remove sixteen (!) non-registers for data comparators
    * Remove four registers that imply newer ETM than we support
    * Change some names to match current architecture specs
 - Handle more register info
    * some are write-only
    * some are read-only
    * record which versions have them, just in case
 - Reorganize the registers to facilitate removing the extras
    * group e.g. comparator/counter #N registers together
    * add and use lookup-by-ID


git-svn-id: svn://svn.berlios.de/openocd/trunk@2751 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-23 09:16:00 +00:00
dbrownell
a6d858ebcd Initial ETM cleanups. Most of these are cosmetic:
- Add a header comment
 - Line up the ETM context struct, pack it a bit
 - Remove unused context_id (this doesn't support ETMv2 yet)
 - Make most functions static
 - Remove unused string table and other needless lines of code
 - Correct "tracemode" helptext

Also provide and use an etm_reg_lookup() to find entries in the ETM
register cache.  This will help cope with corrected contents of that
cache, which doesn't include entires for non-existent registers.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2750 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-23 07:49:38 +00:00
oharboe
bf5f21e39a Steve Grubb <sgrubb@redhat.com> fix various and sundry leaks
git-svn-id: svn://svn.berlios.de/openocd/trunk@2606 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-24 07:53:46 +00:00
zwelch
fb1a9b2cb2 - Fixes '[|]' whitespace
- Replace ')\([|]\)(' with ') \1 ('.
- Replace ')\([|]\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\([|]\)(' with '\1 \2 ('.
- Replace '\(\w\)\([|]\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2374 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:45:15 +00:00
zwelch
84df52f9ea - Fixes '=' whitespace
- Replace ')\(=\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\(=\)(' with '\1 \2 ('.
- Replace '\(\w\)\(=\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2372 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:42:54 +00:00
zwelch
53d605e12c - Fixes '!=' whitespace
- Replace ')\(!=\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\(!=\)(' with '\1 \2 ('.
- Replace '\(\w\)\(!=\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2363 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:38:12 +00:00
duane
b6fe525580 C99 printf() -Werror fixes
git-svn-id: svn://svn.berlios.de/openocd/trunk@2316 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-21 03:16:29 +00:00
zwelch
3c2eabd20f Transform 'u32' to 'uint32_t' in src/target
- Replace '\([^_]\)u32' with '\1uint32_t'.
- Replace '^u32' with 'uint32_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2279 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:09:35 +00:00
zwelch
86173cdbdd Transform 'u8' to 'uint8_t' in src/target
- Replace '\([^_]\)u8' with '\1uint8_t'.
- Replace '^u8' with 'uint8_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2274 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:04:08 +00:00
oharboe
d861002612 Rename jtag_add_end_state to jtag_set_end_state since "add" implies that
this fn has something to do with the queue, which it does not as such.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2050 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 13:18:07 +00:00
oharboe
f133158175 Introduce jtag_get_end_state() fn to clarify code a bit.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2049 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 13:14:07 +00:00
oharboe
6468859389 remove TAP_INVALID as argument to jtag_add_xxx() fn's
git-svn-id: svn://svn.berlios.de/openocd/trunk@2042 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 11:33:36 +00:00
zwelch
91d55c0e50 David Brownell <david-b@pacbell.net>:
Provide basic documentation on the ARM ETM and ETB trace commands.

Fix minor goofs in registration of the ETM commands; and whitespace
issues in the proof-of-concept oocd_trace code.  (Plus include a
ref to Dominic's email saying that it's just proof-of-concept code.)

Note that I'm still not sure whether the ETM support works.  But
documenting how it's expected to work should help sort out which
behaviors are bugs, which will help get bugs patched.

ZW: whitespace changes were split out of this patch but will follow.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1945 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-30 01:43:21 +00:00
zwelch
570631454d David Brownell <david-b@pacbell.net>: This patch adds annotations to
the key command_*() helper functions, fixng the bugs that turned up.

Several of these bugs were from misuse of PRIi64; that's for 64-bit
integers, NOT for "long long" or "u64" (which work best with %lld).


git-svn-id: svn://svn.berlios.de/openocd/trunk@1873 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-21 09:28:57 +00:00
kc8apf
c977616cda Consolidate target selection code into single get_target() that handles both names and numbers. Provided by David Brownell <david-b@pacbell.net>
git-svn-id: svn://svn.berlios.de/openocd/trunk@1804 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-18 04:44:28 +00:00
oharboe
f17bb0cf1e fix jtag_add_dr_scan() usage a bit... avoid lots of malloc()'s.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1746 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 12:03:40 +00:00
oharboe
6e1b0ba9ac switch to jtag_add_dr_scan_check() - USB performance fix
git-svn-id: svn://svn.berlios.de/openocd/trunk@1739 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 09:14:47 +00:00
zwelch
56504fdd73 Audit and eliminate redundant #include directives in other target files.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1715 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 04:56:37 +00:00
oharboe
00fd07336e whitespace fixes
git-svn-id: svn://svn.berlios.de/openocd/trunk@1684 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-08 21:03:28 +00:00
oharboe
57bc9f37c9 in_handler in_check_mask and in_check_value now removed from field. Last big patch in the series of JTAG API cleanup.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1672 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-08 09:48:00 +00:00
oharboe
8173e02272 retire jtag_set_check_value
git-svn-id: svn://svn.berlios.de/openocd/trunk@1666 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-08 07:14:23 +00:00
oharboe
e86dee3200 remove unecessary setting of deprecated fields to NULL
git-svn-id: svn://svn.berlios.de/openocd/trunk@1611 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-06 07:21:46 +00:00
oharboe
4d88c124b1 retire out_mask - not used anywhere
git-svn-id: svn://svn.berlios.de/openocd/trunk@1608 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-06 06:20:52 +00:00
oharboe
03fdabaaac Mariano Alvira <mar@devl.org> fixes warnings
git-svn-id: svn://svn.berlios.de/openocd/trunk@1601 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-04 11:06:21 +00:00
zwelch
8c1ec4f0e1 Add static keywords to core target source file data and functions.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1579 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-30 09:49:38 +00:00
zwelch
1de959ca1c Remove redundant declarations to allow building with -Wredundant-decls.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1560 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-29 01:43:01 +00:00
oharboe
40580e2d71 Zach Welch <zw@superlucidity.net> fix -Werror warnings
git-svn-id: svn://svn.berlios.de/openocd/trunk@1472 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-19 20:51:16 +00:00
mifi
0bba832713 The following patches was applied:
- openocd-flash-static-keyword-v3.patch
- openocd-lpc2000-fix-erase-obo.patch
- openocd-jlink-fix-sign-ptr-warn.patch
- openocd-wextra-etm.patch
- openocd-wextra-jtag.patch
- openocd-add-new-tap-symbols-v6.patch

Many thanks to  Zach Welch <zw(at)superlucidity.net>

git-svn-id: svn://svn.berlios.de/openocd/trunk@1462 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-18 10:08:13 +00:00
kc8apf
c45de8073d Change tap_state naming to be consistent with SVF documentation.
Courtesy of Dick Hollenbeck <dick@softplc.com>


git-svn-id: svn://svn.berlios.de/openocd/trunk@1232 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-13 06:25:50 +00:00
duane
a28eaa85f7 jtag newtap change & huge manual update
git-svn-id: svn://svn.berlios.de/openocd/trunk@1194 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-30 22:25:43 +00:00
oharboe
ccc2e3fe76 Laurentiu Cocanu - memory read/write and exit() error path fixes
git-svn-id: svn://svn.berlios.de/openocd/trunk@1064 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-15 11:44:36 +00:00
oharboe
c40d652546 fixed a few crashes in syntax handling
git-svn-id: svn://svn.berlios.de/openocd/trunk@1060 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-14 13:35:38 +00:00
oharboe
0485363c45 Edgar Grimberg fixes some memory handling issues and
a problem with arm7_9_debug_entry not executing a code path upon crashes.

git-svn-id: svn://svn.berlios.de/openocd/trunk@669 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-05-20 10:10:54 +00:00
oharboe
d9f50cb7d6 - Set up ICE registers after TRST
- Work in progress to allow launching GDB/telnet server *before* jtag
chain enum, validate & examine


git-svn-id: svn://svn.berlios.de/openocd/trunk@569 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-13 10:09:27 +00:00
ntfreak
d47e1b8f36 - rename log functions to stop conflicts under win32 (wingdi)
git-svn-id: svn://svn.berlios.de/openocd/trunk@523 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-25 15:45:17 +00:00
oharboe
d3f3f61498 Michael Bruck: fixed warnings
git-svn-id: svn://svn.berlios.de/openocd/trunk@471 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-07 16:18:56 +00:00
oharboe
219b7f30b9 - image.c and fileio.c now uses logging to propagate error strings.
More precise, less code.
- removed unused code in fileio.c
- Windows should now find debug_handler.bin

git-svn-id: svn://svn.berlios.de/openocd/trunk@390 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-29 11:42:37 +00:00
drath
3d6bcf0792 - convert all files to unix line-ending
git-svn-id: svn://svn.berlios.de/openocd/trunk@347 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-25 17:48:04 +00:00
oharboe
687a9553c9 From Michael Bruck
- bugfix in server.c
- removed unused parameter from jtag_add_ir_scan et al. This
wasn't necessary in hindsight but anyway.
- arm11 source committed but not not in Makefile.am/target.c for now.

git-svn-id: svn://svn.berlios.de/openocd/trunk@341 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-25 08:22:18 +00:00
mifi
2e01a1ad19 - added gdb flash fixes patch
https://lists.berlios.de/pipermail/openocd-development/2007-December/000548.html
- added synthesize in_check_mask/value and error handler patch
https://lists.berlios.de/pipermail/openocd-development/2008-January/000554.html

(thanks to oyvind harboe for these patches)

git-svn-id: svn://svn.berlios.de/openocd/trunk@248 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-01-07 17:11:11 +00:00
mifi
02f3765351 - added patch for new flash functionality like:
flash verify_image and flash erase_address.
- added patch for new parport_write_on_exit command.
Even this patch will fix some memory leaks.

(thanks too oyvind and Spen for these patches)

git-svn-id: svn://svn.berlios.de/openocd/trunk@240 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-12-18 21:20:28 +00:00
drath
c8490c2099 - fixed ETM configuration register decoding
git-svn-id: svn://svn.berlios.de/openocd/trunk@232 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-12-16 11:52:50 +00:00
drath
cb6ebced3d - update jtag_speed setting when changing it during runtime with a FT2232 based interface
- use 'etm trigger_percent' setting when programming ETB trigger count
- fixed some small bugs in ETM trace analysis
- fixed minor bug in flash writing (thanks to Pavel Chromy)


git-svn-id: svn://svn.berlios.de/openocd/trunk@197 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-08-16 13:12:48 +00:00
drath
9061c08aa7 - cleaned up cycle counting in ETM analysis
- fixed broken OpenOCD version string



git-svn-id: svn://svn.berlios.de/openocd/trunk@188 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-07-31 16:39:06 +00:00
drath
dbd95cb8a2 - calculate cycles since last executed instruction when cycle-accurate tracing is enabled
- increase memory pseudo-image cache size to 1024 byte for improved trace analysis performance
- added OpenOCD+trace as an ETM capture driver example implementation
- new usbprog driver (thanks to Benedikt Sauter)


git-svn-id: svn://svn.berlios.de/openocd/trunk@186 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-07-31 10:07:32 +00:00
drath
1429d2c659 - added support for Asix Presto JTAG interface (thanks to Pavel Chromy and Asix for making this addition possible)
- added support for usbprog (thanks to Benedikt Sauter)
- make OpenOCD listen for WM_QUIT messages on windows (thanks to Pavel Chromy)
- register at_exit handler to do necessary unregistering (thanks to Pavel Chromy)
- added dummy ETM capture driver to allow ETM to be registered without a capture driver


git-svn-id: svn://svn.berlios.de/openocd/trunk@180 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-07-15 11:19:33 +00:00
drath
32c6d70f6a - fixed endianness helper macros (thanks to obilix and wiml for finding and fixing this bug)
- added declarations for 32bit fileio access functions (network byte order)
- fixed bug in etm trace dump file handling
- added XScale trace buffer decoding
- fixed arm_simulator ERROR numbers (-7xx used twice)
- fixed minor bug in debug output in stellaris.c


git-svn-id: svn://svn.berlios.de/openocd/trunk@178 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-06-28 10:32:58 +00:00
drath
ffb51c23fd - added support for Intel/Marvel PXA27x (XScale) targets
- added support for scans coming from or ending in Shift-DR or Shift-IR to bitbang code (required for XScale debugging)
- cleaned up errror handlers. only use when there's a catchable error
- fix segfault when etm was configured without a valid driver



git-svn-id: svn://svn.berlios.de/openocd/trunk@176 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-06-21 13:15:22 +00:00
drath
3d026ce943 - added support for pseudo image type "mem", currently only used for etm analysis: "etm image <target#> <dummy base address> mem"
git-svn-id: svn://svn.berlios.de/openocd/trunk@173 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-06-15 14:10:23 +00:00
drath
53d1f9b2ca - added manpage for OpenOCD (thanks to Uwe Hermann)
- fixed bug in ARM926EJ-S cache handling that caused cache linefills to be disabled after first debug entry
- added support for auto image type detection (thanks to Vincent Palatin)
- further work on ETM trace decoding (tested with a ETB interface using an ETM in normal 16-bit port mode, still experimental)



git-svn-id: svn://svn.berlios.de/openocd/trunk@169 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-06-14 09:47:00 +00:00
drath
237e894805 - split fileio handling into fileio part and image handling
- reworked etm/etb into a generic etm part with trace capture drivers (currently only etb supported)
- added XScale debug handler binary to repository
- added Thumb disassembling (thanks to Vincent Palatin for this patch)
- added support for non-CFI compatible flashes to cfi driver (currently only SST39VFxxx devices supported)
This checkin is experimental, not suitable for general use


git-svn-id: svn://svn.berlios.de/openocd/trunk@155 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-05-29 11:23:42 +00:00
drath
22bc5194ae - added support for error handlers to JTAG scan commands (jtag_[plain_][ir|dr]_scan)
- catch apparently broken JTAG IR scan after ARM926EJ-S CP15 operations
- added "arm7_9 dump_etb" command


git-svn-id: svn://svn.berlios.de/openocd/trunk@142 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-04-25 20:15:59 +00:00
drath
a582e9a8d1 - str9x flash support (Thanks to Spencer Oliver)
- str75x flash support (Thanks to Spencer Oliver)
- correct reporting of T-Bit in CPSR (Thanks to John Hartman for reporting this)
- core-state (ARM/Thumb) can be switched by modifying CPSR
- fixed bug in gdb_server register handling
- register values > 32-bit should now be supported
- several minor fixes and enhancements



git-svn-id: svn://svn.berlios.de/openocd/trunk@100 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2006-09-28 10:41:43 +00:00
drath
82d2633b5f - Added support for native MinGW builds (thanks to Spencer Oliver and Michael Fischer) - you still need to install GiveIO (not part of OpenOCD)
- Added state-move support to ftd2xx and bitbang JTAG drivers (required for XScale, possibly useful for other targets, too)
- various fixes


git-svn-id: svn://svn.berlios.de/openocd/trunk@78 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2006-07-17 14:13:27 +00:00
drath
8b4e882a16 - prepare OpenOCD for branching, created ./trunk/
git-svn-id: svn://svn.berlios.de/openocd/trunk@64 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2006-06-02 10:36:31 +00:00