Flasher St7
Flasher St7
Flasher St7
www.segger.com
!
A product of SEGGER Microcontroller GmbH & Co. KG
2 FLASHER ST7 Manual
FLASHER ST7 Manual 3
Content
Content ....................................................................................................................................................................3
Applicable microcontroller........................................................................................................................................4
Features...................................................................................................................................................................4
Working environment...............................................................................................................................................4
Connecting FLASHER to PC ...................................................................................................................................4
Using FLASHER PC program..................................................................................................................................6
Programming Option Bytes......................................................................................................................................7
Remove Readout Protection of ST7 CPU ...............................................................................................................7
Clock options of ST7 CPU .......................................................................................................................................8
Using the serial link to program in circuit .................................................................................................................8
Serial programming, technical details......................................................................................................................8
Operating FLASHER in stand-alone mode..............................................................................................................8
Remote control of FLASHER ST7 ...........................................................................................................................8
Target system interface for ST7 ..............................................................................................................................9
Error messages .....................................................................................................................................................11
Trouble shooting ....................................................................................................................................................13
Support ..................................................................................................................................................................13
Using Flasher in batch mode .................................................................................................................................14
Introduction.........................................................................................................................................................14
How to start Flasher program in batch mode.....................................................................................................14
General rules......................................................................................................................................................14
List of commands ...............................................................................................................................................14
Return values .....................................................................................................................................................15
Examples ...........................................................................................................................................................15
4 FLASHER ST7 Manual
Applicable microcontroller
Serial mode:
ST72F26x series ST72F260G1, ST72F262G1, ST72F262G2, ST72F264G2,
ST72F324 series ST72F324J6, ST72F324J6T, ST72F324K6, ST72F324K6T, ST72F324J4,
ST72F324K4, ST72F324J2, ST72F324K2
ST72F324L series Look at http://www.segger.com/flasher-st7-supported-microcontrollers.html
ST72F324L series Look at http://www.segger.com/flasher-st7-supported-microcontrollers.html
ST72F324 series ST72F321R4, ST72F321R5, ST72F321R6, ST72F321R7, ST72F321R9,
ST72F321AR4, ST72F321AR5, ST72F321AR6, ST72F321AR7, ST72F321AR9,
ST72F321M6, ST72F321M7, ST72F321M9, ST72F321R9, ST72F321J7,
ST72F321J9
ST72F325 series Look at http://www.segger.com/flasher-st7-supported-microcontrollers.html
ST72F32A series Look at http://www.segger.com/flasher-st7-supported-microcontrollers.html
ST72F34x series Look at http://www.segger.com/flasher-st7-supported-microcontrollers.html
ST72F521 series ST72F521R6, ST72F521AR6, ST72F521M7, ST72F521R7, ST72F521AR7,
ST72F521M9, ST72F521R9, ST72F521AR9
ST72F561 series ST72F561J4, ST72F561J6, ST72F561J7, ST72F561K4, ST72F561K6,
ST72F561R6, ST72F561R7, ST72F561R9
ST7DALI series Look at http://www.segger.com/flasher-st7-supported-microcontrollers.html
ST7FLCD1 series ST7FLCD1
ST7FMC1 series Look at http://www.segger.com/flasher-st7-supported-microcontrollers.html
ST7FMC2 series Look at http://www.segger.com/flasher-st7-supported-microcontrollers.html
ST7FOX series Look at http://www.segger.com/flasher-st7-supported-microcontrollers.html
ST7LITE0 series Look at http://www.segger.com/flasher-st7-supported-microcontrollers.html
ST7LITE1 series Look at http://www.segger.com/flasher-st7-supported-microcontrollers.html
ST7LITE1xB series Look at http://www.segger.com/flasher-st7-supported-microcontrollers.html
ST7LITE2 series ST7Lite20, ST7Lite25, ST7Lite29, ST7DALI
ST7LITE3 series Look at http://www.segger.com/flasher-st7-supported-microcontrollers.html
ST7SUPERLITE Look at http://www.segger.com/flasher-st7-supported-microcontrollers.html
ST7ULTRALITE Look at http://www.segger.com/flasher-st7-supported-microcontrollers.html
Features
• Easy to use windows program
• Serial in target programming using ICC protocol
• Programming / Clearing / Verifying / Read back supported; High speed programming
• 512KByte FLASH to store target program
• PC Program for batch mode processing, allowing usage in automated test systems.
• Once set up, Flasher can be controlled without the use of PC program.
Working environment
General
Flasher has been designed for use in a lab or production environment.
Host System
IBM PC/AT or compatible. CPU: 486 (or better) with at least 8Mb of RAM, running Windows 95 / 98 / 2000
or NT. It needs to have an RS232 interface available for communication with FLASHER.
Power supply
Flasher requires 16 - 18V DC, min. 40mA. You may use the power supply which comes with the tool.
Flasher is protected against polarity reversion on the supply input. Please avoid excess voltage.
Please note: For ST7 targets requiring programming voltage of 12V, the minimum supply voltage is 16V,
ST7 XFlash devices may be handled with Flasher supply voltage of 8V or above.
Installing the FLASHER PC-software
The PC software FLASHER.EXE is distributed on the accommodating 3.5“ floppy disk; the latest version
can be downloaded from our website: http://www.segger.com/flasherst7.html. In order to use the software,
simply copy it onto your hard drive and start the executable which will guide you through the installation
process.
Connecting FLASHER to PC
PC <-> FLASHER interface cable
A standard serial interface cable (null modem) can be used to connect FLASHER to the PC. The pin as-
signment of the 9 pin SUB-D male RS-232 interface connector is as follows:
FLASHER ST7 Manual 5
D-Sub 9, female
D-Sub 9, female
2 2
3 3
Getting started:
1. Connect FLASHER to a PC running Windows 95/98/2000 or NT using the NULL-modem cable and run
the FLASHER software FLASHER.EXE
2. Connect FLASHER to the power supply.
3. Select COM port via Options | Communication menu.
4. Set up the device via Options | Device menu of PC program.
5. For in-circuit programming: Connect FLASHER to target system via customized interface cable.
Before connecting the target system to Flasher, ensure, there is no ground potential difference
between target and Flasher, otherwise the Flasher may be damaged.
6 FLASHER ST7 Manual
Now you should be able to blank check, clear, program, verify or read the target chip in serial mode (if your
target is properly connected to FLASHER). The first time you program or verify, the PC downloads all de-
vice settings and your target program to FLASHER, where it is stored in the on board FLASH chip for pro-
gramming or verification. The PC-Program stores all setup information in the registry; when you start the
program the next time, it will start with the same settings.
Programming / clearing / verifying / blank check
Select one of the com- A modal dialog box will
mands in the TARGET indicate the state and
menu to start the operation. progress of the opera-
Note that some of the menu tion; the operation can
points may be grayed if be canceled hitting the
connection to target is not CANCEL button.
established, or no file is
loaded.
Setup
The operating mode of FLASHER may be changed using
the Setup dialog from the Options menu.
Power up mode, Power down mode and Reset mode should
not be changed for normal operation. Setting of Power down
mode has no effect on FLASHER ST7.
You may change the reset active and reset inactive time if
required by your target hardware.
You may select reset output mode as Push-Pull output or
Open Drain.
All setup settings are stored permanently in FLASHER after
pressing ‘Save setup’ button.
FLASHER ST7 Manual 7
Additional options
The Filling & Misc. Options from the Options menu may be altered
if required.
Normally there is no need to change any of these settings.
The fill byte is automaically programmed to all memory locations
not defined in your target hex file. You should not modify the default
value of 0xFF.
When programming blank (virgin) CPUs ‘Automatic clear before
program’ is not required, so this feature can be disabled to speed
up programming procedure.
Detailed errorlevel on return option may be used to return a de-
tailed errorlevel to the calling program when Flasher is used in
batchmode.
Caution: Any setting of fill byte other than 0xFF will be programmed in option bytes if your target file does not
contain data at address 0x10000 and 0x10001 and option byte sector is enabled for your target CPU.
FLASHER ST7 defines an additional FLASH memory sector for two Option Bytes.
This sector is located at address 0x10000 to 0x10001.
To access Option Bytes of target CPU, this additional sector has to be enabled.
First you should create a HEX file which contains your Option Bytes.
This can easily be done using Flasher PC software as described below.
To create an Option Byte file and program Option Bytes, proceed as follows:
When Option byte settings have to be changed, just merge the Option byte file created under point 7 to your
application program and edit the Option Bytes.
To program another application with the same Option Bytes, just open your application program and merge
the Option Bytes file.
Caution:
ST7 XFLASH and ST7Lite CPUs offer the choice of write protection by Option Byte settings. This protection
can not be removed! So be careful editing your Option Bytes.
FLASHER ST7 offers the additional function “Clear readout protection” under menu “Target” to remove
the readout protection.
Older version of PC program offers the function “Clear All” which also clears readout protection for ST7 tar-
get CPUs.
8 FLASHER ST7 Manual
• Enter ICC mode and do not take into account option byte settings. (OPT disabled)
This mode always requires external clock supplied to target CPU.
The clock might be supplied by any external oscillator (not crystal or resonator).
Flasher delivers approximately 11 MHz clock at OSC_CLK (pin 9) which has to be connected to the clock
input of target CPU, if external oscillator is not available on target board.
• Enter ICC mode and take into account option byte settings. (OPT enabled)
This mode activates CPUs internal oscillator, if option bytes are set up to activate internal oscillator.
Connection of OSC_CLK is not required in this case and Flasher will not deliver any clock signal on pin 9.
To select between the two different modes, you have to select the correct device from menu Device.
The device names in the list are followed by
“OPT disabled” to enter ICC mode without option byte settings (1.)
“OPT enabled” to enter ICC mode and take into account option byte settings (2.)
• Flasher resets the target CPU and then sets up the target to enter ICC mode
• Flasher downloads an application program (RAMCODE) to target CPU
• Flasher starts the target RAMCODE
• RAMCODE accepts commands from Flasher to read, clear or program the target CPU.
The following diagram shows the internal remote control circuitry of FLASHER ST7:
Pin no. Signal Function for ST7 target CPU Specification / remarks
1 GND Common supply and signal ---
ground
2 ICCDATA Data signal for ICC protocol FLASHER Input / Output, CMOS open drain
communication driver via 220 Ohms with active Pull-Up
3 GND Common supply and signal ---
ground
4 ICCCLK Clock signal for ICC protocol FLASHER Input / Output, CMOS open drain
communication driver via 220 Ohms with active Pull-Up
5 GND Common supply and signal ---
ground
6 RESET Target CPU reset FLASHER output (Note 1)
7 VDD Target supply voltage Has to be connected to Flasher as this sup-
plies Flashers target interface.
8 ICCSEL/VPP Programming voltage 12V programming voltage output, also used to
enter ICC mode
9 OSC_CLK Target CPU OSC clock input Clock output from Flasher to target, CMOS
driver via 220 Ohms.
Note 1:
If RESET of target system is driven by a reset circuitry with active high driver, RESET output of FLASHER
must not be connected directly to CPU reset of target.
For ST7 CPUs PUSH/PULL Reset output mode is recommended due to critical timings during initialization.
Note 2:
Clock output of Flasher (Pin 9, Signal OSC_CLK) does not need to be connected under the following cir-
cumstances:
• Target CPU is clocked by any external clock oscillator (not crystal, not resonator) on the target board.
• Target CPU uses internal oscillator by option byte settings and Flasher is set up to take into account
option bytes of target CPU during ICC communication (refer to chapter “Clock options for ST7 CPU”).
Clock output of Flasher has to be connected, if option bytes of target CPU are programmed to use external
clock. As this may happen accidentally, it is a good idea to connect OSC input of target CPU to Flasher in-
terface.
Note that virgin ST7Flite CPUs may require external CPU clock at Port B4 instead of OSC1 input.
Caution:
Before connecting the target with Flasher, ensure that there is NO difference in the ground potential
between Flasher and target.
When the Flasher is connected to a PC via RS232C cable, ensure that the PC and the target operate on
the same ground potential.
Connect the ground lines from PC and your target before connecting the Flasher to the target.
If a ground potential difference between Flasher and target exists, the Flasher may be damaged.
FLASHER ST7 Manual 11
Error messages
The following error messages can occur during operation of FLASHER ST7 (shown in red on your PC) or
returned as errorlevel when operated from batch file and “Detailed errorlevel on return” option is set.
Trouble shooting
Proper operation of FLASHER ST7 depends on your target system. If you have any trouble operating
FLASHER ST7, please:
a) Check your target hardware,
b) Check the connecting cable,
c) Use an oscilloscope to check the state of all signals on the target connector, especially to check if the
target CPU is RESET properly and Programming voltage output, OSC_CLK, ICCDATA and ICCCLK
signals work properly,
d) Make sure FLASHER firmware version matches the PC software version, if not choose Menu | Options |
Download Firmware.
Support
For support questions, please consult our website at www.segger.com. If this does not answer your ques-
tions, please send an email to support_flasher@segger.com.
14 FLASHER ST7 Manual
Introduction
Flasher.exe supports command line options to enable automated programming of targets. This document
describes the supported commands and their respective parameters.
Flasher PC software version 1.72b or above replaces FlasherPro, which is not delivered anymore.
General rules
• The first parameter specified must be the file to load, if download is required.
• The return code is 0 if all operations have been executed successfully, !=0 otherwise.
• All commands are identical to the corresponding commands in the menu bar.
• All commands are processed from left to right.
• If “-exit” is specified as the last command, the program will terminate as soon as any error occurs or af-
ter all commands have been executed.
• If one parameter contains a space use quotation marks for this parameter.
List of commands
The following commands are currently supported as parameter when Flasher is called in batch mode:
Command Description
-download Downloads the loaded hex file into Flashers memory without
starting any additional action.
-checkblank Checks if target is blank
-verify Verifies loaded data against contents of target
-clear Clears target memory area that is currently selected by de-
vice settings
-clearall Removes readout protection of ST7 target CPU and clears
entire chip regardless of target memory area currently se-
lected by device settings
-programverify Programs & verifies target
-program Programs loaded data into target
-readback Reads target area into PC
-start Starts application program
-com<PORT> Sets COM-port of PC(1..4).
-saveas<FILENAME.EXT>[,FIRST-LAST] Saves the file currently in PC memory. The extension needs
to be “MOT”, “HEX” or “BIN” and determines the filetype.
The optional range is used for files in BIN-format.
-merge<FILENAME.EXT> Merge specified file to current data
-delrange<FIRST-LAST> Deletes the specified range of data
-relocate<OFFSET> Relocates current data by offset
-selbanks<START,END> Sets the numbers of start and end bank. The numbers has
to be the same as in the selection box shown under Op-
tions/Device.
-seldevice<DEVICENAME> Selects the desired device. The name of the device has to
be exactly the same as in the selection box shown under
Options/Device. If device name is composed from multiple
words, use apostrophes as shown below:
“-seldeviceST72F521R9 OPT enabled”
-exit Finish execution after performing all commands
-help Displays available commands.
-? The same as –help
NOTE:
To open a HEX file, just place the file name as first parameter just behind the call of Flasher.exe.
FLASHER ST7 Manual 15
Return values
The following return values are sent as errorlevel unless “Options | Filling & misc. | Detailed errorlevel on re-
turn” is selected:
Value Meaning
2 Target not blank
3 Verify error, Contents of target data not identical to FLASHERs internal data.
4 Erase error. Target CPU could not be erased.
5 Error during Program & Verify function
6 Error during programming of target CPU
7 Error during target readback.
8 Error during “Start application”.
9 Timeout error.
10 HEX file could not be opened.
>10 Corresponds to error number which would normally shown on PC screen when program was
used in normal mode.
When “Detailed errorlevel on return” is set as option, the returned value equals to error codes described un-
der chapter “Error messages”.
Examples
Program and verify
In the following example the software
• reads the file TEST.MOT
• tells the Flasher to program and verify,
• exits.
NOTE: Evaluating the return code only works under WindowsNT or Windows2000. If you use Windows9x
Flasher will be started in a new task and you can’t evaluate the return code from the DOS-box from which
you started Flasher, because your DOS-Box will not halt execution until FLASHER finished!
@echo off
rem The first call of Flasher loads the the HEX file
:loop
pause
Flasher -program -verify -exit
:ERROR_1
echo Undefined error
goto end
:ERROR_2
echo ERROR_TARGET_CHECKBLANK
goto end
:ERROR_3
echo ERROR_TARGET_VERIFY
goto end
:ERROR_4
echo ERROR_TARGET_CLEAR
goto end
:ERROR_5
echo ERROR_TARGET_AUTO
goto end
:ERROR_6
echo ERROR_TARGET_PROGRAM
goto end
:ERROR_7
echo ERROR_TARGET_READBACK
goto end
:ERROR_8
echo ERROR_TARGET_STARTAPPLICATION
goto end
:ERROR_9
echo ERROR_TARGET_TIMEOUT
goto end
:ERROR_10
echo ERROR_OPENDOCUMENTFILE
goto end
:end
echo Operation canceled
Selecting device
The following example shows a batch file, where the software
• selects a device,
• reads the contents of the device.