From c579d271287bd850ed6d546d94b2f1151919a8ce Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Wed, 6 Jul 2011 10:21:10 +0800 Subject: the previous transmitted message checksum must be cleared before retransmitting The previous transmitted message contained a checksum suffix. It must be cleared before retransmission in order to use dbg__putDebugMsg() to retransmit. --- Debugger/debug_comm.S | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Debugger/debug_comm.S b/Debugger/debug_comm.S index 7bb150f..70499e1 100644 --- a/Debugger/debug_comm.S +++ b/Debugger/debug_comm.S @@ -398,6 +398,17 @@ _hasMsg2Copy: beq exit_dbg__getDebugMsg /* Valid length, return */ exit_dbg__getMsgError: + /* We must first clear the existing message checksum */ + ldr r1, =debug_msgTxBufPtr /* R5: data structure base pointer */ + ldr r1, [r1] /* Tx buffer Start Address */ + +1: ldrb r0, [r1], #1 + teq r0, #MSGBUF_CHKSUMCHAR + bne 1b + + mov r0, #0 /* ASCIIZ */ + strb r0, [r1, #-1] /* Pointer R1 is now one past the MSGBUF_CHKSUMCHAR */ + bl dbg__putDebugMsg /* Retransmit message */ mov r0, #0 /* Flag no message received */ #if 0 -- cgit v1.2.3