aboutsummaryrefslogtreecommitdiff
path: root/src/openocd.c
AgeCommit message (Collapse)Author
2013-06-05update files to correct FSF addressSpencer Oliver
Change-Id: I429f7fd51f77b0e7c86d7a7f110ca31afd76c173 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1426 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2012-07-22Revert "When calling openocd from a shell like this:"Alex Austin
This reverts commit e8641695c634109ebf5f1149923971770da1d28a Original premise was wrong. Proper command is "shutdown", not "exit". Change-Id: I07f5fe0dda9c24abe53628da986bfda0e406bb4a Signed-off-by: Alex Austin <alex.austin@spectrumdsi.com> Reviewed-on: http://openocd.zylin.com/757 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2012-07-11When calling openocd from a shell like this:Stian Skjelsad
openocd -f board/sheevaplug.cfg -c init -c exit the calling shell will believe that openocd exited with an error due to exitval will be non-zero This is not tested against incomming telnet Change-Id: I63d15715a7b46f39a7de261a45039f8c3cad7a98 Signed-off-by: Stian Skjelstad <stian@nixia.no> Reviewed-on: http://openocd.zylin.com/470 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Bill Traynor <wmat@alphatroop.com> Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-02-06build: cleanup src/ directorySpencer Oliver
Change-Id: Ia6ed99ce75625ad6ef5e0d3c3bbdc1c1bec21df3 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/407 Tested-by: jenkins
2012-01-04command: print BUG warning when usage is missingMathias K
These error messages will prompt patches to be submitted for missing .usage or empty fields. All of the below must be resolved before next release. The Jim defined commands are excluded from this checklist because the help text can be set later than during command registration. strlen(.usage) == 0 means that the command expects no arguments. Updates to this patch in Gerrit to fix problems below are most welcome. Anyone can push updated versions of a patch to Gerrit. If there are no further updates to this patch within a week, it will be pushed to the master branch to prompt more fixes. These were caught by launching OpenOCD. Error: BUG: command 'command' does not have the '.usage' field filled out Error: BUG: command 'script' does not have the '.usage' field filled out Error: BUG: command 'power_restore' does not have the '.usage' field filled out Error: BUG: command 'srst_deasserted' does not have the '.usage' field filled out Error: BUG: command 'measure_clk' does not have the '.usage' field filled out Error: BUG: command 'exit' does not have the '.usage' field filled out Error: BUG: command 'shutdown' does not have the '.usage' field filled out Error: BUG: command 'gdb_sync' does not have the '.usage' field filled out Error: BUG: command 'interface_list' does not have the '.usage' field filled out Error: BUG: command 'target' does not have the '.usage' field filled out Error: BUG: command 'target init' does not have the '.usage' field filled out Error: BUG: command 'flash' does not have the '.usage' field filled out Error: BUG: command 'flash init' does not have the '.usage' field filled out Error: BUG: command 'flash banks' does not have the '.usage' field filled out Error: BUG: command 'nand' does not have the '.usage' field filled out Error: BUG: command 'nand drivers' does not have the '.usage' field filled out Error: BUG: command 'nand init' does not have the '.usage' field filled out Error: BUG: command 'pld' does not have the '.usage' field filled out Error: BUG: command 'pld init' does not have the '.usage' field filled out Error: BUG: command 'mflash' does not have the '.usage' field filled out Error: BUG: command 'mflash init' does not have the '.usage' field filled out Error: BUG: command 'dummy' does not have the '.usage' field filled out Error: BUG: command 'dummy foo' does not have the '.usage' field filled out Error: BUG: command 'scan_chain' does not have the '.usage' field filled out Error: BUG: command 'jtag' does not have the '.usage' field filled out Error: BUG: command 'jtag init' does not have the '.usage' field filled out Error: BUG: command 'arm' does not have the '.usage' field filled out Error: BUG: command 'arm reg' does not have the '.usage' field filled out Error: BUG: command 'etm' does not have the '.usage' field filled out Error: BUG: command 'arm7_9' does not have the '.usage' field filled out Error: BUG: command 'at91eb40a.cpu' does not have the '.usage' field filled out Error: BUG: command 'at91eb40a.cpu arm' does not have the '.usage' field filled out Error: BUG: command 'arm reg' does not have the '.usage' field filled out Error: BUG: command 'at91eb40a.cpu etm' does not have the '.usage' field filled out Error: BUG: command 'at91eb40a.cpu arm7_9' does not have the '.usage' field filled out Error: BUG: command 'target_request' does not have the '.usage' field filled out ^C oyvind@fierce:~/openocd$ openocd -c "interface dummy" -f board/at91eb40a.cfg 2>&1 | grep -w BUG Error: BUG: command 'command' does not have the '.usage' field filled out Error: BUG: command 'script' does not have the '.usage' field filled out Error: BUG: command 'power_restore' does not have the '.usage' field filled out Error: BUG: command 'srst_deasserted' does not have the '.usage' field filled out Error: BUG: command 'measure_clk' does not have the '.usage' field filled out Error: BUG: command 'exit' does not have the '.usage' field filled out Error: BUG: command 'shutdown' does not have the '.usage' field filled out Error: BUG: command 'gdb_sync' does not have the '.usage' field filled out Error: BUG: command 'interface_list' does not have the '.usage' field filled out Error: BUG: command 'target' does not have the '.usage' field filled out Error: BUG: command 'target init' does not have the '.usage' field filled out Error: BUG: command 'flash' does not have the '.usage' field filled out Error: BUG: command 'flash init' does not have the '.usage' field filled out Error: BUG: command 'flash banks' does not have the '.usage' field filled out Error: BUG: command 'nand' does not have the '.usage' field filled out Error: BUG: command 'nand drivers' does not have the '.usage' field filled out Error: BUG: command 'nand init' does not have the '.usage' field filled out Error: BUG: command 'pld' does not have the '.usage' field filled out Error: BUG: command 'pld init' does not have the '.usage' field filled out Error: BUG: command 'mflash' does not have the '.usage' field filled out Error: BUG: command 'mflash init' does not have the '.usage' field filled out Error: BUG: command 'dummy' does not have the '.usage' field filled out Error: BUG: command 'dummy foo' does not have the '.usage' field filled out Error: BUG: command 'scan_chain' does not have the '.usage' field filled out Error: BUG: command 'jtag' does not have the '.usage' field filled out Error: BUG: command 'jtag init' does not have the '.usage' field filled out Error: BUG: command 'arm' does not have the '.usage' field filled out Error: BUG: command 'arm reg' does not have the '.usage' field filled out Error: BUG: command 'etm' does not have the '.usage' field filled out Error: BUG: command 'arm7_9' does not have the '.usage' field filled out Error: BUG: command 'at91eb40a.cpu' does not have the '.usage' field filled out Error: BUG: command 'at91eb40a.cpu arm' does not have the '.usage' field filled out Error: BUG: command 'arm reg' does not have the '.usage' field filled out Error: BUG: command 'at91eb40a.cpu etm' does not have the '.usage' field filled out Error: BUG: command 'at91eb40a.cpu arm7_9' does not have the '.usage' field filled out Error: BUG: command 'target_request' does not have the '.usage' field filled out Change-Id: I2c3e529530a15d2295a1950ffc59e8f2fc661012 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Signed-off-by: Mathias K <kesmtp@freenet.de> Reviewed-on: http://openocd.zylin.com/299 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-12-02openocd.c: whitespace cleanupSpencer Oliver
Change-Id: Ieb8c1e4eb72f66a6343b169a12a058555d67069e Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/242 Tested-by: jenkins
2011-11-23target: fix init_targets script handlingSpencer Oliver
This fixes an issue when init is called before init_targets has been executed. Make sure init_targets is called before init. Change-Id: Icd5bd4c2a8eea2e399d9de4e331a77560e9672ac Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/235 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2011-10-11replace berlios url's with sourceforge url'sSpencer Oliver
Change-Id: I1c9957bb64df87cee7c5e832f21453eb8934a5fb Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2011-08-14jimtcl: delete OpenOCD's broken 'stacktrace' commandØyvind Harboe
Use "info stacktrace" instead. This fixes build problems with latest Jim Tcl.
2011-06-16OPENOCD: Renamed ambiguous main2() into openocd_thread() to show possible ↵Tomek CEDRO
solution for thread support in future.
2011-06-13transport: move files over to transport folderØyvind Harboe
as we introduce swd and jtag as two transports, we want to start up with a new transport folder to organize the code a bit.
2011-03-31startup: fix bugs in cleanup upon errors during startupØyvind Harboe
Importantly adapter cleanup will now happen upon startup failure. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-12-29Compilation Warnings on OS X 10.5Andrew MacIsaac
I received a number of "-Wshadow" related warnings (treated as errors) while trying to build on OS X Leopard. In addition, there were two miscellaneous other warnings in the flash drivers. Attached are two patches which correct these issues and the commit messages to accompany them. My system has the following configuration (taken from uname -a): Darwin 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386 === Werror_patch.txt Commit Message === compilation: fixes for -Wshadow warnings on OS X These changes fix -Wshadow compilation warnings on OS X 10.5.8 Compiled with the following configure command: ../configure --prefix=/usr/local --enable-maintainer-mode --enable-jlink --enable-ft2232_libftdi === flash_patch.txt Commit Message === compilation: fixes for flash driver warnings on OS X These changes fix two compilation warnings on OS X 10.5.8: ../../../../src/flash/nor/at91sam3.c:2767: warning: redundant redeclaration of 'at91sam3_flash' ../../../../src/flash/nor/at91sam3.c:101: warning: previous declaration of 'at91sam3_flash' was here and ../../../../src/flash/nor/stmsmi.c:205: warning: format not a string literal and no format arguments Compiled with the following configure command: ../configure --prefix=/usr/local --enable-maintainer-mode --enable-jlink --enable-ft2232_libftdi === Andrew
2010-12-22config: add init_targets proc that is executed just before initØyvind Harboe
this allows configuration scripts to export a init_targets proc rather than setting up the target directly. This allows for new conventions in how to set up target vs. board script and how to transfer default settings between board and target scripts. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-11-15httpd: retire this serverØyvind Harboe
this never panned out and there are enough mistakes in the code that probably nobody used this. Use the tcl server and implement a standalone http app instead works fine. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-12helper: add stacktrace command that returns error stacktraceØyvind Harboe
Ability to access the stacktrace from a script is quite handy. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-11version command: make it scriptableØyvind Harboe
you can now set a variable in a script like set version [version]. Also version takes an optional argument "git" to show git version of source. If git is not installed during the build, then this will yield an error that is ignored during the build and "version git" returns an empty string. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-08-01util: ms command to calculate length of operationsØyvind Harboe
This can be used to calculate approximate RTCK frequency for instance. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-07-05transport: fix segfault in setup_command_handler()Stacey Sheldon
Commit 93f2afa45f4c dropped the sentinel off the end of the command_registrants[] array. The loop immediately following the initialization will walk right off the end. Signed-off-by: Stacey Sheldon <stac@solidgoldbomb.org>
2010-07-02initial "transport" frameworkDavid Brownell
This adds the guts of a transport framework with initialization, which should work with current JTAG-only configurations (tested with FT2232). Each debug adapter can declare the transports it supports, and exactly one transport is initialized. (with its commands) in any given OpenOCD session. * Define a new "struct transport with init hooks and a few "transport" subcommands to support it: "list" ... list the transports configured (just "jtag" for now) "select" ... makes the debug session use that transport "init" ... initializes the selected transport (internal) * "interface_transports" ... declares transports the current interface can support. (Some will do this from C code instead, when there are no hardware versioning (or other) issues to prevent it. Plus some FT2232 tweaks, including a few to streamline upcoming support for an SWD transport (initially for Luminary adapters). Eventually src/jtag should probably become src/transport, moving jtag-specific stuff to transport/jtag. Signed-off-by: David Brownell <db@helium.(none)>
2010-06-23openocd: setup_command_handler() must not be staticØyvind Harboe
when OpenOCD is linked with an app this fn can be used from the outside. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-21openocd.c: review scope of symbolsAntonio Borneo
Add "static" qualifier to private data. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-04-10OPENOCD: review scope of functionsAntonio Borneo
Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-03-17SCRIPT: add add_script_search_dir cmdSpencer Oliver
Add a add_script_search_dir cmd so that adding search dir's can be added to cfg scripts. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-03-14rename jtag_interface_{init,quit}()David Brownell
These routines apply to non-JTAG debug adapters too. To reduce confusion, give them better (non-misleading) names. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-03-11split "interface" commands from "jtag" onesDavid Brownell
We'll need to be able to work with debug adapter interfaces (drivers) even when they're not used for JTAG ... for example, while there are multi-transport drivers which support JTAG *and* several other transports (or just one more, like SWD) there are also adapters with more limited goals (and no JTAG support at all). Start decoupling the two concepts ("debug adapter driver", "jtag") by having two command groups, which initialize separately. This will help us support OpenOCD sessions using only non-JTAG transports, in which JTAG commands should not be registered. Update docs to mention that the JTAG, SVF, and XSVF commands won't work without a JTAG transport. Note that at least commands working with SRST are still inappropriately coupled to JTAG ... inappropriate because (a) SRST is not part of the JTAG standard, for all that many platforms (like ARM) expect it; and also (b) because they're used with non-JTAG debug and programming interfaces, too. They should perhaps become generic "interface" operations at some point. (Similarly with the clock rate to be used by a given adapter.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-03-08move a constant table to .rodata sectionDavid Brownell
The table of command registration functions shouldn't be in writable memory, where stray pointers can clobber it. Also, it shouldn't be initialized at runtime; that just consumes needless code space. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-02-15gpl: fix GPL startup messageØyvind Harboe
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-12-11server: add server_preinit which is called before config file is parsed.Spencer Oliver
This fixes the issue under native win32 of the socket interface not being enabled (via WSAStartup) before init is called from a script. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2009-12-04rename nand.h to flash//nand/core.hZachary T Welch
Rename nand.h as flash/nand/core.h, chase consumers. The public APIs need to be sorted out with imp.h, but this allows other changes to begin improving the separation between policy and mechanism. Moves #include <target/target.h> and #include "driver.h" into the internal headers or source files, removing it from <flash/nand/core.h>.
2009-12-04remove flash.h from treeZachary T Welch
Remove the now vestigial <flash/flash.h> header from the tree, replacing a few references with <flash/nor/core.h>
2009-12-04split NOR and NAND flash headersZachary T Welch
Moves common flash errors to <flash/common.h> to decouple these two mostly unrelated trees of code.
2009-12-04check top-level command registrationsZachary T Welch
When calling module_register_commands, the return value needs to be checked for failures. Instead of duplicating code, use an array of function pointers to the identical registration functions to iterate over during startup.
2009-12-03fix another init regressionDavid Brownell
This makes Beagle work again, instead of losing horribly because the JTAG event handlers are no longer able to e.g. "runtest". I get the previous quirky behavior ... comes up OK but "reset halt" somewhat mysteriously makes it all better. (Instead of nothing being able to work at all...) However, I'm still seeing: The 'init' command must be used before 'init'. That seems to come from invoking "jtag init", sometime after it gets mapped to "ocd_jtag init", according to debug message traces. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-03fix double 'init' regressionZachary T Welch
To prevent regression in the behavior of 'init', we allow it to run in any mode. If provided with -c init and with -c noinit, then the second init at startup caused a spurious mode failure. Let 'init' handle it.
2009-12-03change #include "xsvf.h" to <xsvf/xsvf.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "xsvf.h" the following form should be used. #include <xsvf/xsvf.h> The exception is from .c files in the same directory.
2009-12-03change #include "svf.h" to <svf/svf.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "svf.h" the following form should be used. #include <svf/svf.h> The exception is from .c files in the same directory.
2009-12-03change #include "pld.h" to <pld/pld.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "pld.h" the following form should be used. #include <pld/pld.h> The exception is from .c files in the same directory.
2009-12-03change #include "server.h" to <server/server.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "server.h" the following form should be used. #include <server/server.h> The exception is from .c files in the same directory.
2009-12-03change #include "httpd.h" to <server/httpd.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "httpd.h" the following form should be used. #include <server/httpd.h> The exception is from .c files in the same directory.
2009-12-03change #include "gdb_server.h" to <server/gdb_server.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "gdb_server.h" the following form should be used. #include <server/gdb_server.h> The exception is from .c files in the same directory.
2009-12-03change #include "nand.h" to <flash/nand.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "nand.h" the following form should be used. #include <flash/nand.h> The exception is from .c files in the same directory.
2009-12-03change #include "mflash.h" to <flash/mflash.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "mflash.h" the following form should be used. #include <flash/mflash.h> The exception is from .c files in the same directory.
2009-12-03change #include "jtag.h" to <jtag/jtag.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "jtag.h" the following form should be used. #include <jtag/jtag.h> The exception is from .c files in the same directory.
2009-12-03change #include "ioutil.h" to <helper/ioutil.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "ioutil.h" the following form should be used. #include <helper/ioutil.h> The exception is from .c files in the same directory.
2009-12-03change #include "configuration.h" to <helper/configuration.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "configuration.h" the following form should be used. #include <helper/configuration.h> The exception is from .c files in the same directory.
2009-12-02remove #if BUILD_HTTPDZachary T Welch
Add httpd_stubs.c to provide no-op implementations of httpd_start() and httpd_stop(). Allows these routines to be called unconditionally and ensures the libocdserver ABI remains unchanged regardless of whether this feature was built-in or not. Prints a DEBUG message when the stub implementation is included.
2009-12-02remove BUILD_IOUTIL symbolZachary T Welch
Add ioutil_stubs.c to provide an empty ioutil_init() routine. Add ioutil.h to prevent applications from needing to declare it. Allows unconditionally calling that function during startup, and the resulting libocdhelper library API is now more stable. Prints a DEBUG message when the stub implementation is included.
2009-12-02remove #if logic for openocd_sleep_*ludeZachary T Welch
Adds server_stubs.c to hold these routines, using automake logic to ensure it gets included under the right conditions.
2009-12-02target: factor init to 'target init'Zachary T Welch
Adds 'target init' command handler, called as part of 'init'.