aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/armdebug/Debugger/debug_comm.S
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-08-08 09:04:24 +0800
committerTat-Chee Wan (USM)2011-08-08 09:04:24 +0800
commit627bfbd9b437abf97a3609469f989f1a171975a8 (patch)
tree0fd28561c48b5d1ec03679f60248dc0efb851b34 /AT91SAM7S256/armdebug/Debugger/debug_comm.S
parent9d56c34fdd00926936b019ee34b648fbc74a0575 (diff)
parent2d73bfd4a555acbb40523a02fa2dc9043e5f0444 (diff)
Merge branch 'master' of ssh://svc.cs.usm.my/~/gitrepo-bare/armdebug
Diffstat (limited to 'AT91SAM7S256/armdebug/Debugger/debug_comm.S')
-rw-r--r--AT91SAM7S256/armdebug/Debugger/debug_comm.S19
1 files changed, 18 insertions, 1 deletions
diff --git a/AT91SAM7S256/armdebug/Debugger/debug_comm.S b/AT91SAM7S256/armdebug/Debugger/debug_comm.S
index e237999..4c23912 100644
--- a/AT91SAM7S256/armdebug/Debugger/debug_comm.S
+++ b/AT91SAM7S256/armdebug/Debugger/debug_comm.S
@@ -360,7 +360,7 @@ _hasMsg2Copy:
moveq r0, r4 /* If found, set R0 to current message length */
beq exit_dbg__getDebugMsg /* and return */
teq r0, #MSGBUF_NAKCHAR /* Look for '-' */
- beq exit_dbg__getMsgError /* FIXME: We can't handle retransmission, flag message error */
+ beq exit_dbg__getMsgError /* Error from Host, Retransmit previous message */
teq r0, #MSGBUF_ACKCHAR /* Look for '+' */
addeq r5, r5, #1 /* Adjust Buffer Start Pointer (excl '+') */
subeq r4, r4, #1 /* Adjust Message Length */
@@ -398,7 +398,24 @@ _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
mov r0, #MSGBUF_MSGERROR
+#endif
+
exit_dbg__getDebugMsg:
mov r1, r5 /* Return GDB Message Buffer Pointer in R1 */
ldmfd sp!, {r4,r5,pc}