aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-07-06 10:21:10 +0800
committerTat-Chee Wan (USM)2011-07-06 10:21:10 +0800
commitc579d271287bd850ed6d546d94b2f1151919a8ce (patch)
tree47b13e73b6ff1bb63f89d93b9cd57e5d773f88d7
parent654c39440b698559ff3c7e5f345ad3b4c98d071f (diff)
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.
-rw-r--r--Debugger/debug_comm.S11
1 files changed, 11 insertions, 0 deletions
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