From d50dd5ab9567cc308e412c5e9e775dc8e15fb509 Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan Date: Fri, 3 Feb 2012 23:57:04 +0100 Subject: merge armdebug rc1 This enables the use of GDB or GDB based debuggers to debug the code running on the NXT brick using the USB connection. --- AT91SAM7S256/Source/c_comm.c | 14 ++++++++++++++ AT91SAM7S256/Source/c_comm.h | 3 +++ 2 files changed, 17 insertions(+) (limited to 'AT91SAM7S256/Source') diff --git a/AT91SAM7S256/Source/c_comm.c b/AT91SAM7S256/Source/c_comm.c index ee0c6ae..1411b5d 100644 --- a/AT91SAM7S256/Source/c_comm.c +++ b/AT91SAM7S256/Source/c_comm.c @@ -26,6 +26,9 @@ #include "d_bt.h" #include #include +#ifdef __ARMDEBUG__ +#include "debug_stub.h" +#endif enum { @@ -422,6 +425,17 @@ UWORD cCommInterprete(UBYTE *pInBuf, UBYTE *pOutBuf, UBYTE *pLength, UBYTE C } break; +#ifdef __ARMDEBUG__ + case DEBUG_CMD: + { + ReturnStatus = cCommHandleDebug(&(pInBuf[0]), CmdBit, MsgLength); /* Pass everything (incl. message command byte) to function */ + /* Check that Debug Command does not expect reply */ + ReturnStatus = (0 == ((pInBuf[0]) & NO_REPLY_BIT)); + *pLength = 0; + } + break; +#endif + default: { diff --git a/AT91SAM7S256/Source/c_comm.h b/AT91SAM7S256/Source/c_comm.h index a1e112c..ac24b02 100644 --- a/AT91SAM7S256/Source/c_comm.h +++ b/AT91SAM7S256/Source/c_comm.h @@ -67,6 +67,9 @@ enum DIRECT_CMD = 0x00, SYSTEM_CMD = 0x01, REPLY_CMD = 0x02, +#ifdef __ARMDEBUG__ + DEBUG_CMD = 0x0d, +#endif NO_REPLY_BIT = 0x80 }; -- cgit v1.2.3