presto_en.pdf - 第65页

Page 65 /conf file When UP closes, it saves its console content to th e file, b ut only when th e operation was start ed from the commandline. Note: When no p arameter requ esting an operation is used, the UP starts and …

100%1 / 101
Page 64
/df file When there is UP project file specified after
the /p or /o parameter and user wants to
use the project and to change data file
only, the /df parameter with the new data
file name can be used for this purpose. If
the file name contains space(s), it must be
enclosed by inverted commas.
/eeonly This executes the selected operation only
with the data (EEPROM) memory or only
with the information memory in the case of
MSP430.
/part name This selects the required device in
UP.
/erase This erases the device.
/wnd class name A different window class name. More
than one instance of the UP program can
be started using this parameter (running
then simultaneously). Each new instance of
the running UP must have a different class
name.
/cfg If this parameter is used in combination
with parameter /p, only the configuration
memory gets programmed. This is useful
for programming AVR microcontrollers, for
example, which can be switched to a faster
oscillator and then programmed much
faster.
/devid If this parameter is used in combination
with parameter /p, the software only
checks the device's Device ID.
/blank This checks device erasure (blank check)
and returns an error code if the result is not
OK.
/verify file This verifies the device.
/read file This reads the device and saves the read
content to the file.
/s programmer_SN This makes it possible to
select a programmer by its serial number.
The serial number is to be keyed in the way
it is displayed in the UP program and
printed on the programmer bottom.
Example: 016709 or A6016709. When *
sign is used instead of the serial number,
then any available programmer of the
selected type is used.
/progname name This makes it possible to
select a programmer by its name such as
PRESTO or FORTE for example.
/noboot This skips programming of the MSP430 boot
memory.
/boot This performs the selected operation only
with the MSP430 boot memory.
Note
PIC32 microcontrollers also have a boot
memory. This, however, uses variables and
a data memory form for programming, so it
works with parameters for a data memory
and not with parameters for a boot
memory. A similar situation can be found in
the information memory of MSP430 and
CC430 microcontrollers.
/code This performs the selected operation only
with code or main memory.
/getpartrev Only reads the revision of the device
and returns revision + 0x10000 as the error
code.
/sn serial_number Using this parameter it is possible to
enter the value of the serial number, which
is then written to the address in accordance
with the serial numbers settings. In the
settings, the serial numbers have to be
configured as Computed, Manual. The
number is entered as hexadecimal, e.g.
1234ABCD.
Page 65
/conf file When UP closes, it saves its console
content to the file, but only when the
operation was started from the
commandline.
Note: When no parameter requesting an operation is
used, the UP starts and keeps running. When a parameter
requesting an operation is used and the software is not
running, the operation is executed and the software
closes if it does not need user interaction.
Using a Project File
When the user programs different devices, it can happen
that the program is set up differently than expected.
Whenever it is possible, it is recommended to use
project files (.PPR) that hold all the program settings
needed for programming and paths to the data files.
Examples of Use
File
Opening
up.exeproject.ppr
up.exe"C:\MyDocuments\RecentProjects\PIC
\Mylatestproject\project.ppr"
Device Programming
up.exe/pproject.ppr
up.exe/p"C:\MyDocuments\RecentProjects\PIC
\Mylatestproject\project.ppr"
5.6.2 Program Return
Codes
0 Problem-free execution.
1 File error. File not found or incorrect file
format, for example.
2 Equipment error. Communication test
failed, communication error.
3 Programming preparation error. device
cannot be erased, etc.
4 Programming error.
5 Verification error.
6 Programming failed due to a need to
communicate with user.
7 Device ID error.
8 Not supported.
9 Error of the serial number entered using the
/sn parameter.
10 Error, device protected.
0x10000 + const Revision of the device read using /
getpartrev parameter.
Note: The return value can be found in the %errorlevel%
variable if working with batch files.
5.6.3 Work flow monitoring
When the application was started in the quiet mode
(with /q parameter) on the commandline, an external
application can monitor its work flow by reading of the
value of the main ProgressBar, it is being continuously
saved to a Named Shared Memory.
The UP software shares a variable of size of one Integer. It
can be accessed using OpenFileMapping and
MapViewOfFile Windows functions. The name of the
shared variable is the UP window class name plus
_Progress string. E.g., when the name is set to up1 using
the /w parameter, then the name of the shared variable is
up1_Progress.
In the installation directory of the UP, in an
example_ProgressBar subdirectory, there is a C language
example of how to read the ProgressBar value.
Page 66
5.7
Running UP by Means
of Windows Messages
The UP program can be controlled by means of messages
of the Windows operating system. The running instance of
UP executes the requested command immediately after
message receipt.
Messages must be sent to "up v1.x" class window. The
message type is always of WM_USER.
Commands are identified by “wParam” while parameters
by “lParam”.
5.7.1 List of Commands
Unless specified otherwise, the command returns to its
return value:
0 error, failed
1 everything worked OK
Commands with a wParam of 1, 2, 3, 4, 5, 6, 7 and 24 are
thread blocking.
wParam
lParam
Description
0
0
does not perform anything, returns 1
1
SetForegroundWindow()
2
Maximize, SetForegroundWindow()
1
any
programs everything, same return code as
from the command line
2
any
programming excl. data memory, same
return code as from the command line
3
see
below
programming incl. erasing, same return code
as from the command line
bit 0 = 1
code/main memory
bit 1 = 1
data memory (EEPROM)
bit 2 = 1
configuration memory
bit 3 = 1
boot memory (MSP430, CC430)
4
see
below
reading
bit 0 = 1
code/main memory
bit 1 = 1
data memory (EEPROM)
bit 2 = 1
configuration memory
bit 3 = 1
boot memory (MSP430, CC430)
5
see
below
differential programming
bit 0 = 1
code/main memory
bit 1 = 1
data memory (EEPROM)
bit 2 = 1
configuration memory