Commit Graph

449 Commits

Author SHA1 Message Date
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
8959de9f67 - 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@2373 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:44:17 +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
3813fda44a - Fixes '==' whitespace
- Replace ')\(==\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\(==\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2371 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:42:03 +00:00
zwelch
0e2c2fe1d1 - 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@2369 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:40:42 +00:00
zwelch
4ce93ac479 - Fixes '>=' whitespace
- Replace ')\(>=\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\(>=\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2367 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:40:10 +00:00
zwelch
128a733428 - Fixes '&&' whitespace
- Replace ')\(&&\)(' with ') \1 ('.
- Replace '\(\w\)\(&&\)(' with '\1 \2 ('.
- Replace '\(\w\)\(&&\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2366 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:39:47 +00:00
zwelch
d61714f4d5 - Fixes '[+]=' whitespace
- Replace '\(\w\)\([+]=\)(' with '\1 \2 ('.
- Replace '\(\w\)\([+]=\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2364 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:39:18 +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
zwelch
5e98c71436 - Fixes '-=' whitespace
- Replace '\(\w\)\(-=\)(' with '\1 \2 ('.
- Replace '\(\w\)\(-=\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2362 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:37:56 +00:00
zwelch
95d2a23724 - Replace 'for(' with 'for ('.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2360 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:37:21 +00:00
zwelch
9af5e445b7 - Replace 'switch(' with 'switch ('.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2359 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:36:56 +00:00
zwelch
50c086ffb9 - Replace 'while(' with 'while ('.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2358 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:36:11 +00:00
zwelch
e43979e702 - Replace 'if(' with 'if ('.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2357 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:35:09 +00:00
zwelch
bed9c62f9e Oleksandr Tymoshenko <gonzo@bluezbox.com>:
Resume command works only if resume address is provided.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2348 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-21 04:58:53 +00:00
duane
afc3eb1dc1 C99 printf() -Werror fixes
git-svn-id: svn://svn.berlios.de/openocd/trunk@2325 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-21 03:17:33 +00:00
zwelch
9eb3181cc8 Paulius Zaleckas <paulius.zaleckas@gmail.com>:
This is minimal patch to support FA526 ARMv4 compatible core.
Since it is very similar to ARM920T I tried to reuse as much
code as possible.

CPU and board configs will follow soon.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2292 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-19 22:39:35 +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
f876d5e9c7 Transform 'u16' to 'uint16_t'
- Replace '\([^_]\)u16' with '\1uint16_t'.
- Replace '^u16' with 'uint16_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2277 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:07:59 +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
zwelch
6ba0b46cec David Brownell <david-b@pacbell.net>:
Fix parsing bugs for "$target_name mww addr data [count]" ... it was
always requiring the count, instead of just defaulting it to one.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2263 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-17 06:40:39 +00:00
zwelch
a0c10dd29b David Brownell <david-b@pacbell.net>:
Extend the internal JTAG event handlers to cover enable/disable,
and use those events to make sure that targets get "examined" if
they were disabled when the scan chain was first set up:

 - Remove "enum jtag_tap_event", merge with "enum jtag_event",
   so C code can now listen for TAP enable/disable events.

 - Report those events so they can trigger callbacks.

 - During startup, make target_examine() register a handler to
   catch ENABLE events for any then-disabled targets.

This fixes bugs like "can't halt target after enabling its TAP".

One class of unresolved bugs:  if the target has an ETM hooked
up to an ETB, nothing activates the ETB.  But starting up the
ETM without access to the ETB registers fails...


git-svn-id: svn://svn.berlios.de/openocd/trunk@2251 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-16 12:17:18 +00:00
zwelch
14f88acaf6 David Brownell <david-b@pacbell.net>:
Fix some polling issues:

 - Don't background-poll disabled TAPs ... this was just a bug
   waiting to happen.  (And then it happened!)

 - Don't fail command line polls of disabled taps; that's not any
   kind of error, it's just that you can't do much.  But do show
   that tap-disabled status.

 - Spell "continuous" correctly in the variable name.  ;)

Not resolved by this patch:  the need for an interlock whereby
other code (like the JTAG layer) can block all other access to
the JTAG layer, e.g. while enabling or disabling TAPs.  And
that interlock needs to be timer-safe...


git-svn-id: svn://svn.berlios.de/openocd/trunk@2247 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-16 00:23:13 +00:00
zwelch
0ffbc60333 Factor load_image argument parsing to parse_load_image_command_args:
- Make fast_load_image use the helper coverage the standard load_image.
- Improve whitespace in the moved lines.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2239 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-13 00:34:31 +00:00
zwelch
af52480a45 Improve handle_profile_command argument parsing:
- Use parse_uint to ensure timeout value parses properly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2238 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-13 00:34:24 +00:00
zwelch
b7c5e630ea Improve handle_virt2phys_command argument parsing:
- Use parse_u32 to ensure virtual address parses properly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2237 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-13 00:34:17 +00:00
zwelch
f7afcfe23f Cleanup and improve handle_wp_command and handle_rwp_command:
- Simplify argument parsing logic using switch statement.
- Use parse_u32 to ensure all values parse properly.
- Return syntax error when mode argument fails to parse.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2236 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-13 00:34:10 +00:00
zwelch
d0a300e0a0 Improve and simplify handle_bp_command and handle_rbp_command:
- Bug fix: return syntax error if remove called without one argument.
- Use parse_u32 to ensure address and length arguments parse properly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2235 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-13 00:34:03 +00:00
zwelch
16c77cf3ca Improve handle_verify_image_command_internal command argument handling:
- Use parse_u32 to ensure address parses properly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2234 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-13 00:33:55 +00:00
zwelch
890973acc4 Improve handle_dump_image_command argument parsing:
- Use parse_u32 to ensure address and size parse properly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2233 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-13 00:33:48 +00:00
zwelch
bb37adadab Improve handle_load_image_command argument parsing:
- Use parse_u32 to ensure base/min/max addresses parse properly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2232 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-13 00:33:42 +00:00
zwelch
6f9aac1892 Improve handle_mw_command argument handling:
- Change: All local variable types are now unsigned.
- Use parse_u32 to ensure address and value parse properly.
- Use parse_uint to ensure count parses properly.
- Move variables to location of first use.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2231 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-13 00:33:34 +00:00
zwelch
08128b572a Improve handle_md_command argument handling:
- Use parse_u32 and parse_uint for address and count, respectively.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2230 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-13 00:33:25 +00:00
zwelch
71f95de8a6 Use parse_u32 in handle_resume_command and handle_step_command.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2229 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-13 00:33:18 +00:00
zwelch
5d0cdf4d94 Cleanup and improve handle_halt_command:
- Make argument check use parse_uint to ensure value parses properly.
- Move variable declarations to location of first use.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2228 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-13 00:33:11 +00:00
zwelch
fad8521a87 Cleanup and fi handle_wait_halt_command:
- Use unsigned type for delay variable.
- Use parse_uint to ensure delay argument parses properly.
- Bug fix: Return syntax error if more than one argument is given.
- Bug fix: Return syntax error when argument fails to parse.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2227 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-13 00:33:01 +00:00
zwelch
45ec363c4a Use parse_uint in handle_reg_command to ensure reg number parses properly.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2226 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-13 00:32:54 +00:00
zwelch
2343245090 Use parse_uint in get_target to ensure target id is parsed properly.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2225 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-13 00:32:40 +00:00
oharboe
1b2c1c6ff0 fix ordering of arguments to fwrite()
git-svn-id: svn://svn.berlios.de/openocd/trunk@2197 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-11 13:00:08 +00:00
zwelch
538050c146 Factor handle_bp_command into pieces:
- Bug fix: return a syntax error if the wrong number of arguments are given.
- Add handle_bp_command_list() and handle_bp_command_set().
- Use temporary addr variable to eliminate redundant strtoul() calls.
- Place variable declarations at their point of first use.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2196 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-11 11:43:07 +00:00
zwelch
8e899d43ef Factor target_timer_callbacks_check_time into pieces:
- Add target_timer_callback_periodic_restart and target_call_timer_callback.
- Clean up and simplify logic that determines whether to call each callback. 
- Move variable declarations to location of first use.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2195 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-11 11:43:00 +00:00
zwelch
7c892082c9 Simplify and clean handle_virt2phys_command:
- Add a doxygen block to simplify logic.
- Move declarations to point of first use.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2194 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-11 11:42:54 +00:00
zwelch
57612ecf1d Simplify and fix target handle_rwp_command routine:
- Return syntax error unless exactly one argument is passed.
- Move variable declaration to point of first use.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2193 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-11 11:42:47 +00:00
zwelch
d7ada2457e Simplify and fix handle_reset_command:
- Return syntax error if more than one argument is given.
- Move variables to location of first use.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2192 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-11 11:42:40 +00:00
zwelch
e4850d7159 Simplify handle_resume_command:
- Eliminate redundant calls to target_resume with addr temp variable.
- Place variables at location of first use.
- Fix minor whitespace issues.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2191 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-11 11:42:33 +00:00
zwelch
78cf92166a Simplify and fix handle_step_command:
- Bug fix: return syntax error when more than one argument is given.
- Eliminate redundant calls to step callback with addr temp variable.
- Place variables at location of first use.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2190 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-11 11:42:26 +00:00
oharboe
c1995bb08f disable polling continuous polling during reset
git-svn-id: svn://svn.berlios.de/openocd/trunk@2183 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-11 06:19:37 +00:00
zwelch
bdb7dd5e0f Move the documentation for the "poll" command up with
other server configuration.  Explain what it's about;
reference the related "$target_name curstate" method.

