DALLAS SEMICONDUCTOR

 

KIT.EXE
SOFTWARE
USER’S GUIDE

 

Version 05.98

 

Dallas Semiconductor reserves the right to make changes to or to discontinue any product or service described herein without notice. Dallas Semiconductor advises customer to obtain the most recent version of software, documentation, and data sheets from our World Wide Web site before beginning any design project

 

 

DESCRIPTION

KIT.EXE is a high-level interface for developing applications using members of the Secure Microcontroller Family from Dallas Semiconductor. The software provides a number of features including the uploading or downloading of application software or setting configuration parameters. For more advanced users, KIT.EXE allows individual manipulation of the microcontroller’s resources including memory configuration registers, direct access to general purpose I/O ports 0, 1, 2, and 3, and enabling/disabling of certain security features. The software allows the examination or editing of memory locations on a byte-by-byte basis. After loading, the device can be released on command from the PC to run the application software. A dumb terminal emulator is included in the software, allowing direct access to the serial port of the microcontroller.

This software combines the functionality of and replaces the programs KIT5K.EXE and K2.EXE previously used with the Soft and Secure Microcontroller families.

SYSTEM REQUIREMENTS

The DS5000TK Evaluation Kit requires a PC or compatible with at least 128K bytes of conventional memory. KIT.EXE has been tested under DOS, Windows 3.x, and Windows 95. The hardware requires an RS-232 port for communication with the RS-232 fixture. Monochrome, CGA, or EGA (mode 3) graphics are supported.

OPERATIONAL DETAILS

When KIT.EXE is invoked, the program looks for the name of a file on the command line. If found, it will treat that file as a batch file of KIT.EXE commands. If no command line argument is supplied, the program will begin, display its sign-on banner, and prompt the user to supply a COM port through which to communicate to the target device. The first time that the COM command is entered, either at the kit> prompt or via the batch file, the DTR signal on the PC serial communication port is asserted. When exiting KIT.EXE, the DTR signal on the PC serial communication port will remain in the last state specified by the program.

Before every command which causes a communication with the target device (dump, fill, status, range, load, etc.) the KIT.EXE will attempt to verify the existence of the target device by performing the following series of steps:

  1. Transmit a break character
  2. Initiation of an autobaud sequence to synchronize baud rates
  3. Acquire the bootstrap loader sign-on banner from the target device
  4. Perform the bootstrap loader "R" command
  5. Execute the requested command

 

KIT.EXE operates one of three primary modes:

Kit mode: The most commonly used mode, Kit mode is a high-level interface with the target device. Indicated by the "kit>" prompt, this mode affords the user a superset of the commands available through the microcontroller’s bootstrap loader.

Terminal (or Term) mode: In this mode, KIT.EXE acts as a dumb terminal giving direct access to the bootstrap loader of the target device. This mode can be useful as a way to communicate directly with the microcontroller in run mode.

Batch mode: A series of user-defined commands can be executed through the use of either command line scripts or the DO command. This can be used to automate multi-step tasks such as loading and configuring the microcontroller.

The following is a summary of commands recognized by KIT.EXE, sorted by mode. A full description of these commands is provided later in this document.

KIT (or BATCH) MODE

cd

Change to another directory or show the default directory.

cls

Clear screen.

com

Specify which PC COM port to use.

crc

Calculate a CRC value over the requested range.

dir

List the default directory or specified path.

display

List Embedded RAM contents in debug format.

do

Execute a list of KIT.EXE commands from a file.

dos

Enter DOS mode temporarily

dtr

Toggles the DTR line to switch between run and load.

dump

Dump Embedded RAM in Intel Hex to a file.

echo

Copy the characters directly to the serial port.

edit

Examine/change bytes in embedded RAM.

exit

Exit the program.

fill

Fill Embedded RAM with a constant value.

fresh

Place DS5001FP or DS5002FP into Freshness (storage) mode.

get

Display values of ports 0, 1, 2, and 3.

help

Describe the function and syntax of KIT.EXE commands.

include

Calculate and include a CRC-16 (DS5001FP/DS5002FP)

key

Load the Encryption Key. (DS5000FP)

load

Load an Intel Hex file into embedded RAM.

lock

Set the Security Lock on the microcontroller.

logoff

Disable logging of KIT.EXE commands.

logto

Log KIT.EXE commands to the specified file.

mcon

Set the MCON register with a specified value.

partition

Set the Partition Address with a specified value.

pgmode

The DTR line from the PC COM port is raised to its active level.

put_port

Directly modify the selected I/O port.

quit

Same as exit.

range

Set the Range Address.

