0100First IssueSeptember,1997acb
0110Load/remove of OS-9 modulesJan. 1998mf
This document contains proprietary information of PEP Modular Computers. It may not be copied or transmitted by
any means, passed to others, or stored in any retrieval system or media, without the prior consent of PEP Modular
Computers or its authorized agents.
The information in this document is, to the best of our kno wledge, entirely correct. However, PEP Modular Computers
cannot accept liability for any inaccuracies, or the consequences thereof, nor for any liability arising from the use or
application of any circuit, product, or example shown in this document.
PEP Modular Computers reserve the right to change, modify, or improve this document or the product described
herein, as seen fit by PEP Modular Computers without further notice.
BOOTSTRAP LOADER FOR VM 30, VM 162, VM 172, VM(6)62, VM(6)42,
VSBC 32, IUC-32, (V)IUC, VSBC-4, SMART I/O AND SMART II (CM302)
1 Introduction
The Bootstrap Loader is a stand-alone software located in FLASH memory which allows the user to safely update the contents of the FLASH and delay the boot process for a specified time.
The Bootstrap Loader has the capability of pro gramming FLASH memory from “MOTOROLA S-R ECORDS” or from an
absolute memory address. If the programmed image does not work, the Bootstrap Loader can be entered again. The memory contents can be examined and ano ther programming cycle initiated.
The Bootstrap Loader is delivered already installed on PEP´s CPU boards equipped with FLASH devices.
Please read this user manual before reprogramming any FLASH memory.
WARNING !
When programming FLASH memory, *NEVER* press the RESET button or switch off the mainpower! This may damage the Bootstrap Loader and will consequently leave the board unusable due
to corrupt FLASH contents.
However, the ABORT button may be used to cancel a running operation safely.
After system reset, the Bootstrap Loader is started. It searches the FLASH memory area for a valid start key. If this start
key is found, the Bootstrap Loader checks the 'BootWaitTime' from serial EEPROM or R TC. If the entr y is valid, the co ntinuation of the boot process is delayed by this time while flashing the green front panel LED to indicate that the system is
alive but waiting for continuation. If the entry is not valid, a default of 5 seconds is used. After the BootWaitTime has
passed, the program in FLASH is started.
The Bootstrap Loader has two modes of operation: non-interactive start mode as described abo ve and the interactive command mode.
For normal board operation, only the non-interactive start mo de is used to start a program in FLASH. This is done automatically without any user interaction. The interactive command mode is used to re-program the FLASH memory contents
or change the BootWaitTime.
The serial term port operates at 9600 Baud, 8 bits / character, 1 stop bit and no parity.
2.2 Entering the Command Mode
There are two possible cases:
If no valid start key was found, the Bootstrap Loader's command mode is entered automatically
If the user wants to enter the Bootstrap Loader manually (e.g. for re-programming the FLASH contents) he must use the
ABORT button on the front panel.
On CPUs without an ABORT button, the Bootstrap Loader will enter the command mode on detecting a BREAK character
of at least one second length at the terminal connector.
The ABORT button must not be pushed until th e green LED appears, because this button ge nerates a NMI and the
Note:
exception vector tables must be initialized correctly to serve this NMI. Pressing the ABORT prior to the green LED leads
to HALT in most cases. In this case, press the RESET button and try again.
The ABORT button must, however, be pushed before the green LED stops flashing (BootWaitTime), because system
Note:
control is passed to the downloaded binary image afterwards. The LED is cycled every 0.25 sec so if 1 second is specified
as BootWaitTime, the LED will only flash 2 times.
CPUs without an user LED or without an ABORT button uses a BootWaitTime of at least 5 seconds.
Note:
CTRL-x deletes the complete input line while CTRL-a restores the last input line.
1)
.
1)
The start key is a special combination of data appended at the end of the load program or inside the load progr am itself.
The image must be compiled / linked to run from the FLASH base address of the CPU. The image must start with the ResetSP / ResetPC vectors as usual for ROM / FLASH images on 68000 processor boards.
A binary image must be converted to Motorola S-records or loaded to a VME memory board with batter y-backup, FLASH
or EPROM population.
2.4 Programming with Motorola S-Records
Programming is done with the If command.
The If command accepts S1, S2 and S3 records. Operation is terminated by the appropriate S9, S8 or S7 record. Other
types of records are ignored.
The checksum of every record is checked; bad records are refused by the Bootstrap Loader. The address range of every
record is also checked; records that try to overwrite the Bootstrap Loader are refused. Additionally, every record must
match the programmable area exactly. To give the user an overview of the available ranges, the startup banner includes
address information.
If Sl or S2 record input is preferred, please note that these records only include 16 and 24-bit wide addresses. Therefore,
in order to reach the FLASH area an addr ess offset must be specified using the '-o=...' o ption of the If command. Addition-
ally, it must ensured that the code is not larger than the covered address range.
The If command cannot be used to program Motorola S-records to RAM areas.
Note:
For sending programming data, the lower (term) or upper (serO) RJ12 front panel connectors can be used. The serO port
should be preferred because in this configuration it is possible to monitor the progress of the operation via the term port.
If not otherwise specified, sectors which are not touched by the programm ing operation are not erased . If you want to erase
all sectors while programming, the '-c' option can be specified along with the If command. This is useful for software
which searches memory during startup and should not find any old modules (e.g. OS-9).
Make sure that the XON/XOFF protocol is used on the host side. This is a fixed setting and cannot be changed. Additionally, make sure that your host does not stop transmission after a number of lines (e.g. OS-9: use the 'nopause' attribute).
Serial parameters can be modified with the pf command.
On CPUs without a ser0 serial connection the Bootstrap Loader will refuse loading the data from ser0.
Note:
2.5 Example using OS-9 development system
The host is assumed to be an OS-9 development system. A serial cable is used to connect the ser0 port of the b oard t o program to t0 of the development system. Additionally, we assume that we want to program a PEPbug image which is available as a file 'pbVM42' in a binary image format. The serial connection should run at 38400 Baud. The following steps
must be performed:
The host is assumed to be a PC with W indows, Wi ndows95 or WindowsNT. A serial cable i s used to co nnect the ser0 port
of the board to program to COM2 of the PC. Additionally, we assume that we want to program a Motorola S-record built
for address 0, e.g the VxWorks file bootrom.hex. The serial connection should run at 19200 Baud. The following steps
must be performed:
Host:
Under MSDOS, configure the COM 2 port to the correct parameters:
mode com2: baud=19200 parity=n data=8 stop=1
Target:
pf ser0 19200 lf -o=4000000
Host:
type bootrom.hex >com2:
2.7 Monitoring programming progress
In both examples, the programming can be monitored over the term port. The characters displayed have the following
meaning:
• rRead S-record; valid and in range
• tProtected sector touched
• eErase sector
• cCopy to buffer, program later
• pProgram record
None of the above characters indicate an error. The first sector (which includes Reset SP / PC) and the last sector (which
includes the Bootstrap Loader itself) are protected. These sectors are not immediately programmed like the other sectors.
The contents of these protected sectors are buffered in RAM and programmed at the end of the operatio n. This is done to
limit the time the Bootstrap Loader itself is not in FLASH or not startable, because if the Bootstr ap Loader c rashes during
this critical period of time, it will not start again afterwards.
When programming FLASH memory, *NEVER* press the RESET button or cycle power! This may
damage the Bootstrap Loader and will consequently leave the board unusable due to damaged
FLASH contents. The ABORT button may be used to cancel a running operation.
'-q' suppresses all messages and warnings except error messages.
Programming over the term
the propagation of the process c annot be monitore d.
It is recommended that by default the programming over the ser0
If the process must be aborted, press the ABORT button and try again.
On CPUs without an ABORT button the process cannot be aborted.
port is also supported, but in this case the loader programs in the background by default and
port should be used.
2.8 Programming from an Absolute Address
The second possibility to program FLASH mem ory is to pr ogram it fr om an absolut e address. The i mage to pro gram must
be located in a visible address range, for example on the VMEbus. A memory card with battery-backup, FLASH or
EPROM can be used to hold the image to program . If we assume that the image is located at 0x870000 00 and is 0 x123456
bytes large we must type the following at the command prompt of the Bootstrap Loader:
lf -m=87000000 -l=123456
The characters which are displayed now have the same meaning as if we are programming from S-records, but the time
needed for each step to complete may be long er because the loader tries to program with the largest possible block size that
it can manage.
Again, '-c' can be used to clear untouched sectors.
Background operation is not supported and it is also not possible to specify an offset.
The programming cannot be aborted with ABORT.
On CPUs without an ABORT button the process cannot be aborted.
Note:
2.9 BootWaitTime
The command bw can be used to display / change the current BootWaitTime. Available delays are 1-2-5-10-20-50 seconds. CPUs without an user LED or without an ABORT butt on have a Boot WaitTime of at least 5 secon ds. The Boots trap
Loader refuses setting a BootWaitTime of 1-2 seconds.
The BootWaitTime is stored in the boot section of the serial EEPROM or RTC. This section is validated with a CRC
Note:
code to avoid the setting of random parameters. If the CRC of the Boot section is not valid, changing the BootWaitTime
has no effect because the bw command does not validate an invalid CRC to avoid undesired side effects. In this case, the
default of 5 seconds is always used. On CPU equipped with a RTC which holds the BootWaitTime there is no CRC value
included.
To validate an invalid CRC, the appropriate utility from an operating system must be used (e.g. ee_config from OS-9).
The command si can be used to display / change the setting of the ISaGRAF Start Flag. Valid valu es are 0 and 1.
See pep-vdme.wri on ISaGRAF Workbench for more information about the usage of this flag.
The ISaGRAF Start Flag is stored in the boot section of the serial EEPROM or RTC. This section is validated with
Note:
a CRC code to avoid the setting o f random paramet ers. If the CR C of the Boot sect ion is not val id, changing the ISaGRAF
Start Flag has no ef fect becaus e the bw comma nd does n ot v alidate an invalid CRC to avoid u ndesired side ef fects. In this
case, the default of 5 second s is alw ays used. On CPU equ ipped wi th a RTC which hol ds th e ISaGRAF Star t Flag there is
no CRC value included.
The setting of this flag has no influence on the behaviour of the Bootstrap Loader.
Note:
2.11 Example using Hyperterminal from Windows 95
The host is assumed to be a PC with Windows 95 or Windows NT. A serial cable is used to connect the term port of the
board to program to COM2 of the PC. Additionally , w e assu me that we want to program a MOTOROLA S-record built
for the FLASH address of the board. The serial connection runs at the default configuration of 9600 baud with no parity
and one stopbit. The properties should look like the following:
After entering the Command Mode the following screen should appear:
Bootstrap Loader
Enter 'lf' on the target. The target now waits until the MOTOROLA S-records have been transfered over the term. Select
Transfer/Send Text file dialogue box and select the file containing the MOTOROAL S-records.
After selecting Open the dialogue box disappears and the MOTOROLA S-records are transfer ed As soon as the complete
file is sent, the prompt of the Bootstrap Loader appears again.
The commands lsmod, rmmod and ldmod can be used to display, delete, load and update OS -9 modules on base of a single
module.
The progress of searching, load ing, removin g and programming mod ules can be monito red over the term port. None of the
displayed characters indicate an error. The characters displayed have the following meaning:
• sValid OS-9 module foun d
• rRead S-record; valid and in range
• e Rease sector
• pProg ramm record
Every OS-9 module contains a header with a parity value and a CRC value for the whole module. Both values are
Note:
checked and only modules having a valid header parity and a valid CRC value are accepted as OS-9 modules.
3.2 Display OS-9 Modules
The command lsmod displays a list of all valid OS-9 modu les in the programmable FL ASH area. It is always an extended
list displayed which is similar to the outpu t of the OS-9 utility 'mdir -e'.
If there is any gap between two modules the comm and produ ces a separate line, giving informat ion about the pos ition and
the size of the gap. This line is indicated by '*** gap ***'.
After the last valid module is di splayed the command pr oduces a special line gi ving informati on about the positi on and the
size of the free FLASH area. This line is indicated by '*** gap ***'.
3.3 Removing OS-9 Modules
Every OS-9 module displayed with lsmod can be removed with rmmod. Removing a module will unrecoverable remove
the module from the FLASH. The resulting gap in the FLASH is filled by shifting all modules behind the removed module.
At least one module must stay in the FLASH. This module cannot be removed.
Note:
Removed modules cannot be recovered.
Note:
3.4 Loading and Updating OS-9 Modules
With the command ldmod existing OS-9 modules can be updated and new modules can be loaded over the serial connections term or ser0 using S-records.
Loading a module which is already in the FLASH will remove the existing module from the FLASH. Removing a module
will unrecoverable remove the module from the FLASH. Loading an existing module will always update the existing module in the FLASH. There is no check of the module edition number. The new module is always programmed behind the
last module in the FLASH.
The maximum size of the binary mod ule which can be loaded or updated i s 256 Kbytes. If a module greater than 256
Note:
kBytes is sent to the Bootstrap Loader each S-record which exceeds this size will be refused. As a result the loaded module
is declined due to an invalid CRC value.
If only one module is in the FLASH, this module cannot be updated.
Note:
Loading or updating modules from an absolute memory address is not supported.
Note:
3.5 Example using OS-9 development system
The host is assumed to be an OS-9 development system. A serial cable is used to connect the ser0 port of the board to
program to t0 of the development system. The serial connection should run at 38400 baud. The following steps must be
performed to update the 'sysgo' module:
Without parameters, bw displays the current setting.
For <time> 1, 2, 5, 10, 20 and 50 may be specified as time in seconds. Other values are not supported.
CPUs without an user LED or without an ABORT butto n have a BootWaitT ime of at least 5 seconds. T he Bootstrap
Note:
Loader refuses setting a B ootWaitTime of 1-2 seconds.
4.2 Load Flash
Syntax
If [-o[=]<offset>] [-u] [-q] [-c] [-m[=]<adr> -l[=]<len>]
Description
Without parameters, the FLASH is loaded using S-records over the term port.
'<offset>' is a signed 32 bit offset which is added to every record and can be used to move the S-records to the FLASH
position.
This option must be used if S1 or S2 records are used.
Note:
'-u' must be used to download over ser0.
'-q' suppress all messages except error messages.
'-c' clears all untouched sectors and leaves no old code fragments.
For a Load Flash from an absolute address, the -m / -l options must be used.
On CPUs without a ser0 serial connection the Bootstrap Loader will refuse a command including the '-u' option.
Note:
4.3 Memory Display
Syntax
md [<adr>]
Description
Without parameters specified, the FLASH contents starting at the beginning of the programmable FLASH area are displayed. This function is not limited to FLASH and other address ranges can be specified.
The ResetPC in FLASH is not identical to the ResetPC from the programming source (S-records memory block).
Without parameters specified, the current serial port settings are displayed.
<port> specifies the serial port. Valid values are term or serO.
<baud> specifies the baud rate. The values 50, 75, 110, 134.5, 150, 300, 600, 1200, 1800, 2000, 2400, 3600, 4800, 7200,
9600, 19200 and 38400 Baud can be specified.
<bitschar> specifies the bits / character. Valid values are 7 or 8.
<parity> specifies if parity should be checked / generated. The value n specifies none, o for odd and e for even parity.
<stops> specifies the stopbits which will be generated. Valid values are 1 or 2.
No spaces are allowed between the options. Options must be separated with the '/'. Not all options must be specified,
Note:
but the '/' characters must be present to distinguish the different op tions from each other. The sequence can be aborted
after every option.
On CPUs without a ser0 serial connection the Bootstrap Loader will refuse setting ser0 port parameters and will not
Note:
display ser0 port parameter s.
Examples
Setting term to 300 Baud, 7 Bits/char, odd parity and 2 stopbits:
pf term 300/7/o/n
Set the bits / character field to 7 for ser0 only:
pf ser0 /7
Set the stopbits field to 2 for ser0:
pf ser0 ///2
4.5 ISaGRAF Start Flag
Syntax
si [<flag>]
Description:
Without parameters specified, the current setting of the ISaGRAF start flag is displayed. <flag> specifies the new setting.
Valid values are 0 and 1, where 1 means start of ISaGRAF.
The value of this flag has no influence on the behavior of the Bootstrap Loader.
This command exits the Bootstrap Loader and resets the system. It terminates the Bootstrap Loader command mode and resets
the complete system, generating a system reset with the on-board watchdog.
4.7 Help
Syntax
? or help
Description
This command prints the online help page. The display of the help text varies between the different CPUs reflecting the
difference of the CPUs.
4.8 Load and Update Modules
Syntax
ldmod [-qu]
Description
Without any parameters, the module is loaded or updated using S-records over the term port.
'-u' must be used to download over ser0.
'-q' suppress all messages except error messages.
On CPUs without a ser0 serial connection the Bootstrap Loader will refuse a command including the ’-u’ option.
Note:
4.9 List Modules
Syntax
lsmod
Description
List all OS-9 modules in the programmable FLASH area. The display output is similar to the output of the OS-9 utility
On the CM-302 80 Kbytes of the FLASH are reserved for ISaGRAF applications. The commands ldmod, lsmod and
rmmod have a different behavior on the CM-302 than on the other C PUs concerning the handling of this special FLASH area
for ISaGRAF applications.
Each module with a name according to 'isa?1' is treated as ISaGRAF application on the CM-302.
Do not include any ISaGRAF applications in the image programmed via lf. Removing or updating these modules
Note:
with rmmod or ldmod is not possible.
A.1 List Modules
Due to the fixed location of the ISaGRAF applications in the FLASH, there is a gap between the last OS-9 module and the
first application. The display shows two lines of free FLASH, indicated with '*** free ***'. The first shows the free
FLASH for 'normal' OS-9 modules and the second for ISaGRAF applications.
A.2 Remove Modules
If the name of the module is an ISaGRAF application, the module is only searched in the special area of the FLASH.
A.3 Load and Update Modules
Loading a new module or updating an existing ISaGRAF application will alway s go into the special FLASH area for
ISaGRAF applications.
This utility is included in the 'PEP Utili ties'.
'genflash' takes the image of the Bootstrap Loader '-l' and an user-images '-i' and generates a FLASH image '-o' for a
specific board '-b'. The output-f ile has the exact size '-s' and contents of the in stalled FLASHs. This image can directly programmed into the FLASHs.
Appendix CBootstrap Loader Start - 1 sec BREAK Signal
On CPUs without an ABORT button, the Bootstrap Loader will enter the command mode on detecting a BREAK character
of at least one second length at the terminal connector.
Since not all terminals are capable of generating a BREAK signal lasting for one second, the modification described below
helps achieve it.
One possibility to generate the BREAK character is to use a special adapter. This adapter contains a switch which can disconnect the sending line from the host to the target and connect the disconnected line from the target to the DTR line of
the host (CTS on target). The DTR line of the host has the level of a BREAK character.
This switch may be integrated at any position in the connection line, as long as the DTR/CTS line is connected to the host.
After setting the target, the adapter should be configured so that 1- 3 is shorted. On CPUs containing a user LED, the LED
indicates that the Bootstrap Loader is looking fo r the BREAK. After two flashes the ad apter can b e con figu red to 1- 2 an d
immediately the startmenu should appear. If the LED still flashes, reconfigure to 1-3 and wait for another two flashes. On
CPUs without an user LED wait for approximately 2 seconds and than configure to 1-2. If the starmenu does not appears
immediately, reconfigure to 1-3, wait for approximately another 2 seconds.