From 5ad59e0fa53a9e57e4d06a408ab6051c3d6af701 Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Wed, 29 Jun 2011 11:39:05 +0800 Subject: fix bug in dbg__sendcommmsg where it did not set the return value correctly Implemented delay in dbg__sendCommMsg to improve reliability--- Debugger/debug_runlooptasks.S | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Debugger/debug_runlooptasks.S') diff --git a/Debugger/debug_runlooptasks.S b/Debugger/debug_runlooptasks.S index 91c130e..d2557d5 100644 --- a/Debugger/debug_runlooptasks.S +++ b/Debugger/debug_runlooptasks.S @@ -172,6 +172,7 @@ _dbg__reboot_wait: #ifdef __NXOS__ .extern debug_OutCommBuf + .extern nx_systick_wait_ms /**************************************************************************** * * NxOS Communications Driver Interface Routine @@ -182,7 +183,8 @@ _dbg__reboot_wait: * On entry: * R0: Total Message Buffer length * On exit: - R0: Tx Status (TRUE if data sent) + * R0: Tx Status (TRUE if data sent) + * R1-R3: Destroyed */ dbg__sendCommMsg: stmfd sp!, {r4, lr} @@ -199,12 +201,17 @@ dbg__sendCommMsg: mov r1, r4 /* Comm buffer length */ bl nx_usb_write -1: bl nx_usb_data_written /* R0 = True if data has been sent */ +1: mov r0, #1 /* 1 ms delay */ + bl nx_systick_wait_ms + bl nx_usb_data_written /* R0 = True if data has been sent */ teq r0, #0 /* FALSE == #0; We can't check for True condition since values used by C-Compiler & ARMDEBUG are different */ /* FIXME: implement timeout */ beq 1b /* Busy Wait Loop */ + + mov r0, #TRUE + b exit_dbg__sendCommMsg dbg__sendCommMsgFailed: mov r0, #FALSE -- cgit v1.2.3