read

Displays configuration registers of target device.

reload

Sets the PC UART reload value for flexible baud rate selection.

remark

Includes a remark into a batch file.

run

The DTR line from the PC COM port is dropped to its inactive level.

send

Download a file is to the target device without error checking.

speed

Select the baud rate.

status

Display the current status of the target device.

term

Switch to terminal emulation mode; see below.

time

Accesses the RTC in the DS2251T/DS2252T modules.

type

Display the requested file on the screen.

unasm

Unassemble the program memory to the screen.

unlock

Clear the Security Lock.

verify

Verify Embedded RAM with the specified Intel Hex file.

wait

Insert specified delay into script file.

TERMINAL MODE

capture

Capture screen output to memory, and allow saving to a file.

cd

Change to another directory or show the default directory.

cls

Clear screen.

com

Select the PC com port.

debug

Display non-printing data received from target device as hex value.

dir

Read directory

dos

Enter DOS mode temporarily

dtr

Toggle the DTR line.

exit

Exit Kit.

help

Describe the functions and syntax of terminal emulator

kit

Switch to kit mode.

logoff

Stop logging commands to a file.

logto

Log commands to a file

pgmode

The DTR line from the PC COM port is raised to its active level.

quit

Leave KIT.EXE.

reload

Sets the PC UART reload value for flexible baud rate selection.

run

The DTR line from the PC COM port is dropped to its inactive level.

send

Download a file is to the target device without error checking.

speed

Select the baud rate.

type

Display the requested file on the screen.

CREATING BATCH FILES

Batch files can be used to automate user-defined commands. A sequence of KIT.EXE commands is entered into a file using a text editor, in the same syntax as they would be using the kit> prompt. The command file is executed in two ways; either by entering it on the KIT.EXE command line when the program is invoked, or by using the DO [filename] command in Kit mode. The commands are case insensitive, and illegal or invalid commands are ignored. An example file is shown below:

 

REMARK This is the batch file I wrote to initialize the system.
COM 1
SPEED 19200
CD c:\code\mycode\
LOAD myfile.hex
VERIFY myfile.hex
REMARK End of my batch file.

COMMAND LINE SYNTAX

One or more ASCII characters constitutes a command. Commands will not be processed by KIT.EXE until terminated with a <CR>. As a result, commands may be edited with the delete key before the <CR> is entered.

Only legal characters will be echoed back to the screen. The legal characters include upper and lower case alphanumerics, <:>, <space>, <tab>, and <delete>. Backspace characters (<BS>) and the horizontal tab character are converted to <delete> characters and <space> characters, respectively.

Most arguments use a sequence of hexadecimal characters. A byte will always be the right-most two digits of a hexadecimal number, and an address will always be the right-most four digits of a hexadecimal number as shown below: In the other cases, arguments are represented by decimal numbers. In commands which normally accept hexadecimal numbers as their arguments, decimal operation may be invoked by typing a period (.) after the entered value.

Entered Value

Number

Address

A

0Ah

000Ah

AB

0ABh

00ABh

ABC

0BCh

0ABCh

ABCD

0CDh

0ABCDh

DETAILED COMMAND SUMMARY KIT MODE

Commands and arguments are case-insensitive. Capitalized letters show the shortened form of the command for experienced users. Mandatory arguments are enclosed by parenthesis (), optional arguments are enclosed in square brackets [].

 

CD directory_name

Change the default directory to directory_name. The command will then display the current directory

Example:

kit> cd \ws

C:\WS

 

CLs

Clear the monitor screen

 

COm (1 | 2 | 3 | 4)

Selects which PC communication port to use. If KIT.EXE is unable to locate the corresponding PC IRQ, the user will be prompted for it.

Example:

kit> com 1

 

Crc [beg_addr [end_addr]]

Calculates a CRC value over the requested range of target device memory. Beg_addr and end_addr default to 0000h and FFFFh respectively if not specified.

Example:

kit> crc 0000h 5000h
crc = A63F

 

DIR [filename | wildcards]

A list of the file names in the directory is displayed.

Example:

kit> dir
READ.ME KIT.EXE TEST.HEX DEMO.BAT DEMODS5T.CMD
DEMODS5T.EXE DEMODS5T.HEX DEMODS5T.LST DEMODS5T.PAS DEMODS5T.SRC

 

DISplay [beg-addr [end-addr]] [>filename]

Data is displayed in hex and ASCII format. The optional arguments are interpreted as hexadecimal numbers by default. The beginning and ending addresses are positional and will default to zero and the current range value, if not specified. The optional ">filename" argument redirects the output to the specified file instead of to the screen.

