embedded systems developers tools, cross compilers
  Home  |   SwiftX Archive  |   SwiftForth Archive  |

RESET! Confused If Slow

From: Bulgrien, Dennis <DBulgrien_at_vcsd.com>
Date: Fri, 26 Jul 2002 18:58:40 -0500

This is a question about how to shake hands with the talker over a cup of
reset. start.f's RESET! is used by RELOAD to reset the target before
INCLUDE DEBUG downloads. Some systems may not have such a feature; some may
reset by reading a particular address. Ours can when an address is written
a particular ( RESET-KEY ) value. The host requests this action via the
serial XTL interface. Normally an <ACK> is received after sending an XTL
request. However, if it is interrupted by the reset, the newly reloaded
instance of the target talker comes out of reset and sends <NAK>.
Implementation A works fine if the reset occurs immediately. If the reset
is delayed, both the <ACK> "I did your command" and the <NAK> "I just came
up out of reset" are sent. Implementation A reads the <ACK> and assumes
that the reset fail; INCLUDE DEBUG aborts. I know it succeeded because the
reset LED blinks.

Why does Implementation B aborts too. Its (COM-KEY?) always returns FALSE>
After the abort, INTERPRETER @BYTE(S) fetches <NAK>. Results are the same
if (COM-KEY?) is preceded by 1000 MS, waiting for the reset.

Implementation C was an attempt to do another read for <NAK> if the first
read <ACK>. It really gets things fouled up-- call-chain errors, etc.

Perhaps Implementation A would work if @BYTE(S) were preceded by a word such
as -KEYS , perhaps named -BYTE(S).
____________________
Implementation A:

INTERPRETER
: RESET! ( -- )
   CR ." REMOTE RESET..."
   RESET-KEY RESET-ADDRESS Fn(!) REQUEST-ADDR !CELL(S) \ request reset
action
   @BYTE(S) \ determine result
   <NAK> <> ABORT" Can't reset target"
   ." DONE" ;
____________________
Implementation B:

INTERPRETER
: RESET! ( -- )
   CR ." REMOTE RESET..."
   RESET-KEY RESET-ADDRESS Fn(!) REQUEST-ADDR !CELL(S) \ request reset
action
   @BYTE(S) (COM-KEY?) IF DROP @BYTE(S) THEN \ determine result
   <NAK> <> ABORT" Can't reset target"
   ." DONE" ;

____________________
Implementation C:

INTERPRETER
: RESET! ( -- )
   CR ." REMOTE RESET..."
   RESET-KEY RESET-ADDRESS Fn(!) REQUEST-ADDR !CELL(S) \ request reset
action
   @BYTE(S) DUP <ACK> = IF DROP @BYTE(S) THEN \ determine result
   <NAK> <> ABORT" Can't reset target"
   ." DONE" ;
----------------------------------------------------------------------
swiftx_at_forth.com The SwiftX programming discussion email list
To unsubscribe, send subject "unsubscribe swiftx" to listar_at_forth.com
For help with listar commands, send subject "help" to listar_at_forth.com
Archives are located at http://www.forth.com/swiftx -- check them out!
----------------------------------------------------------------------
THIS LIST IS NOT FOR BUG REPORTS! Send bug reports to support_at_forth.com.
Received on Fri Jul 26 2002 - 16:57:33 PDT

This archive was generated by hypermail 2.2.0 : Fri Dec 05 2008 - 03:04:21 PST