Update "poll" output to report whether background polling
is enabled or not.

Also fix a small typo; PC's have "complementary" tools.
Some have also "complimentary" ones; but not all.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2178 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-10 04:06:25 +00:00
oharboe
e468797e41 David Brownell <david-b@pacbell.net> Bugfix: $target_name cget/configure -work-area-backup commands
should return the "is it backed up?" flag, not the work area size.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2108 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 06:18:13 +00:00
oharboe
a405fd1581 David Brownell <david-b@pacbell.net>
- Don't let disabled TAPs be set as the current target

 - Improve "targets" output:
    * Remove undesirable "chain position" number; we discourage using them
    * TAP and Target column updates:
       + make them long enough for current usage
       + improve labels, removing guesswork
       + "TapName" label patches scan_chain output
    * Highlight the "current" target
    * Display "tap disabled" as a new pseudo-state
    * Update docs accordingly

git-svn-id: svn://svn.berlios.de/openocd/trunk@2107 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 06:16:43 +00:00
zwelch
695c6c0960 David Brownell <david-b@pacbell.net>:
Let disabled targets be ignored during normal operation:

 - In target_examine(), ignore disabled TAPs

 - Reset handling must not poke at them either:
     * fail $target_name arp_* operations on disabled TAPs
     * in startup.tcl, don't even issue the arp_* wait ops 

ZW: removed superfluous braces from the patch to target.c.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2100 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 23:35:29 +00:00
zwelch
733dfb288f Fix regression in mdw output; identified by Magnus Lundin.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2098 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 23:20:30 +00:00
oharboe
a49faa206d remove unused include file: inttypes.h
git-svn-id: svn://svn.berlios.de/openocd/trunk@2071 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-05 06:37:21 +00:00
zwelch
7db5839608 Eliminate MixedCaps symbol from public JTAG TAP API:
- Purely mechanical transformations to the source files.
- Rename 'jtag_TapByJimObj' as 'jtag_tap_by_jim_obj.'


