CYCLONE-User-Manual.pdf - 第109页
User Manual For Cyclone LC Programmers 109 6 - Starting address is not in module. 7 - Ending address is not in module or is less than starting address. 8 - Unable to open file for uploading. 9 - File write error during u…

User Manual For Cyclone LC Programmers 108
When the user calls the CSAP executable that will reference this CFG file they will need to specify
the values of these parameters on the command line. See the example below, where the first of
these parameters is used to specify a programming algorithm (.SRP), the second an .S19 file, and
the third a programming command (VM).
CSAPACMPZ
/PARAM1=C:\PEMICRO\Freescale_MK40X256_PFlash_DFlash.ARP
“/PARAM2=C:\PEMICRO\EXAMPLE FILES\TEST.S19"
/PARAM3=VM
Note: Notice that /PARAM2 is enclosed in double quotation marks. This is because the parameter has a
space in its value (Example Files). The surrounding double quotation marks are required in this
situation, in order to indicate to Windows that it is a single parameter.
The complete example command line would be as below (note that this is one continuous line; no
line breaks):
C:\PROJECT\CSAPACMPZ C:\PROJECT\GENERIC.CFG /
PARAM1=C:\PEMICRO\Freescale_MK40X256_PFlash_DFlash.ARP “/
PARAM2=C:\PEMICRO\EXAMPLE FILES\TEST.S19” /PARAM3=VM
9.2.5 Sample Batch File
Here is an example of how to call a command-line programmer and test its error code return in a
simple batch file. Sample batch files are given for both Windows 95/98/XP and Windows 2000/NT/
XP/Vista/7/8/10.
9.2.5.1 Windows NT/2000/Vista/7/8/10:
C:\PEMicro\CYCLONE\IMAGECREATION\IMAGECREATIONSUPPORTFILES\CSA
PACMPZ.EXE C:\PROJECT\ENGINE.CFG
PORT=USB1
if errorlevel 1 goto bad
goto good
:bad
ECHO BAD BAD BAD BAD BAD BAD BAD BAD
:good
ECHO done
Note: Path names of files that are relative to the CSAP executable can also be used.
9.3 CSAP Error Returns
An Error code is returned by the Image Compiler so that a script file or an application launching the
Image Compiler can check for it. The error codes used are:
0 - Program completed with no errors.
1 - Canceled by user.
2 - Error reading S record file.
3 - Verify error.
4 - Verify canceled by user.
5 - S record file is not selected.

User Manual For Cyclone LC Programmers 109
6 - Starting address is not in module.
7 - Ending address is not in module or is less than starting address.
8 - Unable to open file for uploading.
9 - File write error during upload.
10 - Upload canceled by user.
11 - Error opening algorithm file.
12 - Error reading algorithm file.
13 - Device did not initialize.
14 - Error loading .PCP file.
15 - Error enabling module just selected.
16 - Specified S record file not found.
17 - Insufficient buffer space specified by .PCP to hold a file S-record.
18 - Error during programming.
19 - Start address does not point into module.
20 - Error during last byte programming.
21 - Programming address no longer in module.
22 - Start address is not on an aligned word boundary.
23 - Error during last word programming.
24 - Module could not be erased.
25 - Module word not erased.
26 - Selected algorithm file does not implement byte checking.
27 - Module byte not erased.
28 - Word erase starting address must be even.
29 - Word erase ending address must be even.
30 - User parameter is not in the range.
31 - Error during algorithm-specified function.
32 - Specified port is not available or error opening port.
33 - Command is inactive for this .PCP file.
34 - Cannot enter background mode. Check connections.
35 - Not able to access processor. Try a software reset.
36 - Invalid algorithm file.
37 - Not able to access processor RAM. Try a software reset.
38 - Initialization canceled by user.
39 - Error converting hexadecimal command number.
40 - Configuration file not specified and file prog.cfg does not exist.
41 - Algorithm file does not exist.
42 - Error in io_delay number on command line.
43 - Invalid command line parameter.
44 - Error specifying decimal delay in milliseconds.
47 - Error in script file.
49 - Cable not detected
50 - S-Record file does not contain valid data.
51 - Checksum Verification failure - S-record data does not match MCU memory.
52 - Sorting must be enabled to verify flash checksum.

User Manual For Cyclone LC Programmers 110
53 - S-Records not all in range of module. (see "v" command line parameter)
54 - Error detected in settings on command line for port/interface
60 - Error calculating device CRC value
61 - Error - Device CRC does not match value given
70 - Error - CSAP is already running
71 - Error - Must specify both the INTERFACE and PORT on the command line
72 – The selected target processor is not supported by the current hardware interface.