aboutsummaryrefslogtreecommitdiff
path: root/src/openocd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/openocd.c')
-rw-r--r--src/openocd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/openocd.c b/src/openocd.c
index 8862284..83c3545 100644
--- a/src/openocd.c
+++ b/src/openocd.c
@@ -38,9 +38,11 @@
#include <pld/pld.h>
#include <target/arm_cti.h>
#include <target/arm_adi_v5.h>
+#include <rtt/rtt.h>
#include <server/server.h>
#include <server/gdb_server.h>
+#include <server/rtt_server.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
@@ -230,10 +232,7 @@ static int openocd_register_commands(struct command_context *cmd_ctx)
struct command_context *global_cmd_ctx;
-/* NB! this fn can be invoked outside this file for non PC hosted builds
- * NB! do not change to 'static'!!!!
- */
-struct command_context *setup_command_handler(Jim_Interp *interp)
+static struct command_context *setup_command_handler(Jim_Interp *interp)
{
log_init();
LOG_DEBUG("log_init: complete");
@@ -247,6 +246,7 @@ struct command_context *setup_command_handler(Jim_Interp *interp)
&server_register_commands,
&gdb_register_commands,
&log_register_commands,
+ &rtt_server_register_commands,
&transport_register_commands,
&interface_register_commands,
&target_register_commands,
@@ -338,6 +338,9 @@ int openocd_main(int argc, char *argv[])
if (ioutil_init(cmd_ctx) != ERROR_OK)
return EXIT_FAILURE;
+ if (rtt_init() != ERROR_OK)
+ return EXIT_FAILURE;
+
LOG_OUTPUT("For bug reports, read\n\t"
"http://openocd.org/doc/doxygen/bugs.html"
"\n");
@@ -367,6 +370,7 @@ int openocd_main(int argc, char *argv[])
/* Shutdown commandline interface */
command_exit(cmd_ctx);
+ rtt_exit();
free_config();
if (ERROR_FAIL == ret)