git-svn-id: svn://svn.berlios.de/openocd/trunk@2066 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-05 00:43:12 +00:00
oharboe
414245c9ce fix warning for a variable that GCC thought might be uninitialized(which it can't be).
git-svn-id: svn://svn.berlios.de/openocd/trunk@1979 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-01 19:06:11 +00:00
zwelch
74df79d4d8 Final step in isolating target_type_s structure:
- Move definition of 'struct target_type_s' into new 'target_type.h' file.
- Forward delclaration remains in target.h, with comment pointing to new file.
- Replaces #define with #include in source files.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1971 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31 12:38:28 +00:00
zwelch
818aa27a9d First step in hiding target_type_s from public interface:
- Add DEFINE_TARGET_TYPE_S symbol in files that need it defined.
- Forward declare 'struct target_type_s' only, unless that symbol is defined.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1969 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31 11:32:28 +00:00
zwelch
4deb42ed00 Add target_examine_one wrapper:
- replaces all calls to target->type->examine.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1968 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31 11:32:10 +00:00
zwelch
d00ac17e8e Add target breakpoint and watchpoint wrapper:
- replaces all calls to target->type->{add,remove}_{break,watch}point.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1967 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31 11:31:52 +00:00
zwelch
0de78ed02c Add target_get_name wrapper:
- replaces all accesses to target->type->name.
- add documentation in target_s to warn not to access field directly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1966 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31 11:31:27 +00:00
zwelch
17fa4de854 Add target_step wrapper:
- replaces all calls to target->type->step.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1965 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31 11:31:11 +00:00
zwelch
df4cf0615f Add target_get_gdb_reg_list wrapper:
- replaces all calls to target->type->get_gdb_reg_list.
- add documentation in target_s to warn not to invoke callback directly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1964 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31 11:30:59 +00:00
zwelch
11edf22776 Add target_bulk_write_memory wrapper:
- replaces all calls to target->type->bulk_write_memory.
- add documentation in target_s to warn not to invoke callback directly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1963 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31 09:39:04 +00:00
zwelch
9cb3af610a Add wrappers for target->type->examined:
- replace all checks of target->type->examined with target_was_examined().
- replace all setting of target->type->examined with target_set_examined().
- replace clearing of target->type->examined with target_reset_examined().
- add documentation in target_s to warn not to access field directly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1962 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31 09:38:43 +00:00
zwelch
fbe8cf72a5 Add target_run_algorithm wrapper:
- replaces all calls to target->type->run_algorithm.
- add documentation in target_s to warn not to invoke callback directly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1961 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31 09:38:20 +00:00
zwelch
95e13054ca Add target_write_memory wrapper:
- replaces all calls to target->type->write_memory.
- add documentation in target_s to warn not to invoke callback directly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1960 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31 09:37:57 +00:00
zwelch
b6db182c00 Add target_read_memory wrapper:
- replaces all calls to target->type->read_memory.
- add documentation in target_s to warn not to invoke callback directly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1959 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31 09:37:35 +00:00
zwelch
6785193118 Simplify the handle_md_command routine in target.c:
- fix buffer overrun in mdw; final '\0' would overflow the output buffer.
 - return ERROR_COMMAND_SYNTAX_ERROR instead of ERROR_OK if:
   - less than one argument is provided
   - the command is called with a name other than mdb, mdh, or mdw.
 - factor all command output into new handle_md_output function


git-svn-id: svn://svn.berlios.de/openocd/trunk@1958 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31 06:00:28 +00:00
zwelch
55f21192b0 Make nvp_target_event static; remove its external declaration.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1957 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31 04:58:51 +00:00
zwelch
12df0f0090 Make target_buffer_get_uXX interfaces work with constant buffers.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1956 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31 02:18:26 +00:00
zwelch
58e31916de Eliminate duplicated code in the handle_mw_command memory write loop.
- wordsize will always be 1, 2, or 4 due to preceeding switch statement.
- move call to keep_alive after successful writes, not upon failures


git-svn-id: svn://svn.berlios.de/openocd/trunk@1953 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-30 23:57:30 +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
4b992717b5 Author: Øyvind Harboe <oyvind.harboe@zylin.com>
- Allow target_read/write_buffer of size 0


git-svn-id: svn://svn.berlios.de/openocd/trunk@1870 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-21 05:12:32 +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
41826d5bd9 fix array2mem/mem2array when used as a "method" on a target.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1801 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-17 13:00:36 +00:00
oharboe
b3b0ff60c2 take #2: dump_image now works for addresses not divisible by 4
git-svn-id: svn://svn.berlios.de/openocd/trunk@1786 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-14 19:00:35 +00:00
oharboe
a74d911412 dump_image now works for addresses not divisible by 4
git-svn-id: svn://svn.berlios.de/openocd/trunk@1785 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-14 18:56:41 +00:00
oharboe
c5e51bca0a propagate error in dump_image. If an error occurs during dump_image, a tcl exception is thrown.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1782 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-14 08:44:09 +00:00
zwelch
03f3296046 Audit and eliminate redundant #include directives in core target files.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1713 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 04:38:18 +00:00
zwelch
490e271290 Remove redundant sys/types.h #include directives (now in types.h).
git-svn-id: svn://svn.berlios.de/openocd/trunk@1700 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 02:27:16 +00:00
oharboe
7a93100c2d Dirk Behme <dirk.behme@googlemail.com> Add minimalist Cortex A8 file
git-svn-id: svn://svn.berlios.de/openocd/trunk@1602 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-04 18:44:12 +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
oharboe
e784db4fdd SimonQian <simonqian@simonqian.com> AVR wip
git-svn-id: svn://svn.berlios.de/openocd/trunk@1540 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-27 10:32:13 +00:00
kc8apf
0f3ab30087 Fix use of wrong format conversion for size_t (%zu instead of %u)
git-svn-id: svn://svn.berlios.de/openocd/trunk@1502 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-22 07:31:16 +00:00
oharboe
5dbf973910 Zach Welch <zw@superlucidity.net>fix unused return value warnings (3 of 4)
git-svn-id: svn://svn.berlios.de/openocd/trunk@1482 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-21 05:35:10 +00:00
oharboe
4f0bd8e8e1 Zach Welch <zw@superlucidity.net> fix -Wformat-security warnings (1 of 4)
git-svn-id: svn://svn.berlios.de/openocd/trunk@1481 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-21 05:33:47 +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
duane
fb59d0fa55 Commands: reg, profile, ocd_mem2array, ocd_array2mem, fast_load, etc only work *IF* there is an actual target
git-svn-id: svn://svn.berlios.de/openocd/trunk@1404 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-03-08 21:14:35 +00:00
oharboe
86c0f4cafc Nicolas Pitre <nico@cam.org> fix "halt 0" to only halt and not to poll/wait afterwards. This follows the intention in the docs.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1398 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-03-05 06:55:35 +00:00
oharboe
8d772cad7a test code for elf parsing.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1396 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-03-03 12:05:49 +00:00
oharboe
39d80bad9b tinkered a bit with performance for Cortex flash programming. Mainly make it easier to profile as a start.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1380 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-02-23 21:26:11 +00:00
oharboe
ce1a29725f chain position is now required when creating a target
git-svn-id: svn://svn.berlios.de/openocd/trunk@1363 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-01-28 13:08:06 +00:00
oharboe
f4d82deb36 Uwe Hermann <uwe@hermann-uwe.de> One of them is fixing a few compiler warnings (see attached patch) and
likely also one (non-cosmetic) bug (the 'id_buff' change, which seems to
be a buffer overflow).

git-svn-id: svn://svn.berlios.de/openocd/trunk@1293 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-28 21:40:39 +00:00
ntfreak
47d0449347 - add ability for openocd to communicate to gdb using pipes (stdin/stdout).
- this is enabled by new command line option option --pipe.

git-svn-id: svn://svn.berlios.de/openocd/trunk@1242 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-15 09:43:26 +00:00
oharboe
459d03e3bb fast_load profiling tool moved to target.c
git-svn-id: svn://svn.berlios.de/openocd/trunk@1241 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-15 09:05:16 +00:00
ntfreak
0cba0d4df3 - remove target specific variant and use target->variant member
- fix build warning in cortex_m3
- code cleanup - remove trailing lf and convert c++ comments

git-svn-id: svn://svn.berlios.de/openocd/trunk@1238 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-13 12:44:39 +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
3a636951eb Rick Altherr <kc8apf@kc8apf.net> retire obsolete syntax
git-svn-id: svn://svn.berlios.de/openocd/trunk@1190 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-27 14:58:49 +00:00
ntfreak
271bb81d6d - fixes segfault using the targets cmd if multiple targets defined
git-svn-id: svn://svn.berlios.de/openocd/trunk@1187 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-26 16:43:01 +00:00
oharboe
e3462b228c jtag_get_device() now returns NULL and reports error instead of invoking exit()
git-svn-id: svn://svn.berlios.de/openocd/trunk@1176 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-19 08:22:47 +00:00
oharboe
3de3de0b37 execute reset init upon power restore / srst deassert
git-svn-id: svn://svn.berlios.de/openocd/trunk@1150 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-10 10:16:13 +00:00
oharboe
71c7306885 fix telnet async messages. retired telnet_async command - no user serviceable parts inside.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1135 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-05 08:48:50 +00:00
oharboe
bbafcb3758 disable continous polling while srst is asserted and power dropout is detected
git-svn-id: svn://svn.berlios.de/openocd/trunk@1134 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-05 07:45:31 +00:00
oharboe
fbbf6640ae Rick Alterr - The attached patch makes the target syntax parsing much more robust and makes the variant optional again.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1129 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-04 08:02:06 +00:00
oharboe
199ebae564 Rick Altherr <kc8apf@kc8apf.net> - fix warnings
git-svn-id: svn://svn.berlios.de/openocd/trunk@1126 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-03 07:22:14 +00:00
oharboe
e3eff88550 invoke target_create() once
git-svn-id: svn://svn.berlios.de/openocd/trunk@1124 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-02 21:16:41 +00:00
oharboe
7b78e59192 step command now propagates error
git-svn-id: svn://svn.berlios.de/openocd/trunk@1123 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-02 20:55:07 +00:00
oharboe
f8cd20e284 Rick Altherr <kc8apf@kc8apf.net> - fix support for old target syntax
git-svn-id: svn://svn.berlios.de/openocd/trunk@1108 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-28 08:06:07 +00:00
oharboe
df77b45054 Kees Jongenburger <kees.jongenburger@gmail.com> old" syntax target command appears to be broken
this patch addresses this issue

git-svn-id: svn://svn.berlios.de/openocd/trunk@1107 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-27 20:57:17 +00:00
oharboe
ed9c257551 Laurentiu Cocanu - more help text
git-svn-id: svn://svn.berlios.de/openocd/trunk@1087 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-22 09:30:33 +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
af41e6aac8 김운식 <donari75@gmail.com> spotted a bug in target_write_u8
git-svn-id: svn://svn.berlios.de/openocd/trunk@1063 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-15 07:08:18 +00:00
oharboe
08058e72d9 reset cleanup. Remove obsolete events that are not needed for compatibility.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1053 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-14 07:30:45 +00:00
oharboe
3600e7c6e0 reset cleanup
git-svn-id: svn://svn.berlios.de/openocd/trunk@1048 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-14 06:21:02 +00:00
oharboe
fe41e273e3 Retired old reset code according to plan.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1047 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-13 20:38:58 +00:00
oharboe
bc25d4fa5e Fixed gaffes in reset script handling + improved error
messages a bit. The file and line # of the syntax error
in a reset script is now printed.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1042 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-13 10:30:33 +00:00
oharboe
0a3b6213bb Laurentiu Cocanu <laurentiu.cocanu@zylin.com> - Added additional error checks mostly to src/target/target.c
git-svn-id: svn://svn.berlios.de/openocd/trunk@1041 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-13 06:52:05 +00:00
oharboe
4eadb146c1 file not found SEGFAULT fix
git-svn-id: svn://svn.berlios.de/openocd/trunk@1030 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-08 11:06:44 +00:00
oharboe
7fd9ba22ba Centralize error handling for buggy register handling
git-svn-id: svn://svn.berlios.de/openocd/trunk@1019 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-06 12:09:27 +00:00
oharboe
316c9b9698 GDB alive fixes for verify_image
git-svn-id: svn://svn.berlios.de/openocd/trunk@1014 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-03 13:25:33 +00:00
oharboe
f9a3c36cf2 fix noise in gdb console when single stepping. Remove printing of log before processing halted event.
git-svn-id: svn://svn.berlios.de/openocd/trunk@994 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-09-24 09:43:31 +00:00
ntfreak
68c598e88d - added myself to copyright on files i remember adding large contributions for over the years
- cleaned up headers to match rest of code
- added missing svn props for previously added files

git-svn-id: svn://svn.berlios.de/openocd/trunk@987 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-09-20 10:50:53 +00:00
oharboe
d28931c2d4 follow up to keep_alive() fix. process target events before returning from reset procedure.
git-svn-id: svn://svn.berlios.de/openocd/trunk@986 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-09-12 10:53:10 +00:00
oharboe
9b6853bc4c - Fixed regression introduced in 890 when "fixing warnings" for target_call_timer_callbacks_now().
target_call_timer_callbacks_now() did the same as target_call_timer_callbacks().

- Reduced keep_alive()'s job to only deal with GDB keep  alive problems.

git-svn-id: svn://svn.berlios.de/openocd/trunk@985 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-09-12 07:09:38 +00:00
oharboe
0ae7f962f8 Duane Ellis: target_process_reset is now implemented in tcl. This allows better control from target configuration scripts.
git-svn-id: svn://svn.berlios.de/openocd/trunk@984 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-09-12 06:56:00 +00:00
oharboe
2ccb9ed44c fixed keep_alive fix gaffe introduce in previous commit.
git-svn-id: svn://svn.berlios.de/openocd/trunk@983 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-09-08 12:14:33 +00:00
oharboe
a5c4ef92b0 Duane Ellis has made highly non-trivial changes to both the target handling and command system.
git-svn-id: svn://svn.berlios.de/openocd/trunk@977 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-09-01 21:22:20 +00:00
oharboe
5ac8036b7f Removed target->reset_mode, no longer used
git-svn-id: svn://svn.berlios.de/openocd/trunk@976 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-09-01 07:24:14 +00:00
oharboe
ef1cfb2394 Duane Ellis: "target as an [tcl] object" feature.
git-svn-id: svn://svn.berlios.de/openocd/trunk@975 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-09-01 07:20:21 +00:00
oharboe
7df08fc385 fixed gaffe in last release w/target number.
git-svn-id: svn://svn.berlios.de/openocd/trunk@965 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-08-25 11:30:46 +00:00
oharboe
8d73c2a9b0 duan ellis target tcl work in progress
converts a number of 'simple string lookup tables' into NVP tables.
  These NVP tables will be used by various commands coming in the next patch.


git-svn-id: svn://svn.berlios.de/openocd/trunk@962 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-08-24 18:20:49 +00:00
drath
2feac34e3f - fix a off-by-one error in the buffer read/write code that checks for a address wrap
git-svn-id: svn://svn.berlios.de/openocd/trunk@957 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-08-22 12:08:47 +00:00
oharboe
c4567145ae fix BUG: keep_alive() error messages
git-svn-id: svn://svn.berlios.de/openocd/trunk@949 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-08-20 07:14:45 +00:00
oharboe
ea0270e38e make target_wait_state() usable from other places, made LOG_USER() output LOG_DEBUG() output. Avoids flooding logs in certain cases and OpenOCD will output error message if the halt fails.
git-svn-id: svn://svn.berlios.de/openocd/trunk@944 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-08-19 16:42:58 +00:00
oharboe
0960cbeedd added some alive_sleep()'s
git-svn-id: svn://svn.berlios.de/openocd/trunk@940 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-08-19 13:53:43 +00:00
oharboe
c45225dd11 propagate error code in case of "reset" failing.
git-svn-id: svn://svn.berlios.de/openocd/trunk@906 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-08-11 10:31:13 +00:00
oharboe
bd85f16e39 default reset in help text - run
git-svn-id: svn://svn.berlios.de/openocd/trunk@900 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-08-08 08:37:41 +00:00
ntfreak
ce16ff901c - fix target_examine declaration
- remove build warnings
- added --enable-gccwarnings to docs
- update mips_m4k_examine function

git-svn-id: svn://svn.berlios.de/openocd/trunk@893 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-08-06 14:36:37 +00:00
oharboe
f370d70670 Duane Ellis: fix warnings
git-svn-id: svn://svn.berlios.de/openocd/trunk@890 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-08-05 12:27:18 +00:00
oharboe
1829361253 define resetting the target into the halted or running
state as an atomic operation.

git-svn-id: svn://svn.berlios.de/openocd/trunk@888 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-08-05 07:11:12 +00:00
oharboe
3a48961820 moves handling of problems with resetting into the halted state
into the target implementation.

Also target_process_reset() is now simpler and has error handling,
e.g. if assert reset fails, then target_process_reset() will propagate
that error.

cmd_ctx was passed in to examine(), which is wrong - removed that.

git-svn-id: svn://svn.berlios.de/openocd/trunk@887 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-08-05 06:18:26 +00:00
oharboe
75ba7397b2 wait up to 1 second for halted state upon reset init/halt.
git-svn-id: svn://svn.berlios.de/openocd/trunk@884 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-31 15:52:01 +00:00
oharboe
0f18744a87 fixed gaffe mea culpa
git-svn-id: svn://svn.berlios.de/openocd/trunk@878 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-28 14:25:03 +00:00
oharboe
e2b6de3d66 retired reset run_and_init/halt
git-svn-id: svn://svn.berlios.de/openocd/trunk@877 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-28 06:08:05 +00:00
oharboe
b82a189c4e add check for target_read/write_buffer 32 bit wrap.
git-svn-id: svn://svn.berlios.de/openocd/trunk@875 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-26 19:12:30 +00:00
ntfreak
53590217ee - merged mips target into svn trunk
git-svn-id: svn://svn.berlios.de/openocd/trunk@874 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-26 10:32:11 +00:00
oharboe
6f0000e5ce minimum address and maximum length argument to load_image. Used in lieu of reset init script when executable w/reset init sequence is available.
git-svn-id: svn://svn.berlios.de/openocd/trunk@873 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-25 14:09:00 +00:00
oharboe
526fe3d83e added yours sincerely for files where I feel that I've made non-trivial contributions.
git-svn-id: svn://svn.berlios.de/openocd/trunk@872 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-25 06:54:17 +00:00
oharboe
06d501a192 wait 500ms for target to halt upon connect.
git-svn-id: svn://svn.berlios.de/openocd/trunk@865 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-24 06:07:55 +00:00
ntfreak
bf58fe6509 - fix typo
git-svn-id: svn://svn.berlios.de/openocd/trunk@862 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-23 20:18:56 +00:00
oharboe
dfbb9f3e89 - jtag_khz/speed are now single parameter only. These are used
from pre/post_reset event scripts. Adding the second parameter was
a mistake seen in retrospect. this gives precise control in post_reset
for *when* the post reset speed is set. The pre_reset event was
added *after* the second parameter to jtag_khz/speed
- the target implementations no longer gets involved in the reset mode
scheme. Either they reset a target into a halted mode or not.
target_process_reset()
detects if the reset halt failed or not.
- tcl target event names are now target_N_name.  Mainly internal
at this early stage, but best to get the naming right now.
- added hardcoded reset modes from gdb_server.c. I don't know precisely what
these defaults should be or if it should be made configurable. Perhaps some
hardcoded defaults will do for now and it can be made configurable later.
- bugfix in cortex_m3.c for reset_run_and_xxx?
- issue syntax error upon obsolete argument in target command instead of
printing message that will surely drown in the log

git-svn-id: svn://svn.berlios.de/openocd/trunk@849 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-21 15:59:41 +00:00
oharboe
6c0553c8c5 openocd@duaneellis.com fix naming confusion. Use ocd_ prefix for ocd API consistently.
git-svn-id: svn://svn.berlios.de/openocd/trunk@839 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-20 17:04:58 +00:00
oharboe
35e84a2a25 "reset" without arguments now execute a "reset run".
the reset mode argument to the target command is deprecated(ignored w/error message).

git-svn-id: svn://svn.berlios.de/openocd/trunk@832 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-18 14:43:29 +00:00
ntfreak
60ba4476df - fix incorrectly registered function openocd_array2mem
- removed unused variables
- reformatted lpc288x.[ch]
- fixed helper/Makefile.am dependencies
- add correct svn props to added files

git-svn-id: svn://svn.berlios.de/openocd/trunk@829 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-18 11:38:23 +00:00
oharboe
722fcb8d61 resume is now asynchronous
git-svn-id: svn://svn.berlios.de/openocd/trunk@828 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-18 11:18:35 +00:00
oharboe
94e75e0c06 1. GDB will print cryptic error messages if it is not fed keep-alive packets
within the last 2000ms.

To fix this, add keep_alive() if you are spending >1000ms in an algorithm
thus holding up the server loop.

target_call_timer_callbacks() invokes keep_alive().

2. post_reset script is now executed at normal JTAG speed and not
reset speed.

3. Resume is now synchronous again. Hopefully it will work this time.



git-svn-id: svn://svn.berlios.de/openocd/trunk@826 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-18 10:20:10 +00:00
oharboe
679592d42e Charles Hardin <ckhardin@gmail.com> move tcl stuff nearer to where it belongs.
git-svn-id: svn://svn.berlios.de/openocd/trunk@824 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-18 06:24:57 +00:00
ntfreak
6af107855d - reverted resume_target to old behaviour
git-svn-id: svn://svn.berlios.de/openocd/trunk@817 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-17 07:15:14 +00:00
oharboe
396d73ad0c better error messages for target event scripts.
git-svn-id: svn://svn.berlios.de/openocd/trunk@810 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-16 07:22:17 +00:00
ntfreak
a6a65f17f3 - only check normal resume, not debug resume
git-svn-id: svn://svn.berlios.de/openocd/trunk@777 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-09 12:46:40 +00:00
ntfreak
876297c25c - target_resume is now synchronous with 5sec timeout
git-svn-id: svn://svn.berlios.de/openocd/trunk@775 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-09 10:33:30 +00:00
oharboe
f0f5157e09 tcl regression fixes.
git-svn-id: svn://svn.berlios.de/openocd/trunk@774 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-08 16:05:59 +00:00
ntfreak
6ed75d476e - removed target_process_events as only used in handle_resume_command and events will be called anyway by poll
git-svn-id: svn://svn.berlios.de/openocd/trunk@772 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-08 11:19:03 +00:00
ntfreak
46b3e72528 - fix pre_resume script not being called
git-svn-id: svn://svn.berlios.de/openocd/trunk@771 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-08 10:49:58 +00:00
oharboe
9103bbbcb5 reset event is synonym for post_reset event.
git-svn-id: svn://svn.berlios.de/openocd/trunk@769 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-07 21:06:22 +00:00
ntfreak
655e4f88a6 - fixed build issues with win32
- fixed build warnings for last commit
- set svn props for last commit

git-svn-id: svn://svn.berlios.de/openocd/trunk@760 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-06 23:22:17 +00:00
oharboe
dc796a2091 src/helper/configuration.h
- Log output handlers now get a "const char *line"
	- Added "const" to parameter.

src/helper/command.c
src/helper/command.h
	- New function:  'command_output_text()'
	- Log output handlers now get a "const char *line"
 
src/helper/options.c
	- Log output handlers now get a "const char *line"

src/server/telnet_server.c
	- DO not transmit NULL bytes via TELNET.
	- Log output handlers now get a "const char *line"
	
src/server/gdb_server.c
	- Log output handlers now get a "const char *line"
	
	*** THIS INCLUDES PORTIONS OF A PATCH FROM Oyvind sent 
	previously to the mailing list for TCL users try

src/target/target.c
	*** THIS INCLUDES PORTIONS OF A PATCH FROM Oyvind sent 
	previously to the mailing list for TCL users try
	
src/target/target.h
	*** THIS INCLUDES PORTIONS OF A PATCH FROM Oyvind sent 
	previously to the mailing list for TCL users try

src/openocd.c
    - **MAJOR** Work: New TCL/Jim function: mem2array
	- **MAJOR** Work: Redirect Tcl/Jim stdio output to remote users.
	- Previously: TCL output did not go to GDB.
	- Previously: TCL output did not go to TELNET
	- Previously: TCL output only goes to control console.
	- This fixes that problem.
	+ Created callbacks:
		+openocd_jim_fwrite()	
		+openocd_jim_fread()
		+openocd_jim_vfprintf()
		+openocd_jim_fflush()
		+openocd_jim_fgets()

src/Makefile.am
	- New TCL files.
	- Future note: This should be more automated.  As the list of
	  'tcl' files grows maintaning this list will suck.

src/Jim.c
	- ** THIS INCLUDES A PREVIOUS PATCH I SENT EARLIER **
	- that impliments many [format] specifies JIM did not support.
	- Jim_FormatString() - **MAJOR** work.
	- Previously only supported "%s" "%d" and "%c"
	- And what support existed had bugs.
	- NEW: *MANY* formating parameters are now supported.
	- TODO: The "precision" specifier is not supported.

	** NEW ** This patch.
	
	- Jim_StringToWide() test if no conversion occured.
	- Jim_StringToIndex() test if no conversion occured.
	- Jim_StringToDouble() test if no conversion occured.

	** NEW ** This Patch. Major Work.
	- Previously output from JIM did not get sent to GDB
	- Ditto: Output to Telnet session.
	- Above items are now fixed - By introducing callbacks
	  new function pointers in the "interp" structure.

	- Helpers that call the callbacks.
	
	- New function: Jim_fprintf()
	- New function: Jim_vfprintf()
	- New function: Jim_fwrite()
	- New function: Jim_fread()
	- New function: Jim_fflush()
	- New function: Jim_fgets()

	By default: the output is to STDIO as previous.
	The "openocd.c" - redirects the output as needed.
	
	- Jim_Panic() - Send panic to both STDERR and the interps
	specified STDERR output as a 2nd choice.

	- Now JIM's "stdin/stdout/stderr" paramters are "void *"
	and are no longer "FILE *".

src/Jim.h
	- **MAJOR**
	-  New JIM STDIO callbacks in the "interp" structure.
	-  change: "stdin/stdout/stderr" are now "void *" cookies.
	-  New JIM stdio helper functions.



git-svn-id: svn://svn.berlios.de/openocd/trunk@755 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-06 19:17:43 +00:00
ntfreak
4d858f7136 - allocate target_type_t structure for each target, fixes issue when multiple targets of the same type are located on the jtag chain
- Thanks Michel Pollet

git-svn-id: svn://svn.berlios.de/openocd/trunk@738 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-02 07:51:41 +00:00
oharboe
c5df3ce144 Fixed bogus error message and plugged memory leak for the case when there was no reset script.
git-svn-id: svn://svn.berlios.de/openocd/trunk@728 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-06-25 19:23:55 +00:00
oharboe
7e36e461a4 added pre/post_reset scripts based on Pieter Conradie's ideas.
git-svn-id: svn://svn.berlios.de/openocd/trunk@726 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-06-25 08:47:19 +00:00
ntfreak
938e01d0c3 - moved flash erase_check target code to target.c
git-svn-id: svn://svn.berlios.de/openocd/trunk@694 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-05-27 21:23:47 +00:00
ntfreak
222b5c179a - fixed typo in wp command
git-svn-id: svn://svn.berlios.de/openocd/trunk@692 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-05-27 17:57:41 +00:00
oharboe
d8de4b9bab moved srst_pulls_trst check into arm7_9_common.c. Not tested yet, if it is broken it should "only" print bogus warnings or not print a warning when it should have.
git-svn-id: svn://svn.berlios.de/openocd/trunk@670 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-05-21 07:28:33 +00:00
oharboe
a76c3433e1 print out an error if srst_pulls_trst is not specified for
e.g. at91fr40008. Could possibly show bogus false positives in log without any other side effects.

git-svn-id: svn://svn.berlios.de/openocd/trunk@666 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-05-19 18:58:47 +00:00
oharboe
552244724c Michael Fischer found and Edgar Grimberg fixed generic crash in timers reproduceable with at91fr40008
git-svn-id: svn://svn.berlios.de/openocd/trunk@663 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-05-19 08:44:57 +00:00
oharboe
52377759a2 Michael Fischer spotted a problem in the reset routines for srst_pulls_trst. It is a bit of a mystery why this was only visible w/LPC2148.
Embedded ICE registers are now set up after SRST pulls TRST.

git-svn-id: svn://svn.berlios.de/openocd/trunk@650 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-05-09 18:38:51 +00:00
oharboe
e18e23e1b6 Added checks for target->type->read/write_memory, soft_reset_halt and run_algorithm that the target has been examined.
git-svn-id: svn://svn.berlios.de/openocd/trunk@581 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-15 18:08:36 +00:00
oharboe
5aa93a5e8a target read/write is no longer attempted for target_xxx() functions when the target has not been examined(fails w/error).
git-svn-id: svn://svn.berlios.de/openocd/trunk@580 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-15 17:03:13 +00:00
oharboe
d300ecfc8e fixed gaffe for default examine implementation
git-svn-id: svn://svn.berlios.de/openocd/trunk@567 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-11 15:49:31 +00:00
oharboe
c4a2fdbc39 Reset wip. Just adding hooks. This is just to reduce the size of the actual change, no change in behaviour.
git-svn-id: svn://svn.berlios.de/openocd/trunk@565 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-11 14:06:42 +00:00
oharboe
0d7d64b5e9 Wip - split target setup and target examination
git-svn-id: svn://svn.berlios.de/openocd/trunk@564 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-11 11:19:17 +00:00
oharboe
7805be1b3a added target->type->examine(). Eventually this will allow for bringing up telnet/gdb *before* jtag chain has been validated + it might fix some reset halt problems seen as examine() needs to run after TRST has been asserted.
git-svn-id: svn://svn.berlios.de/openocd/trunk@563 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-11 06:52:52 +00:00
oharboe
a064722743 - added "init" command. "init" and "reset" at end of startup script is equivalent
to daemon_startup(still supported).
- print warning if srst and trst change state at the same time when srst_and_trst
is seperate
- reset now performs a trst, examines and validates the jtag chain before targets
assert reset
- if startup fails to examine and validate the jtag chain, try a reset before
trying again


git-svn-id: svn://svn.berlios.de/openocd/trunk@552 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-09 05:50:34 +00:00
oharboe
2b7504c279 - only if "reset halt" or "reset init" are issued will the reset vector be set up
- If communication fails during assert between assert/deassert and during
assert, warnings are printed. The warning suggests using srst_only if the
clock locks up as that would allow the reset vector to be set up before
asserting reset.

git-svn-id: svn://svn.berlios.de/openocd/trunk@544 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-07 10:48:44 +00:00
oharboe
381dc0efab - the reset mode parameter is now DEPRECATED. It is implemented
as an optional parameter with default reset_init. This is to streamline
things w.r.t. the target library.


git-svn-id: svn://svn.berlios.de/openocd/trunk@540 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-04 14:09:03 +00:00
oharboe
35b3c95299 - reverted some of the changes that possibly broke arm926ejs. Waiting
for a bit more info before I can tell with confidence whether or not
this would have any effect.
- worked on error propagation and output for flash

git-svn-id: svn://svn.berlios.de/openocd/trunk@539 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-04 13:47:38 +00:00
oharboe
d3f0549f08 - Work on fixing erase check. Many implementations are plain broken.
Wrote a default flash erase check fn which uses CFI's target algorithm
w/fallback to memory reads. 
- "flash info" no longer prints erase status as it is stale. 
- "flash erase_check" now prints erase status. erase check can take a 
*long* time. Work in progress
- arm7/9 with seperate srst & trst now supports reset init/halt
after a power outage. arm7/9 no longer makes any assumptions
about state of target when reset is asserted.
- fixes for srst & trst capable arm7/9 with reset init/halt
- prepare_reset_halt retired. This code needs to be inside
assert_reset anyway
- haven't been able to get stm32 write algorithm to work. Fallback
flash write does work. Haven't found a version of openocd trunk
where this works.
- added target_free_all_working_areas_restore() which can
let be of restoring backups. This is needed when asserting
reset as the target must be assumed to be an unknown state.
Added some comments to working areas API
- str9 reset script fixes
- some guidelines
- fixed dangling callbacks upon reset timeout 


git-svn-id: svn://svn.berlios.de/openocd/trunk@536 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-03 14:00:17 +00:00
oharboe
b174a5b6a3 optional count argument to mwX
git-svn-id: svn://svn.berlios.de/openocd/trunk@532 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-02 06:21:24 +00:00
oharboe
86d3e74464 target_call_timer_callbacks_now() now invokes periodic callbacks immediately
git-svn-id: svn://svn.berlios.de/openocd/trunk@529 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-31 19:34:01 +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
ntfreak
4622cb15a9 - armv7m control register now set as dirty when switching context
- armv7m added core_mode to cortex_m3_debug_entry DEBUG msg
- cortex_m3 changed WARNINGS to DEBUG msg in cortex_m3_resume

git-svn-id: svn://svn.berlios.de/openocd/trunk@519 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-21 12:53:29 +00:00
oharboe
3b2a068ea9 added profile command. It was added to simplify evaluation by testers.
git-svn-id: svn://svn.berlios.de/openocd/trunk@516 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-14 11:20:46 +00:00
oharboe
7de7bc80fc - adds two speeds to jtag_speed. reset and post reset speed. Default
is post reset = reset speed.
- removed infinite loop's and exit()'s upon poor arm7/9 communication
- cleaned up error messages a bit. Push ERROR() up into fn's that
  fail and can say something meaningful about what failed.


git-svn-id: svn://svn.berlios.de/openocd/trunk@511 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-13 10:14:41 +00:00
oharboe
0424155dfc - Fixed various error handling when looking for memory leaks
- Fixed memory leak in gdb_server.c
- pushed "Error:" statements up into fn's that know something about what went wrong
- load_image now fails if target_write_memory() fails
- only issue an asynchronous halt() upon connect of GDB. Synchronous halt/reset
  doesn't really work as what's required to initialize the target might involve a
  special monitor sequence for the target in question
- syntax error handling improved(fewer exit()'s)


git-svn-id: svn://svn.berlios.de/openocd/trunk@482 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-10 12:11:07 +00:00
oharboe
c78b4fe426 - Improves error handling upon GDB connect
- switch to synchronous halt during connect. This fixes the bug
  where poll() was not invoked between halt() and servicing the
  'g' register packet
- halt() no longer returns error code when target is already halted, just
  logs a warning. Only the halt() implementation can say anything
  meaningful about why a halt() failed, so error messages are pushed
  up to halt()
- fixed soft_reset_halt infinite loop bug in arm7_9_common.c. The rest
  of the implementations are still busted.
- by using USER() instead of command_print() the log gets the 
  source + line #. Nice.
- no longer invoke exit() if soft_reset_halt fails. A reset can often 
  fix the problem.

git-svn-id: svn://svn.berlios.de/openocd/trunk@475 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-07 21:49:16 +00:00
oharboe
087ccf3b6e warnings & comments fixes.
git-svn-id: svn://svn.berlios.de/openocd/trunk@449 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-05 19:33:53 +00:00
oharboe
6d95014674 * fixed malloc corruption in target->debug_reason
* GDB remote server will now remain online even if the target
	  is in a funny state, e.g. if it requires a reset, it is
	  running while GDB is not in the continue or step packet,
	  e.g. via monitor resume/halt commands in GDB script.
	* Added some _DEBUG_GDB_IO_ debug tools
	* Fixed a couple of GDB server lockups, e.g. when O packets
	  detect a severed connection
	* added ACK upon connection (send +).
	* added keep-alive messages to reset so GDB protocol remains happy.
	* fixed crash when timing out connection to GDB

git-svn-id: svn://svn.berlios.de/openocd/trunk@445 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-05 10:28:32 +00:00
oharboe
f955b90d28 Fixed GDB timeout crash - regression introduced back when log_add/remove_callback was added.
git-svn-id: svn://svn.berlios.de/openocd/trunk@442 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-04 13:13:55 +00:00
oharboe
d3f0919233 Tweaked logging output.
TODO is retired(hopelessly out of date).

git-svn-id: svn://svn.berlios.de/openocd/trunk@400 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-29 15:32:07 +00:00
oharboe
3a3fc30014 - clean up target output strings a bit
- open_file_from_path() now uses logging feature
- open_file_from_path() no longer uses paths for anything but "r" mode. Fixes 
  bug  waiting to happen.


git-svn-id: svn://svn.berlios.de/openocd/trunk@389 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-29 11:31:49 +00:00
oharboe
4febcd8313 Michael Bruck:
arm11

--- Added burst memory transfer mode

This does not explicitly query command execution but rather uses a small
delay produced by the FT2232 on certain TAP commands.

A potential failure of this process is detected afterwards and the
program terminates with an error.

'arm11 memwrite burst disable'
  can be used to switch this feature off.

'arm11 memwrite error_fatal disable'
  can be used to prevent the program to exit on an memory write error


--- Added support for interrupt breaking via VCR register

Use 'arm11 vcr' command to set.


--- Cleaned up the handling of

halt/resume/step/poll, target->state, target->debug_reason,
target_call_event_callbacks() at least as far as I could guess the
intended behaviour from other targets.

Did some overall positive tests with GDB.


--- Added support for breakpoints

Hardware breakpoints only. All breakpoints will be treated as hardware
breakpoints.

All ARM11's seem to have at least 6 hardware breakpoints.

--- Stepping over BKPT added

Modification to PC without touching the target.

--- Stepping over a B or BL to self will do nothing


git-svn-id: svn://svn.berlios.de/openocd/trunk@385 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-29 07:03:28 +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
oharboe
e482118106 - using ERROR_COMMAND_SYNTAX_ERROR to print syntax in a couple of places
- some more flash cleanup of checking halted state
- moved output handler into options.c
- very slightly tweaked server.c to make it a bit more compatible with eCos
- retired arch_state. Not quite sure how I managed to leave that out last time.

git-svn-id: svn://svn.berlios.de/openocd/trunk@338 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-25 07:50:03 +00:00
oharboe
1aa854684d - fixed target->type->poll() return value
- added arch_state to show status of currently selected target
- simplified target->type->arch_state() api.
- clean up telnet output a bit
- fixed GDB output for arch_state
- removed a couple of unecessary exit()'s
- cleaned up error propagation a bit in a few places

git-svn-id: svn://svn.berlios.de/openocd/trunk@332 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-24 18:52:45 +00:00
vpalatin
3c58540e02 - fix read/write size for small unaligned accesses (thanks Michael Bruck)
git-svn-id: svn://svn.berlios.de/openocd/trunk@318 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-22 16:43:13 +00:00
vpalatin
5cc4601c5f - add support for Marvell Feroceon (thanks to Nicolas Pitre for this patch)
git-svn-id: svn://svn.berlios.de/openocd/trunk@315 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-21 11:43:04 +00:00
ntfreak
95df797b2e - add search paths via new arg -s (-search). Thanks Ted Roth
- updated docs for new command

git-svn-id: svn://svn.berlios.de/openocd/trunk@312 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-19 20:04:57 +00:00
ntfreak
5c0e8efa05 - Fixed bug in pathmove for XScale
- added virtual address to working_area.
- Improved error messages in a number of places
- Added ERROR_COMMAND_SYNTAX_ERROR that commands can return to have syntax printed
- Added help for some config commands
- Added verification of sw breakpoints with ERROR() message
- Removed a couple of exit()'s and replaced with error message
- cosmetic fix to armv4_5.c, easier to read
- added polymorphic(with default) virt2phys and mmu enable query function to target.h
- added virt2phys command that uses target->type->virt2phys() fn
Thanks to Øyvind Harboe

git-svn-id: svn://svn.berlios.de/openocd/trunk@310 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-19 19:26:17 +00:00
ntfreak
a92d27afb0 - Added a "User:" debug level. These are messages that are intended for the user and are part of normal operation.
- Faster DEBUG/INFO() when they are disabled
- target_read/write_buffer() now uses 16 and 32 bit access for single word aligned requests. Other requests are serviced as quickly as possible.
- *much* faster read/write GDB packets, removing timeout problems.
- GDB read/write packets w/single word aligned 32/16 bit access now use 32/16 bit word access.
- working area can now be changed on the fly. Provides a way to move working area about as MMU is enabled/disabled.
- cleaned up error messages for verify_image.
Thanks Øyvind Harboe

git-svn-id: svn://svn.berlios.de/openocd/trunk@302 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-18 14:32:43 +00:00
ntfreak
70b2de2a63 - added synchronous wait/resume patch. Thanks Øyvind Harboe
- updated docs for halt and wait_halt and resume commands

git-svn-id: svn://svn.berlios.de/openocd/trunk@285 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-09 11:44:17 +00:00
ntfreak
da2bbc90fc - added synchronous reset patch, Thanks Øyvind Harboe
- added target_init_reset which calls target_process_reset after all drivers have been initialised

git-svn-id: svn://svn.berlios.de/openocd/trunk@284 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-07 20:20:11 +00:00
mifi
57b5028c63 - added patch to solve the reset problem with arm9 and cortex which Spen had found.
https://lists.berlios.de/pipermail/openocd-development/2008-January/000729.html

(Thanks to Spen for the patch)

git-svn-id: svn://svn.berlios.de/openocd/trunk@279 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-02 13:42:37 +00:00
ntfreak
8d6292d9a0 fixed incorrect elf segment size - Thanks Øyvind Harboe
git-svn-id: svn://svn.berlios.de/openocd/trunk@277 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-01-25 18:09:21 +00:00
mifi
080b2e3f2f - added patch to check some malloc problems.
(thanks to Øyvind Harboe for the patch)

git-svn-id: svn://svn.berlios.de/openocd/trunk@276 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-01-24 21:04:09 +00:00
mifi
651ba91465 - added patch to fix crash in load_image on corrupt elf file or out of memory.
(thanks to Øyvind Harboe for the patch)

git-svn-id: svn://svn.berlios.de/openocd/trunk@274 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-01-23 19:28:10 +00:00
bodylove
db3d66f951 - Eleminated leading tabs/white space
git-svn-id: svn://svn.berlios.de/openocd/trunk@268 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-01-21 19:34:45 +00:00
ntfreak
68b97e4b5c - add support for cortex_m3 target_request debugmsgs
- target request handler disabled by default until a target has been registered

git-svn-id: svn://svn.berlios.de/openocd/trunk@259 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-01-17 12:45:06 +00:00
ntfreak
6c9b804d61 - minimum autoconf 2.59 is now required and verified - due to issues with AS_HELP_STRING
- native win32 now handles WSAECONNRESET - no longer exits openocd
- qCRC packet now works correctly under cygwin (gdb compare-sections command)
- removed __USE_GNU define from gdbserver.c
- gdb qSupported packet is now handled, with this we are able to tell gdb packet size, memory map of target
- added new target script gdb_program_config - called before gdb flash programming
- new gdb server command gdb_memory_map (enable|disable> - default is disable
- new gdb server command gdb_flash_program (enable|disable> - default is disable
- gdb flash programming supported - vFlash packets
- image_elf_read_section now does not clear any remaining data, this was causing the gdb checksum to fail with certain files
- reformat of usbprog.c
- memory leak in command_print fixed
- updated texi doc to include new commands
- added gdb programming section to docs

git-svn-id: svn://svn.berlios.de/openocd/trunk@246 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-12-29 13:51:48 +00:00
ntfreak
55f2fe830a - removed flash write_image - binary compare function has been moved to verify_image command
- minor code reformat and cleanup
- updated docs to include new commands

git-svn-id: svn://svn.berlios.de/openocd/trunk@243 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-12-20 16:19:10 +00:00
mifi
9e6cec0dd3 - added patch to display device information as INFO too
- added patch which fixes a crash upon flash write error
- added patch which will improve the reset handling when 
  SRST is tied to TRST

(thanks to Oyvind Harboe for these patches)

git-svn-id: svn://svn.berlios.de/openocd/trunk@218 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-12-09 15:36:21 +00:00
ntfreak
e27696f6b0 - add verify_image command
- add support for gdb qCRC packet (compare-sections command)

git-svn-id: svn://svn.berlios.de/openocd/trunk@210 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-10-22 08:44:34 +00:00
ntfreak
ce8768f463 - cleaned up str7, str9 and stm32 flash drivers
- str7 flash driver now checks correct busy bits depending on device
- str9 flash driver now disables ITCM order as per st programming manual
- added str7 disable_jtag command
- added gdb_detach command
- updated arm966e cp15 support
- fix crash on mingw build when enabling target_request debugmsgs

git-svn-id: svn://svn.berlios.de/openocd/trunk@209 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-10-08 13:12:39 +00:00
mlu
ed36a8d15d - Fixed display of sector sizes in flash.c
- Clean up, remove unused variables and code in armv7, cortex_m3 and stellaris code 
- Move restore_context from cortex_m3 to armv7m
- Updated halt handling for cortex_m3


git-svn-id: svn://svn.berlios.de/openocd/trunk@206 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-09-10 17:43:08 +00:00
drath
29000b204d - reworked presto.c to allow use of either FTD2XX or libftdi (libftdi not functional yet). Configure option changed from --enable-presto to
--enable-presto_ftd2xx and --enable-presto_libftdi
- completed trace point support for use with ARM7/9 DCC
- completed debug message output with support for HEX dumps (1, 2 or 4 byte quantities)
- fixed bug in delete_debug_msg_receiver (thanks to Pavel Chromy)
- fixed bug in image_add_section (thanks to Pavel Chromy)
- at91sam7 sector erase reworked (thanks to Pavel Chromy)
- merge consecutive sections during flash image write to work around possible section alignment issues with LPC2000 targets



git-svn-id: svn://svn.berlios.de/openocd/trunk@194 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-08-14 09:48:54 +00:00
drath
20e4e77cdf - renamed M5960 USB JTAG to "flyswatter"
- make ep93xx and at91rm9200 bitbang JTAG interfaces dependant on ARM host (thanks to Vincent Palatin)
- various whitespace fixes
- removed various warnings
- add support for Debian GNU/kFreeBSD (thanks to Uwe Hermann)
- fix OpenOCD compilation for various platforms (thanks to Uwe Hermann and Vincent Palatin)
- switched order of JTAG chain examination and validation (examine first, then multiple validation tries even if examination failed)
- added target_request subsystem to handle requests from the target (debug messages and tracepoints implemented, future enhancements might include
semihosting, all ARM7/9 only for now)
- added support for GDB vFlashXXX packets (thanks to Pavel Chromy)
- added support for receiving data via ARM7/9 DCC
- reworked flash writing. the 'flash write' command is now deprecated and replaced by 'flash write_binary' (old syntax and behaviour) and 'flash
write_image' (write image files (bin, hex, elf, s19) to a target).
- added support for AMD/ST/SST 29F400B non-cfi flashes



git-svn-id: svn://svn.berlios.de/openocd/trunk@190 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-08-10 19:44:06 +00:00
ntfreak
f251b925ff - motorola s19 file loader added
- added checksum support to intel hex file loader
- elf file loader now ignores any bss sections
- mingw build now always opens files in binary mode

git-svn-id: svn://svn.berlios.de/openocd/trunk@185 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-07-31 09:15:59 +00:00
drath
290e01c62a - reformat src/jtag/bitq.c (thanks to Pavel Chromy)
- fix multiple reads from FT2232 into same buffer location (thanks to Magnus Lundin)
- retry JTAG chain validation (thanks to Magnus Lundin)
- reworked GDB packet input handling (thanks to Pavel Chromy)
- output error message when setting a watchpoint failed
- removed duplicate out-of-bounds check in at91sam7.c (thanks to Pavel Chromy)


git-svn-id: svn://svn.berlios.de/openocd/trunk@181 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-07-25 10:06:57 +00:00
ntfreak
8c290412d2 - ST STM32x cortex support added
- ST STM32x flash support added
- cleaned up armv7m and cortex-m3 support, removed luminary specific code
- cortex-m3 16bit read/write added (required for STM32x flash programming)

git-svn-id: svn://svn.berlios.de/openocd/trunk@177 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-06-24 15:04:07 +00:00
ntfreak
4b97f3cbb9 - added mingw elf patches from Vincent Palatin
- added str9x programming using flash controller tap (str9xpec), including option bytes and device lock/unlock
- inttypes.h now used for long long printf style declarations

git-svn-id: svn://svn.berlios.de/openocd/trunk@174 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-06-16 14:45:55 +00:00
drath
09883194f8 - merged support for Cortex-M3 from cortex-m3 branch (thanks to Magnus Lundin)
git-svn-id: svn://svn.berlios.de/openocd/trunk@170 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-06-14 14:48:22 +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
7087b66f19 - add support for ELF images (thanks to Vincent Palatin for this patch)
git-svn-id: svn://svn.berlios.de/openocd/trunk@161 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-05-31 11:17:54 +00:00
drath
f94d66d7c5 - reworked image handling to support multiple sections (tested with ihex file containing gaps)
This checkin is still experimental, not recommended for general use



git-svn-id: svn://svn.berlios.de/openocd/trunk@159 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-05-30 15:47:18 +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
04dc98916d - explicitly disable monitor mode on ARM7/9 targets
- added "prepare_reset_halt()" to target_type_t, which allows reset_halt to be prepared before a reset is asserted, possibly preventing communication with the target
- arm7/9 devices now use a breakpoint at 0x0 or reset vector catching for debug out of reset


git-svn-id: svn://svn.berlios.de/openocd/trunk@141 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-04-16 14:58:16 +00:00
drath
4a5f45e87d - merged XScale branch back into trunk
- fixed some compiler warnigns in amt_jtagaccel.c, bitbang.c, parport.c
- free working area and register stuff if str7x block write algorithm failed
- check PC after exiting a target algorithm in armv4_5.c


git-svn-id: svn://svn.berlios.de/openocd/trunk@135 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-03-28 16:31:55 +00:00
drath
5ed126c4f9 - fixed arm926 cp15 command bug (thanks to Vincent Palatin for this patch)
- fixed compiler warnings throughout the code (thanks to Vincent Palatin for this patch)
- added support for accessing ETB (embedded trace buffer) registers


git-svn-id: svn://svn.berlios.de/openocd/trunk@134 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-03-26 21:47:26 +00:00
drath
cb58279653 - reworked file i/o. every fileaccess (target, flash, nand, in future configuration, too) should now go through the fileio subsystem
- added support for reading IHEX files (through fileio)
- load/dump_binary renamed to the more generic load/dump_image <file> <address> ['bin'|'ihex']
- added NAND framework (preliminary)
- added support for the LPC3180 SLC and MLC NAND controllers (preliminary)
- fix initialization for parport
- gw16012 fixes/cleanups
- added EmbeddedICE version 7 (preliminary, reported on two LPC23xx devices so far)
- added 'arm7_9 etm <target#>' configuration command to enable access to the ETM registers


git-svn-id: svn://svn.berlios.de/openocd/trunk@132 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-03-15 13:36:44 +00:00
drath
81e8e44cf0 - Added support for ARM926EJ-S based cores
- Added contributors to AUTHORS file
- Added link to Joern Kaipf's OOCD-Link


git-svn-id: svn://svn.berlios.de/openocd/trunk@126 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-01-25 10:30:42 +00:00
drath
4fc97d3f27 - fix incorrect parsing of whitespace in command.c (thanks to Magnus Lundin)
- fix infinite recursion in target_init_handler (thanks to jw and Magnus Lundin)
- fix CFI flash handlign with buswidth < 32bit (thanks to Daniele Orio for reporting this)
- add support for reading JTAG device id (currently only as debug output on startup)
- cleaned up handling of EmbeddedICE registers. Supported functionality and register size now determined by EmbeddedICE version number.
- small cleanups/fixes


git-svn-id: svn://svn.berlios.de/openocd/trunk@124 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-01-22 14:47:00 +00:00
drath
83440065c0 - correctly enter debug state on a "soft_reset_halt" command
- several small fixes
- retry reading from a FT2232 device on incomplete reads


git-svn-id: svn://svn.berlios.de/openocd/trunk@110 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2006-11-05 17:38:35 +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
3acb107b9a - endianess fixes everywhere but in the flash code. flashing might still be broken on big-endian targets and/or hosts
- added access to ARM920T vector catch register (via generic register mechanism)
- don't disable linefills on ARM920T cores - this lead to lockups when accessing lines already contained in cache
- read content of ARM920T cache and tlb into file (arm920t read_flash/read_mmu commands)
- memory reading improved on ARM7/9, can be further accelerated with new "arm7_9 fast_memory_access enable" command (renamed from fast_writes)
- made in_handler independent from in field (makes the handler more flexible)
- added timeout to ft2232 when using D2XX library
- fixed STR7x protection bit handling on second bank (thanks to Bernard)
- added support for using the OpenOCD on AT91RM9200 systems (thanks to Anders Larsen)
- fixed AT91SAM7 flash handling when not running from 32kHz clock (thanks to Anders Larsen)


git-svn-id: svn://svn.berlios.de/openocd/trunk@90 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2006-08-31 12:41:49 +00:00
drath
da9eedc0f2 - made bp command more verbose
- fixed bug that could result in register corruption on arm920t targets


git-svn-id: svn://svn.berlios.de/openocd/trunk@89 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2006-08-20 15:10:32 +00:00
drath
fbf5bec7f3 - fixed a minor problem with the GDB server that could drop the first packet (non-fatal)
- fixed some small memory leaks (thanks to Spencer Oliver)
- verify chip- and buswidth of cfi flash configurations
- added support for ARM966E based systems (tested only with ST micro STR9, thanks to Spencer Oliver)


git-svn-id: svn://svn.berlios.de/openocd/trunk@81 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2006-08-06 11:20:42 +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
ef139a3a5e - added support for AT91SAM7A3 flash (patch from andre renaud, thanks)
- fix trunk build for mac os x (patch from Lauri Leukkunen, thanks)
- added check for host endianness, defines WORDS_BIGENDIAN on a big-endian host (e.g. mac os-x)
- fixed bug where endianness of memory accesses could be swapped on BE hosts
- added space for zero termination of ftd2xx_layout string (from Magnus Ludin, tahnks)


git-svn-id: svn://svn.berlios.de/openocd/trunk@73 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2006-06-23 07:54:01 +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