echo \13
echo ---------------------------------------------\13
echo |  PowerPack flash firmware installation    |\13
echo ---------------------------------------------\13

:QUERYPORT
echo \13
ask comport Enter number of com port attached to PowerPack [1,2,3,4]:
if EQUAL {\m(comport) } { } goto BADPORT
set port \m(comport)
if SUCCESS goto PORTOK
:BADPORT
echo \13
echo Com port "\m(comport)" is not recognized or is not installed.\13
goto QUERYPORT
:PORTOK
if EQUAL \v(port) COM1 goto GOODPORT
if EQUAL \v(port) COM2 goto GOODPORT
if EQUAL \v(port) COM3 goto GOODPORT
if EQUAL \v(port) COM4 goto GOODPORT
goto BADPORT

:GOODPORT
set baud 384
set transmit line on
set transmit prompt \0
ask comport Power-on PowerPack, then immediately press Enter:
run clruart \v(port)
echo \13
set count 25
:ESTABLISHLOOP
output \13
input 1 :
if SUCCESS goto ESTABLISHED
if count goto ESTABLISHLOOP
echo \13
echo -------------------------------------\13
echo |  Failure to connect to PowerPack  |\13
echo -------------------------------------\13
echo - Check that your cable is connected.\13
echo - Check that you selected the correct com port.\13
echo - Be sure to press Enter immediately after booting PowerPack.\13
exit
:ESTABLISHED
set input echo off
output ?\13
input 3 Reset system
set input echo on
reinput 0 115200
if SUCCESS goto PPSWDOWNLOAD
COMMENT download flash for PowerPack
output a\13
input 3 now.
if FAILURE goto COMERROR
echo \13Transmitting firmware to PowerPack...
transmit flash.abs
input 5 :
if FAILURE goto COMERROR
output p\13
input 59 :
if FAILURE goto COMERROR
reinput 5 successfully
if FAILURE goto COMERROR
echo \13Verifying Internet address...
output i\13
input 5 PowerPack Internet address is 0.0.0.0
if FAILURE goto PREVIOUSLYPROGRAMMED
echo \13Programming default Internet address.
output #\13
input 5 >
if FAILURE goto COMERROR
output q\13
input 5 :
if FAILURE goto COMERROR
output i 1.2.3.4\13
input 5 :
if FAILURE goto COMERROR
:PREVIOUSLYPROGRAMMED
output j\13
echo \13
echo ---------------------------------------\13
echo | PowerPack Firmware update completed |\13
echo ---------------------------------------\13
echo \13
echo Windows 95 users: close DOS window before connecting to SLD.\13
echo \13
exit

:PPSWDOWNLOAD
COMMENT download flash for PowerPack-SW/EA
output f\13
set baud 115200
output \13
input 1 :
if FAILURE goto COMERROR
;
; Update CAT Options to enable trace extensions and timestamp.
; Determine if system is EA-486 (pod type=1700 and CAT Options=086E).
; If so, set CAT Options word to 08AE.
;
set input echo off
output #\13
input 1 >
if FAILURE goto COMERROR
output erp 0 1\13
input 1 >
if FAILURE goto COMERROR
reinput 1 1700
if FAILURE goto NOTEA486
output erc 2 1\13
input 1 >
if FAILURE goto COMERROR
reinput 1 086E
if FAILURE goto NOTEA486
output ewc 2 08AE\13
input 1 >
if FAILURE goto COMERROR
:NOTEA486
output q\13
input 1 :
if FAILURE goto COMERROR
set input echo on

output a\13
input 3 now.
if FAILURE goto COMERROR
echo \13Transmitting firmware to PowerPack-SW/EA...
transmit fw386up.abs
output \13
input 10 :
if FAILURE goto COMERROR
output j\13
set baud 38400
input 30 unit.
if FAILURE goto COMERROR
echo \13
echo ---------------------------------------------------\13
echo | PowerPack-SW/EA Flash firmware update completed |\13
echo ---------------------------------------------------\13
echo \13
echo Windows 95 users: close DOS window before connecting to SLD.\13
echo \13
exit

:COMERROR
echo \13Communications error during flash firmware update procedure.\13
exit
