From: Vladimir Gurevich (vgurevic@cisco.com)
Date: Tue Aug 15 2000 - 12:04:21 EDT
Hello Guo,
guo wrote:
> Very nice! but I cannot visit your ftp site. Could you mail me a copy?
I've double checked and the site seems to be accessible. Anyway, I am
attaching 2 files to this email. The first one is bbug itself, and the
second one is a small program at_flash, that can be used to program
the FLASH on M68EZ328ADS. There is a way to call it from bbug (see
sources).
Happy hacking,
Vladimir
--
+------------------+------------------------+--------------------------+
| | | |
| :|: :|: | phone 408-525-9707
Vladimir Gurevich | :|||: :|||: | fax 408-525-9707
Software Engineer | .:|||||||:..:|||||||:. |
RABU | CiscoSystems | e-mail vgurevic@cisco.com
| | location SJ-7-2 Cube D1-12
| http://www.cisco.com |
+------------------+------------------------+--------------------------+
#!/usr/local/bin/kermit
#
# Do some on-time initializations
#
set prompt {M68EZ328ADS> }
set line /dev/ttyS0
eight
set speed 115200
set flow none
set carrier-watch off
set input echo off
set quiet on
cls
echo {*********************************************************************}
echo {* BBUG --- a bootstrap mode debugger for MC68EZ328 *}
echo {* Ver 0.1 *}
echo {* *}
echo {* Copyright (C) 1999, Vladimir Gurevich *}
echo {* *}
echo {* BBUG is free software, covered by the GNU General Public License, *}
echo {* and you are welcome to change it and/or distribute copies of it *}
echo {* under certain conditions. *}
echo {* *}
echo {* There is absolutely no warranty for BBUG. *}
echo {*********************************************************************}
echo
#
# This macro is used to set M68EZ328ADS board's serial port to 115200 bps
#
# Usage:
# init
#
define init -
set speed 9600 ,-
set input echo off ,-
getc \%c {Please, reset the board and press <Enter>} ,-
output \13 ,-
input 1 @ ,-
echo {Connected to the board} ,-
output FFFFF2010100 ,-
input 1 FFFFF20101 ,-
echo {\13 19200 baud set. (VCO prescaler set to 1)} ,-
set speed 19200 ,-
output FFFFF9020100 ,-
input 1 FFFFF90201 ,-
echo {\13 38400 baud set.} ,-
set speed 38400 ,-
output FFFFF9030138 ,-
input 1 FFFFF90301 ,-
echo {\13 115200 baud set.} ,-
set speed 115200
#
# This macro is used to load a b-record file
#
# Usage:
# load <b-record-file>
#
define load -
set xmit echo off ,-
set xmit linefeed on ,-
xmit \%1 ,-
echo {\7 **** Ready **** \7} ,-
#
# This macro is used to start a program from a specific address
#
# Usage:
# start <hex-address>
#
define start -
assign \%a \Frawcommand({perl -e 'printf "%08X", 0x\%1'}) ,-
output \%a00 ,-
connect
#
# This macro is used to load the flash image into DRAM and then move
# it into FLASH memory
#
# Usage:
# program_flash <file>
#
define program_flash -
assign \%f \%1 ,-
xecho {Loading FLASH utility ... } ,-
load /usr/local/lib/bbug/flash.b ,-
xecho {Loading FLASH image ..... } ,-
load \%1 ,-
xecho {Programming FLASH ....... } ,-
output 0000100400\13 ,-
input 120 DONE ,-
if SUCCESS { -
echo {\7 *** SUCCESS *** \7} ,-
echo ,-
echo {Do not forget to open SW2/6 & SW2/7 !!!} -
} -
else echo {\7 *** FAILURE *** \7}
#
# This macro is used to examine the memory on the board
#
# Usage:
# mdisp <hex-address> <number-of-bytes>
#
# The algorithm is:
# movel #<addr>, %a6
# movel #UTX, %a5
# moveb *%a6, *%a5
#
define mdisp -
assign \%l \%2 ,-
decr \%l ,-
for \%c 0 \%l 1 { ,-
assign \%a \Frawcommand({perl -e 'printf "%08X", 0x\%1 + \%c'}) ,-
assign \%m \Feval(\%c % 16) ,-
if = \%m 0 xecho {\13\10\%a} ,-
output FFFFFFAA082C7C\%a4E71\13 ,-
input 5 \13 ,-
output FFFFFFAA00 ,-
output FFFFFFAA082A7CFFFFF9074E71\13 ,-
input 5 \13 ,-
output FFFFFFAA00 ,-
output FFFFFFAA081A964E714E714E71\13 ,-
input 5 \13 ,-
output FFFFFFAA00 ,-
input 5 FFFFFFAA00 ,-
input 5 ,-
assign \%i \Fcode(\v(inchar)) ,-
if NUMERIC \%i xecho { \Fhexify(\v(inchar))} ,-
else xecho { 00} ,-
} ,-
echo ,-
echo
#
# This macro is used to modify memory contents on the board
#
# Usage:
# mmod <hex-address>
#
# The command will display the contents of the specified address.
# Enter
# <hex-digit><hex-digit><Return> -- to enter new value
# <Return> -- to go to the next location
# .<Return> -- to quit
#
define mmod -
assign \%r n ,-
assign \%a \Frawcommand({perl -e 'printf "%08X", 0x\%1'}) ,-
while ! EQUAL \%r \46 { ,-
assign \%q \%a ,-
output FFFFFFAA082C7C\%a4E71\13 ,-
input 5 \13 ,-
output FFFFFFAA00 ,-
output FFFFFFAA082A7CFFFFF9074E71\13 ,-
input 5 \13 ,-
output FFFFFFAA00 ,-
output FFFFFFAA081A964E714E714E71\13 ,-
input 5 \13 ,-
output FFFFFFAA00 ,-
input 5 FFFFFFAA00 ,-
input 5 ,-
assign \%i \Fcode(\v(inchar)) ,-
if NUMERIC \%i assign \%q {\%q \Fhexify(\v(inchar)) } ,-
else assign \%q {\%q 00 } ,-
ask \%r \%q ,-
assign \%l \Flength(\%r) ,-
if = \%l 0 { ,-
assign \%a \Frawcommand({perl -e 'printf "%08X", 0x\%a + 1'}) ,-
assign \%r n ,-
} , else if = \%l 2 { ,-
output \%a01\%r\13 ,-
input 5 \13 ,-
} ,-
} ,-
echo
#
# This macro is used to start ppp to the board
#
define ppp -
redirect /usr/local/bin/pppd vag-ppp:board-ppp connect '/usr/sbin/chat -vf /home/vag/p' debug kdebug 1
This archive was generated by hypermail 2.1.4 : Thu Sep 19 2002 - 13:19:16 EDT