Example:

kit> display 0 7f
0000 B2 90 80 FC 3C 2D 54 65 - 73 74 20 43 6F 64 65 20 ....<-Test Code
0010 20 20 20 20 20 20 20 20 - 20 20 20 20 20 20 20 20
0020 54 65 78 74 20 66 6F 72 - 20 44 69 73 70 6C 61 79 Text for Display
0030 50 75 72 70 6F 73 65 73 - 2E 20 41 42 43 44 45 46 Purposes. ABCDEF
0040 47 48 49 4A 4B 4C 4D 4E - 4F 50 51 52 53 54 55 56 GHIJKLMNOPQRSTUV
0050 57 58 59 5A 20 20 61 62 - 63 64 65 66 67 68 69 6A WXYZ abcdefghij
0060 6B 6C 6D 6E 6F 70 71 72 - 73 74 75 76 77 78 79 7A klmnopqrstuvwxyz
0070 2A 20 20 31 32 33 34 35 - 36 37 38 39 30 20 20 2A * 1234567890 *

 

DO (filename)

The commands in filename are executed as a script until the end of file is encountered. Recognized errors will be displayed on the screen, but execution will not be halted.

 

DOS

Launches a shell within KIT.EXE that allows the user to execute DOS commands. When DOS commands are complete, return to KIT by typing "exit".

 

DTr [on|off]

Changes the status of the PC COM port DTR signal. The state of the DTR signal toggles if no argument is given.

Example:

kit5k >dtr off
DTR dropped on com 1

kit5k >dtr
DTR asserted on com 1

 

DUmp [beg-addr, end-addr] [>filename]

Embedded RAM contents from beg-addr to end-addr are displayed on the PC as Intel Hex Data. The optional arguments are interpreted as hexadecimal numbers by default. The beginning and ending addresses are positional and will default to zero and the current range value if not specified. The ">" sign redirects the output to the specified file instead of the screen.

Example:

kit> dump 0 2f
:20000000B29080FC3C2D5465737420436F646520202020202020202020202020202020205E
:100020005465787420666F7220446973706C6179CE
:00000001FF

 

ECho (data)

Transmits the data out the selected communication port. Use \ followed by a three digit octal number for special characters. \n will output a carriage return.

Example:

kit> echo A
(This sends ASCII character A (101 octal or 41 hex) to the target device.
kit> echo \175
(This sends ASCII character } (175 octal or 7D hex) to the target device.

 

EDit (address)

Examine and change data beginning with address. Data may be examined either in the forward or backward direction. The argument is interpreted as a hexadecimal number by default.

Example:

kit> dis 10 1F
0010 2E 2E 2E 2E 2E 2E 2E 2E - 2E 2E 2E 2E 2E 2E 2E 2E ................

kit> edit 16
CR to leave unchanged; NUMBER to change; Other to exit.
0016 2E:46
0017 2E:6F
0018 2E:6F
0019 2E:q

kit> dis 10 1F
0010 2E 2E 2E 2E 2E 2E 46 6F - 6F 2E 2E 2E 2E 2E 2E 2E ......Foo.......

 

Exit

Buffers and files are closed, the communication ports are cleared and the program is exited. The DTR signal on the PC COM port retains its last state before exiting.

 

Fill (value) [beg-addr end-addr]

The specified memory range is filled with the specified constant value. The optional arguments are interpreted as hexadecimal numbers by default.

Example:

kit> f 0 0 2f
kit> f aa 12 1d
kit> disp 0 2f
0000 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................
0010 00 00 AA AA AA AA AA AA - AA AA AA AA AA AA 00 00 ................
0020 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................

 

FResh

Place the DS5001FP- or DS5002FP-based target system into Freshness mode. This disconnects the VCCO output of the microprocessor from the VBAT input to halt battery drain while in storage. Freshness mode is removed automatically by the first application of VCC power to the microprocessor or module.

Example:

kit> Fresh

POWER DOWN TO MAINTAIN FRESHNESS

 

Get

Display values of ports 0, 1, 2, and 3 of the target device.

Example:

kit> get

Port0:FF Port1:FF Port2:FF Port3:FB

 

Help [command-name]

Available commands in the current mode are listed or help on the requested command is given.

 

Include (1000|2000|3000|4000|5000|6000|7000|8000|9000|A000|B000|C000|D000|E000|FFFF)

Calculate a CRC-16 check sum on Embedded RAM contents from 0000h to (range-2), and places it into the last two bytes of the range. This command modifies bits in the CRC register as described in the Secure Microcontroller User’s Guide. This command is only available for DS5001FP, DS2251T, and derivative parts.

Example:

kit> disp 0FF0 0FFF
0FF0 F2 F2 F2 F2 F2 F2 F2 F2 - F2 F2 F2 F2 F2 F2 F2 F2 ................

kit> include 1000

kit> disp 0FF0 0FFF
0FF0 F2 F2 F2 F2 F2 F2 F2 F2 - F2 F2 F2 F2 F2 F2 26 26 ..............&&

 

KEy (ASCII String | 5 pairs of hex digits | RANDOM)

This command sets the Encryption Key Word within the DS5000FP. The entering of a new key renders the current program and data memory unreadable by the microcontroller. Subsequent program and data loads will be properly encrypted, allowing secure execution by the microcontroller. The key may set by entering five ASCII characters enclosed in single or double quotes, 5 hexadecimal numbers, or the PC may be requested to specify a random key.

Example:

kit> key 466E6F5244
kit> key ‘fnord’
kit> key RANDOM

 

Load (filename)

The data from filename is downloaded into the target device. Several errors can be detected, such as multiple programming of the same memory location, and attempts to program nonexistent memory. All error messages will be reported. No configuration files are used with this command.

Example:

kit> load test.hex

 

LOCk

Set the security lock on the microcontroller. Attempts to access Embedded RAM after the security lock has been has been set will fail until the Unlock command is issued.

Example:

kit> lock

kit> status
Part is locked.

 

LOGOff

The log file is closed. See the Logto entry for more details.

 

LOGTo (filename)

All user input and data echoed to the screen is logged to the specified file. Logging is turned off with the Logoff command or by exiting. The specified file may be viewed with a text editor.

 

Mcon (value)

The MCON register in the target device is changed to the requested number. The argument is interpreted as a hexadecimal number as a default.

 

OVerride [on|off]

Enables (off) or disables (on) the need for KIT.EXE to check the status of the DTR signal for select commands such as Status. This command is useful if loader entry/exit is controlled by external hardware and not by the DTR signal generated by KIT.EXE. Executing this command with no argument toggles the status of override.

 

Partition (address)

Partition address is set to the selected hexadecimal value and the display is updated. The arguments for this command vary, depending on the target device:

DS5000FP:

0 | 800 | 1000 | 1800 | 2000 | 2800 | 3000 | 3800 | 4000 | 4800 | 5000 | 5800 | 6000 | 6800 | 7000 | 8000

DS5001FP, DS5002FP:

0 | 1000 | 2000 | 3000 | 4000 | 5000 | 6000 | 7000 | 8000 | 9000 | A000 | B000 | C000 | D000 | E000 | FFFF

 

PEs [on|off]

Changes the status of the Peripheral Enable Select bit in the target device, which effects memory commands such as Dump, Load, Fill, etc. The state of the bit toggles if no argument is given. This command is only available for DS5001FP, DS5002FP, and derivative parts.

 

PGmode

The DTR line from the PC COM port is raised to its active level.

 

PRogram (filename) [/edit]

This command automates the programming of target devices by automatically configuring the memory control registers of the target device and downloads the Intel Hex file filename.hex. Script commands and configuration settings are located in the configuration file filename.cfg that initializes the target device and automatically downloads filename.hex to the target device. The configuration file is displayed before the part is programmed. The /edit switch allows the current configuration file to be edited one line at a time.

If the configuration file filename.cfg does not exist, the operator will be prompted for the necessary information and a new configuration file will be created. If filename.cfg does exist, the command will proceed to program the target device and display the configuration settings on the screen. If the Intel Hex file does not exist, the program will report an error message.

Example (Creating new configuration file for DS5000):

kit> program newhex.hex
Configuration: Press return for default value.
range (32k) = 32k
partition (1000) = 3000
locking (no) = yes
verify (yes) = yes
encryption (no) = yes
key (random) = random

Configuration Contents:
range: 32k
partition: 3000
locking: yes
verify: yes
encryption: yes
key: random

Unlocking...
Clearing MCON...
Setting Range...
Setting Partition...
Setting Password...
Loading...
Verifying...
Locking...
Example (Using existing configuration file for DS5000):
kit> program newhex.hex
in exist

Configuration Contents:
range: 32k
partition: 1000
locking: no
verify: yes
encryption: no
key: random

Unlocking...
Clearing MCON...
Setting Range...
Setting Partition...
Loading...
Verifying...

 

PUt_port (0 | 1 | 2 | 3) (value)

Write value to port 0, 1, 2, or 3. It not possible to alter port pins P3.0 and P3.1 as these two port pins are used for serial transmission. This command is not available on DS5000FP and derivatives utilizing bootstrap loaders earlier than version 2.2.

 

Quit

Buffers and files are closed, the communication ports are cleared and the program is exited. The DTR signal on the PC COM port retains its last state before exiting. Same as Exit.

 

Range (range_value)

Configure the range bits of the target device for the requested memory configuration. Allowed range values are:

DS5000FP: 8k | 32k

DS5001FP, DS5002FP:

Variable partitions: 8k | 16k | 32k | 64k

Fixed partitions (code, data): 32k 64k | 64k 32k | 64k 64k | 128k

Example:

kit> range 8k
kit> range 64k 32k

 

Read

Displays the contents of the memory configuration registers in the target device. The display includes the status of the MSL bit, which indicates whether memory operations in the 128K mode will access code memory (MSL=1) or data memory (MSL=0).

 

RELoad (value)

Sets the reload rate of the PC 8250 UART, allowing a wider selection of baud rates. The baud rate is selected by the formula 115200/value where value is the reload number.

 

REMark

This command, used in batch files, indicates that the line is a comment and is not to be executed. The message following the REMARK command is displayed on the screen then the batch file is executed by the DO command or via the command line.

 

RUn

The DTR line from the PC COM port is dropped to its inactive level.

 

SEnd (filename)

The data from filename is downloaded to the target device. Unlike the Load command, this command accepts files of any type (ASCII, binary, Intel Hex, etc.) and directly transmits them to the serial port of the target device without error checking.

Example:

kit> send rtfm.txt

 

SPeed (value)

Sets the communication speed with the target system. Any integer divisor of 115200 may be entered. Faster computers may want to use 57600. If you have communication problems, it may be more reliable to work at slower speeds such as 9600. Finer control of the baud rate can be obtained with the RELOAD command.

 

Status

Display the current status of the target device.

 

Term

Change from Kit mode to terminal emulation mode. This allows direct access to the bootstrap loader of the target device. Many of the kit commands are available from this mode at the "dt>" prompt, which is available by pressing the "ESC" key. Online help is also available as with KIT mode.

 

TIme (SET | READ | ON | OFF)

Accesses the DS1283 Watchdog Timekeeper RTC in the DS2251T or DS2252T Microcontroller Modules. The Read command will read the time from the module and display it on the PC screen along with the current PC time. The Set command will set the module’s RTC time to match the current PC time. The On or Off option will disable the RTC’s oscillator.

 

TYpe (filename)

Display the requested file on the screen.

 

Unasm [beg-addr end-addr]

Unassemble the program RAM of the target device and display the results to the screen. Specify optional start and stop addresses for disassembly.

Example:

kit> unasm 33 3D
0033 75A882 MOV IE,#082H
0036 80FE SJMP 00036H
0038 D80C DJNZ R0,00046H
003A 7801 MOV R0,#001H
003C E590 MOV A,P1

 

UNLock

Clear the Security Lock bit on the microcontroller. This erases the encryption key and memory of the device.

 

Verify (filename) [beg-addr, end-addr]

The contents of embedded RAM are compared against the data in filename, and any discrepancies will be reported. The optional beginning and ending addresses will determine what parts of the input file will be used for verification. The beginning and ending addresses are positional and will default to zero and to the current range value if not specified. Arguments are entered as hexadecimal numbers.

Example:

kit> verify testfile.hex
No Verification errors

kit> verify errors.hex
Address CmpVal MemVal
0007H 75H 65H
0037H 78H 73H

 

WAit (value)

Delays (value x 55) ms. Any keyboard character will abort the wait period. This command is used in conjunction with script files to incorporate a delay function into automated commands.

TERMINAL EMULATOR MODE COMMANDS

This section discusses commands that are unique or different in the terminal mode. A complete list of commands for this mode is given in a prior section. Most commands in terminal emulator mode are entered at the dt> prompt, which accessed by pressing the [Esc] key.

 

CApture [on | off]

When toggled on, the capture command captures data output to the screen and saves it to PC memory. When toggled off, the program prompts the user for a filename so the data can be saved to a file. Entering no argument will toggle the state of the capture command.

 

Example:

dt> capture on
[operations occur with display data on the PC display]
[User presses Esc key when complete]
dt> capture
Enter filename to save capture buffer, CR to discard.
Filename:

 

DEbug

Displays non-printing data received from target device as hex value.

Example (Target device transmits three CR/LF characters to the PC):

dt> debug

<DEBUG ON>

<0D><OA> <0D><OA> <0D><OA>

 

KIT

Exit terminal emulator mode and return to Kit mode.