Elprotronic FlashPro2000 User manual

FlashPro2000 Flash Programmer
Multi-FPA API-DLL User’s Guide
Software version 1-1
PM034A02 Rev.1
May-2009
Elprotronic Inc.

Elprotronic Inc.
16 Crossroads Drive
Richmond Hill,
Ontario, L4E-5C9
CANADA
Web site: www.elprotronic.com
E-mail: [email protected]
Fax: 905-780-2414
Voice: 905-780-5789
Copyright © Elprotronic Inc. All rights reserved.
Disclaimer:
No part of this document may be reproduced without the prior written consent of Elprotronic Inc.
The information in this document is subject to change without notice and does not represent a
commitment on any part of Elprotronic Inc. While the information contained herein is assumed to
be accurate, Elprotronic Inc. assumes no responsibility for any errors or omissions.
In no event shall Elprotronic Inc, its employees or authors of this document be liable for special,
direct, indirect, or consequential damage, losses, costs, charges, claims, demands, claims for lost
profits, fees, or expenses of any nature or kind.
The software described in this document is furnished under a licence and may only be used or copied
in accordance with the terms of such a licence.
Disclaimer of warranties: You agree that Elprotronic Inc. has made no express warranties to You
regarding the software, hardware, firmware and related documentation. The software, hardware,
firmware and related documentation being provided to You “AS IS” without warranty or support
of any kind. Elprotronic Inc. disclaims all warranties with regard to the software, express or implied,
including, without limitation, any implied warranties of fitness for a particular purpose,
merchantability, merchantable quality or noninfringement of third-party rights.
Limit of liability: In no event will Elprotronic Inc. be liable to you for any loss of use, interruption
of business, or any direct, indirect, special incidental or consequential damages of any kind
(including lost profits) regardless of the form of action whether in contract, tort (including
negligence), strict product liability or otherwise, even if Elprotronic Inc. has been advised of the
possibility of such damages.
2

END USER LICENSE AGREEMENT
PLEASE READ THIS DOCUMENT CAREFULLY BEFORE USING THE SOFTWARE AND
THE ASSOCIATED HARDWARE. ELPROTRONIC INC. AND/OR ITS SUBSIDIARIES
(“ELPROTRONIC”) IS WILLING TO LICENSE THE SOFTWARE TO YOU AS AN
INDIVIDUAL, THE COMPANY, OR LEGAL ENTITY THAT WILL BE USING THE
SOFTWARE (REFERENCED BELOW AS “YOU” OR “YOUR”) ONLY ON THE CONDITION
THAT YOU AGREE TO ALL TERMS OF THIS LICENSE AGREEMENT. THIS IS A LEGAL
AND ENFORCABLE CONTRACT BETWEEN YOU AND ELPROTRONIC. BY OPENING THIS
PACKAGE, BREAKING THE SEAL, CLICKING “I AGREE” BUTTON OR OTHERWISE
INDICATING ASSENT ELECTRONICALLY, OR LOADING THE SOFTWARE YOU AGREE
TO THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO
THESE TERMS AND CONDITIONS, CLICK ON THE “I DO NOT AGREE” BUTTON OR
OTHERWISE INDICATE REFUSAL, MAKE NO FURTHER USE OF THE FULL PRODUCT
AND RETURN IT WITH THE PROOF OF PURCHASE TO THE DEALER FROM WHOM IT
WAS ACQUIRED WITHIN THIRTY (30) DAYS OF PURCHASE AND YOUR MONEY WILL
BE REFUNDED.
1. License.
The software, firmware and related documentation (collectively the “Product”) is the property of
Elprotronic or its licensors and is protected by copyright law. While Elprotronic continues to own
the Product, You will have certain rights to use the Product after Your acceptance of this license.
This license governs any releases, revisions, or enhancements to the Product that Elprotronic may
furnish to You. Your rights and obligations with respect to the use of this Product are as follows:
YOU MAY:
A. use this Product on many computers;
B. make one copy of the software for archival purposes, or copy the software onto the hard disk
of Your computer and retain the original for archival purposes;
C. use the software on a network
YOU MAY NOT:
A. sublicense, reverse engineer, decompile, disassemble, modify, translate, make any attempt
to discover the Source Code of the Product; or create derivative works from the Product;
B. redistribute, in whole or in part, any part of the software component of this Product;
3

C. use this software with a programming adapter (hardware) that is not a product of
Elprotronic Inc or Texas Instruments Inc.
2. Copyright
All rights, title, and copyrights in and to the Product and any copies of the Product are owned by
Elprotronic. The Product is protected by copyright laws and international treaty provisions.
Therefore, you must treat the Product like any other copyrighted material.
3. Limitation of liability.
In no event shall Elprotronic be liable to you for any loss of use, interruption of business, or any
direct, indirect, special, incidental or consequential damages of any kind (including lost profits)
regardless of the form of action whether in contract, tort (including negligence), strict product
liability or otherwise, even if Elprotronic has been advised of the possibility of such damages.
4. DISCLAIMER OF WARRANTIES.
You agree that Elprotronic has made no express warranties to You regarding the software, hardware,
firmware and related documentation. The software, hardware, firmware and related documentation
being provided to You “AS IS” without warranty or support of any kind. Elprotronic disclaims all
warranties with regard to the software and hardware, express or implied, including, without
limitation, any implied warranties of fitness for a particular purpose, merchantability, merchantable
quality or noninfringement of third-party rights.
4

NOTE: This equipment has been tested and found to comply with the limits for a Class B digital devices,
pursuant to Part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful
interference in a residential installation. This equipment generates, uses, and can radiate radio frequency energy
and, if not installed and used in accordance with the instruction manual, may cause harmful interference to
radio communications. However, there is no guarantee that interference will not occur in a particular
installation. If this equipment does cause harmful interference to radio or television reception, which can be
determined by turning the equipment off and on, the user is encouraged to try to correct the interference by one
of more of the following measures:
* Reorient or relocate the receiving antenna
* Increase the separation between the equipment and receiver
* Connect the equipment into an outlet on a circuit different from that to which the receiver is connected
* Consult the dealer or an experienced radio/TV technician for help.
Warning: Changes or modifications not expressly approved by Elprotronic Inc. could void the user’s authority
to operate the equipment.
This device complies with Part 15 of the FCC Rules.
Operation is subject to the following two conditions:
(1) this device may not cause harmful interference and
(2) this device must accept any interference received,
including interference that may cause undesired
operation.
This Class B digital apparatus meets all requirements of the Canadian
Interference-Causing Equipment Regulations.
Cet appereil numerique de la classe B respecte toutes les exigences du
Reglement sur le material brouilleur du Canada.
5

Table of Contents
1. Introduction ............................................................. 8
2. Getting Started .......................................................... 13
2.1MyFP2000PrgProjects ............................................ 13
3. Example with API DLL ................................................... 16
3.1Example withsingle FPA ......................................... 16
3.2 Example with Multi-FPA API DLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4. List of the DLL instructions ................................................ 20
4.1Multi-FPAinstructions ............................................ 23
F_Trace_ON.................................................. 23
F_Trace_OFF ................................................. 23
F_OpenInstances .............................................. 24
F_CloseInstances .............................................. 24
F_OpenInstancesAndFPAs ...................................... 25
F_Set_FPA_index ............................................. 29
F_Get_FPA_index ............................................. 30
F_Check_FPA_index........................................... 30
F_Disable_FPA_index.......................................... 30
F_Enable_FPA_index .......................................... 31
F_LastStatus.................................................. 31
F_Multi_DLLTypeVer.......................................... 32
F_Get_FPA_SN ............................................... 32
4.2Genericinstructions ............................................... 33
F_Check_FPA_access .......................................... 33
F_Initialization................................................ 34
F_Close_All .................................................. 35
F_SetConfig .................................................. 36
F_GetConfig ................................................. 41
F_Get_Device_Info ............................................ 41
F_DispSetup.................................................. 45
F_ReportMessage, F_Report_Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6

F_GetReportMessageChar ....................................... 46
F_DLLTypeVer ............................................... 47
F_ConfigFileLoad ............................................. 48
F_Reset_Target ............................................... 49
F_Get_Targets_Vcc ............................................ 50
4.3 Data Buffers access instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
F_ReadCodeFile .............................................. 51
F_Get_CodeCS ............................................... 52
F_ReadPasswFile.............................................. 53
F_Clr_Code_Buffer ............................................ 54
F_Put_Word_to_Code_Buffer.................................... 54
F_Get_Word_from_Code_Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
F_Put_Word_to_CSM_Buffer.................................... 56
F_Get_Word_from_CSM_Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
F_Put_Word_to_Buffer ......................................... 57
F_Get_Word_from_Buffer ...................................... 57
4.4Encapsulatedinstructions........................................... 59
F_AutoProgram ............................................... 59
F_Verify_CSM_Password ....................................... 60
F_Memory_Erase.............................................. 61
F_Memory_Blank_Check ....................................... 61
F_Memory_Write.............................................. 62
F_Memory_Verify ............................................. 62
F_Memory_Read .............................................. 62
F_Write_CSM_Password ....................................... 63
4.5Sequentialinstructions............................................. 64
F_Open_Target_Device ......................................... 64
F_Close_Target_Device......................................... 65
F_Segment_Erase.............................................. 65
F_Sectors_Blank_Check ........................................ 66
F_Write_Word_to_RAM........................................ 67
F_Read_Word ................................................ 67
F_Copy_Buffer_to_Flash........................................ 68
F_Copy_Flash_to_Buffer........................................ 69
FlashPro2000 Multi-FPA API-DLL User’s Guide PM034A02 Rev.1 7

1. Introduction
The FlashPro2000 adapter can be remotely controlled from other software applications
(Visual C++, Visual Basic etc.) via a DLL library. The Multi-FPA - allows to remotely control
simultaneously up to sixteen Flash Programming Adapters (USB-FPAs) significantly reducing
programming speed in production.
Figure 1.1 shows the connections between PC and up to sixteen programming adapters. The
FPAs can be connected to PC USB ports directly or via USB-HUB. Direct connection to the PC is
faster but if the PC does not have required number of USB ports, then USB-HUB can be used. The
USB-HUB should be fast, otherwise speed degradation can be noticed. When the USB hub is used,
then the D-Link’s Model No: DUB-H7, P/N BDUBH7..A2 USB 2.0 HUB is recommended.
Figure 1.1
FlashPro2000 Multi-FPA API-DLL User’s Guide PM034A02 Rev.1 8

Block diagram of the Multi-FPA application DLL is presented on the Figure 1.2.
To support this new Multi-FPA API-DLL feature, the software package contains seventeen dll files
- the Multi-FPA API-DLL selector (FlashPro2000-FPAsel.dll)
- sixteen standard single FPAs API-DLLs (FlashPro2000-FPA1.dll, .......)
Figure 1.3 shows the logical connections between these dll files.
The main Multi-FPA dll (FPA-selector - FlashPro2000-FPAsel.dll) allows to transfer API-DLL
functions coming from application software to desired single application dll (FlashPro2000-FPA1.dll
to FlashPro2000-FPA16.dll).
The FlashPro2000-FPAsel.dll file is transparent for all API-DLL functions implemented in the single
FPA API-DLLs functions. Desired destination FPA can be selected using the function
F_Set_FPA_index( fpa );
where the
fpa = 1 to 16 when only one desired FPA required to be selected
or fpa = 0 when ALL active FPAs should be selected.
Figure 1.2
FlashPro2000 Multi-FPA API-DLL User’s Guide PM034A02 Rev.1 9

The selected FPA index modified by the F_Set_FPA_index( fpa ) instruction can be modified at any
time. By default, the FPA index is 1 and if only one FPA is used then fpa index does not need to be
initialized or modified. When the fpa index 1 to 16 is used, then the result is coming back to
application software from the single API-DLL via transparent Multi-FPA dll. When fpa index is 0
(ALL-FPAs) and results are the same from all FPAs, then the same result is passing back to
application software. If results are not the same, then the Multi-FPA dll is returning back value -1
(minus 1) and all recently received results can be read individually using function
F_LastStatus( fpa )
Most of the implemented functions allows to use the determined fpa index 1 to 16 or 0 (ALL-FPAs).
When functions return specific value back, like read data etc, then only determined FPA index can
be used ( fpa index from 1 to 16). When the fpa index is 0 (ALL-FPAs) then almost all functions are
executed simultaneously. Less critical functions are executed sequentially from FPA-1 up to FPA-16
but that process can not be seen from the application software.
When the inactive fpa index is selected, then return value from selected function is -2 (minus 2).
When all fpa has been selected (fpa index = 0) then only active FPAs will be serviced. For example
if only one FPA is active and fpa index=0, then only one FPA will be used. It is save to prepare the
universal application software that allows to remote control up to sixteen FPAs and on the startup
activate only desired number of FPAs.
It should be noticed, that all single API-DLLs used with the Multi-FPA DLL are fully independent
to each other. From that point of view it is not required that transferred data to one FPA should be
the same as the transferred data to the others FPAs. For example code data downloaded to FPA-1
can be different that the code data downloaded to the FPA-2, FPA-3 etc. But even in this case the
programming process can be done simultaneously. In this case the desired code should be read from
the code file and saved in the API-DLL-1, next code file data should be saved in the API-DLL-2 etc.
When it is done, then the F_AutoProgram can be executed simultaneously with selected all active
FPAs. All FPAs will be serviced by his own API-DLL and data packages saved in these dlls.
The following commands are supported in the DLL library:
Initialization and termination communication with the programming adapter,
Programmer configuration setup,
Programming report message,
Code data and password data read from the file,
Reset target device,
Auto program target device ( erase, blank check, program and verify),
CSM Password verification,
FlashPro2000 Multi-FPA API-DLL User’s Guide PM034A02 Rev.1 10

All or selected part of memory erase,
All or selected part of memory blank check,
All or selected part of memory write,
All or selected part of memory verify,
All or selected part of memory read,
Open or close communication with the target device,
Selected memory segment erase,
Selected part of memory blank check,
Selected part of memory segment write,
Selected part of memory segment read,
CSM Password write.
The FlashPro2000 Flash Programmer software package contains all required files to remotely control
programmer from a software application. When software package is installed then by default the
DLL file, library file and header file are located in:
C:\Program Files\Elprotronic\C2000\USB FlashPro2000\API-DLL
FlashPro2000-FPAsel.dll - Multi-FPA selection/distribution DLL
FlashPro2000-FPA1.dll - API-DLL for FPA adapter
FlashPro2000-Dll.h - generic header file for dll
FlashPro2000-FPAsel-BC.lib - lib file for Borland VC++
FlashPro2000-FPAsel.lib - lib file for MS VC++
C2000-Errors-list.cpp - Errors list description
C2000-Errors-list.h - Errors list definitions
config.ini - default configuration file for the FPAs (optional)
The entry dll (FlashPro2000-FPAsel.dll) contains two groups of the same functions used in
C++ application and Visual Basic applications All procedure names used in the Visual Basic are
starting from VB_xxxx, (and have the _stdcall calling declaration) when procedure names used in
the C++ are starting from F_xxxx (and have the _Cdecl calling declaration).
When the MS VC++ application is created, then following files should be copied to the source
application directory:
FlashPro2000-Dll.h - header file for C++
FlashPro2000-FPAsel.lib - lib file for C++
C2000-Errors-list.cpp - (Optional) Errors list description
C2000-Errors-list.h - Errors list definitions
and to the release/debug application directory
FlashPro2000-FPAsel.dll - Multi-FPA selection/distribution DLL
FlashPro2000 Multi-FPA API-DLL User’s Guide PM034A02 Rev.1 11

FlashPro2000-FPA1.dll - API-DLL for FPA adapter
config.ini - (optional) default configuration file for the FPAs
Executable application software package in C++ the requires following files
When application in Visual Basic is created, then following files should be copied to the source or
executable application directory:
FlashPro2000-FPAsel.dll - Multi-FPA selection/distribution DLL
FlashPro2000-FPA1.dll - API-DLL for FPA adapter
config.ini - (optional) default configuration file for the FPAs
All these files ‘as is’ should be copied to destination location, where application software using DLL
library of the FlashPro2000 Flash programmer is installed. The config.ini file has default setup
information. The config.ini file can be modified and taken directly form the FlashPro2000 Flash
Programmer (GUI) application software. To create required config.ini file the GUI FlashPro2000
Flash programmer software should be open and required setup (memory option, interface select etc)
should be created. When this is done, programming software should be closed and the config.ini file
with the latest saved configuration copied to destination location. Note, that the configuration setup
can be modified using DLL library function.
FlashPro2000 Multi-FPA API-DLL User’s Guide PM034A02 Rev.1 12

2. Getting Started
2.1 MyFP2000Prg Projects
The MyFP2000Prg projects are examples of using the Multi-FPA API-DLL with Microsoft Visual
Studio 7.0 (2002). They are intended to help users create their own application that uses the API-
DLL by providing a simple starting point. When using Visual Studio C++ include the following files
should be included to your program:
FlashPro2000-Dll.h
FlashPro2000-FPAsel.lib
FP2000FPA0Lib.cpp
FP2000FPA0Lib.h
C2000-Error-list.cpp
C2000-Error-list.h
The above files are located in the following directory:
...\Elprotronic\C2000\USB FlashPro2000\API-DLL-MyPrg\Cpp\scr
To run your application you will need to allow your application access to the Multi-FPA dynamically
linked library. A simple way to do this is to copy the following files into your directory where
executable file is located:
FlashPro2000-FPAsel.dll
FlashPro2000-FPA1.dll
config.ini (optional)
The easy demo project MyFP2000Prg uses API-DLLs and files listed above is located in directory
...\Elprotronic\C2000\USB FlashPro2000\API-DLL-MyPrg\Cpp\MyFP2000Prg
and are included for demonstration purposes only. The sample project can be opened by selecting
the project file MyFP2000Prg.vcproj located in directory
FlashPro2000 Multi-FPA API-DLL User’s Guide PM034A02 Rev.1 13

...\Elprotronic\C2000\USB FlashPro2000\API-DLL-MyPrg\Cpp\MyFP2000Prg
The following dialog box will be displayed when project executed (see figure 2.1).
Dialog box contains few buttons, that call procedures listed in the mentioned above files. See
contents in the MyFP2000PrgDlg.cpp file located in the project directory, how these procedures are
called from application software. There are several useful procedures located in the FP2000FPA-
Lib.cpp file that significantly simplify the FPA initialization process. See comments for each
procedures located in this file.
The first procedure named
Scan_all_FPAs()
searches all FPAs connected to your PC via USB ports. As the results, adapter serial numbers of the
detected FPAs are located in the FPA_SN_list[k] where k = 0 up to 15. Up to sixteen FPA SN can
be located in this data block. SN list are located starting from FPA_SN_list[0].
Figure 2.1
FlashPro2000 Multi-FPA API-DLL User’s Guide PM034A02 Rev.1 14

get_devices_list()
The get_devices_list() procedure takes a list of supported target devices containing MCU name,
flash start and end addresses etc. from API-DLL .The MCU list is saved in the following structure
typedef struct
{
char name[DEVICE_NAME_SIZE];
int index;
long flash_start_addr;
long flash_end_addr;
long OTP_start_addr;
long OTP_end_addr;
long RAM_size;
int group;
int double_ID;
} DEVICELIST;
DEVICELIST DeviceList[300];
Up to 100 devices can be saved in DeviceList. When required, the size of this data block can be
increased in the future. Currently, device list contains about 30 devices. The device names in the
DeviceList are sorted in alphabetic order. Alphabetical order is convenient for users, however the
API-DLL requires fixed MCU index when selecting the particular MCU. In the structure above the
MCU index required by API-DLL is located in
DeviceList[k].index
and procedure setting the required MCU becomes as follows
F_SetConfig( CFG_MICROCONTROLLER, DeviceList[k].index );
All other useful procedures that can be useful are listed below
int set_default_config( void );
int write_data_to_buffer( int dest, long addr, long size, UINT16 *data );
int read_data_from_buffer( int source, long addr, long size, UINT16 *data );
See the MyFP2000PrgDlg.cpp file how to strat-up communication with FPA and how to use the
API-DLLs instructions.
FlashPro2000 Multi-FPA API-DLL User’s Guide PM034A02 Rev.1 15

3. Example with API DLL
3.1 Example with single FPA
The code example described below uses one programming adapter. The Multi-FPA API-DLL
selector should be select for FPA-1 only. The fpa_index should be set to 1 or should be unmodified.
The default value of the fpa_index when one adapter is detected only is 1.
Initialization opening procedure for the USB-FPA can be as follows:
response = F_OpenInstancesAndFPAs( “*# *” );
// DLL and FPA (one only) initialization
if( response == 0 )
{
//The FPA has not been found. Exit from the program.
}
F_Set_FPA_index( 1 ); // select FPA 1 for
F_Initialization( ); // init FPA
Below is an example of the simplified (without error handling procedures) application
program written in C++ that allows to initialize one FPA, and run an autoprogram with the same
features like an autoprogram in the standard FlashPro2000 (GUI) software.
1. Download data to target device
F_OpenInstancesAndFPAs( “*# *” ); // DLL and FPA (one only) initialization
if( response == 0 )
{
//The FPA has not been found. Exit from the program.
}
F_Set_FPA_index( 1 ); // select FPA 1 only
F_Initialization( ); // init FPA
//– functions above initialized at the startup only ----
F_ReadConfigFile( filename ); // read configuration data and save
// to API-DLLs
F_ReadCodeFile( format, filename ); // read code data and save to DLL
do
{
status = F_AutoProgram( 1 ); //start autoprogram
if ( status != TRUE )
{
//’status’ contains status error number
// see the C2000-Error-list.h and C2000-Error-list.cpp list
// and error description
FlashPro2000 Multi-FPA API-DLL User’s Guide PM034A02 Rev.1 16

..............................
}
else
{
................................................
}
} while(1); //make an infinite loop until last target device programmed
.................................................................
//– functions below called at the end of session
F_CloseInstances();
Note: The F_OpenInstancesAndFPAs(..) and F_Initialization() functions should be called once
and the startup and the F_CloseInstances() function should be called as the last one after all
functions are finished in similar way like the FlashPro2000 GUI software is opening once
and closed at the end when job is finished. The startup initialization take few seconds (when
the F_OpenInstancesAndFPAs(..) and F_Initialization() are executed) until dll
installation is established and desired firmware downloaded to FPA adapter(s). Application
software should call the initialization procedures at the startup only, and close access to API-
DLL at the end, when all tests of a lot of units are finished. Closing instances and opening
it again is a waist a time.
3.2 Example with Multi-FPA API DLL
The code example described below uses Multi-FPA API-DLL. The multi-FPA API-DLL is a shell
that allows to transfer incoming instructions from application software to desired FPA’s. All
instructions related to single FPA are detailed described in the chapters 4.2, 4.3, 4.4 and 4.4.
Instructions specific to Multi-FPA features described in the chapter 4.1.
Application DLL should be initialized first, before other DLLs instruction can be used.
response = F_OpenInstancesAndFPAs( FPAs-setup.ini );
// DLL and FPA initialization
if( response == 0 )
{
//The FPA has not been found. Exit from the program.
}
F_Set_FPA_index( ALL_ACTIVE_FPA ); // select all FPA’s
F_Initialization( ); // init all FPA’s
In example above number of the opened USB-FPAs are specified in the ‘FPAs-setup.ini’
FlashPro2000 Multi-FPA API-DLL User’s Guide PM034A02 Rev.1 17

Below is an example of the simplified (without error handling procedures) application program
written in C++ that allows to initialize all dlls and FPA, and run an autoprogram with the same
features like autoprogram in the standard FlashPro2000 application software.
1. Download data to all target devices (uses USB-FPAs)
response = F_OpenInstancesAndFPAs( FPAs-setup.ini);
// DLL and FPA initialization
if( response == 0 )
{
//The FPA has not been found. Exit from the program.
}
F_Set_FPA_index( ALL_ACTIVE_FPA ); // select all FPA’s
F_Initialization( ); // init all FPA’s
F_ReadConfigFile( filename ); // read configuration data and save
// to all API-DLLs
F_ReadCodeFile( filename ); // read code data and save to all //
API-DLLs
do
{
status = F_AutoProgram( 1 );
//start autoprogram-to program all targets simultaneously with
//the same downloaded data to all target devices.
if ( status != TRUE )
{
if ( status == FPA_UNMACHED_RESULTS )
{
for (n=1; n<=MAX_FPA_INDEX; n++ ) status[n] = = F_LastStatus( n);
................................................
}
else
{
................................................
}
}
} while(1); //make an infinite loop until last target device programmed
.................................................................
F_CloseInstances();
Note, that all single API-DLL are independent from each others and it is not required that all data
and configuration should be the same for each API-DLLs (each FPAs, or target devices) . For
example - code data downloaded to the first target device can be the same (but it is not required) as
code data downloaded to second target device etc. In the example below the downloaded code to
target devices are not the same .
FlashPro2000 Multi-FPA API-DLL User’s Guide PM034A02 Rev.1 18

2. Download independent data to target devices (uses USB-FPAs)
F_OpenInstancesAndFPAs( FPAs-setup.ini); // DLL and FPA initialization
F_Set_FPA_index( ALL_ACTIVE_FPA ); // select all FPA’s
F_Initialization( ); // init all FPA’s
.................................................................
F_Set_FPA_index( ALL_ACTIVE_FPA ); // select all FPA’s
F_ReadConfigFile( filename ); // read configuration data and save
// to all API-DLLs
F_Set_FPA_index( 1 ); // select FPA 1
F_ReadCodeFile( filename1 ); // read code data and save to
// API-DLL-1
F_Set_FPA_index( 2 ); // select FPA 2
F_ReadCodeFile( filename2 ); // read code data and save to
// API-DLL-2
................................................................
F_Set_FPA_index(7 ); // select FPA 7
F_ReadCodeFile( filename7 ); // read code data and save to
// API-DLL-7
F_Set_FPA_index( 8 ); // select FPA 8
F_ReadCodeFile( filename8 ); // read code data and save to
// API-DLL-8
F_Set_FPA_index( ALL_ACTIVE_FPA ); // select all FPA’s
do
{
status = F_AutoProgram( 1 );
//start autoprogram - to program all targets simultaneously
//with the independent downloaded data to all target devices.
if ( status != TRUE )
{
if ( status == FPA_UNMACHED_RESULTS )
{
for (n=1; n<=MAX_FPA_INDEX; n++ ) status[n] = = F_LastStatus( n);
................................................
}
else
{
................................................
}
}
} while(1); //make an infinite loop until last target device programmed
.................................................................
F_CloseInstances();
See source code in the DEMO program written in Visual C++, Visual Basic or LabView for more
detail.
FlashPro2000 Multi-FPA API-DLL User’s Guide PM034A02 Rev.1 19

4. List of the DLL instructions
Application DLLs files are the same for the application software written under Visual C++,
Visual Basic, LabView etc. From that reason the API-DLL not transfers the pointers from the API-
DLL to application, because Visual Basic (or other software) will not be able to use these functions.
When a lot of data are transferred from API-DLL to application, then these data should be read item
by item.
All DLL instructions are divided to four groups - related to Multi-FPA selector, single FPA
generic, single FPA encapsulated and single FPA sequential instructions. Multi-FPA specific
instructions are related to the Multi-FPA DLL only. Generic instructions are related to initialization
programmer process, while encapsulated and sequential instructions are related to target device’s
function. Encapsulated and sequential instructions can write, read, and erase contents of the target
device’s flash memory.
Multi-FPA specific instructions are related to load and release the single-FPA dlls, selection
of the transparent path and sequential/simultaneous instructions transfer management. All other
instructions are related to single FPAs.
Generic instructions are related to initialization programmer process, configuration setup and
data preparation, Vcc and Reset to the target device. Generic instructions should be called first,
before encapsulated and sequential instruction.
Encapsulated instructions are fully independent executable instructions providing access to
the target device. Encapsulated instructions can be called at any time and in any order. When called
then all initialization communication with the target device is starting first, after that requested
function is executed and at the end communication with the target device is terminated and target
device is released from the programming adapter.
The encapsulated functions should be mainly used for programming target devices. These
functions perform most tasks required during programming in an easy to use format. These functions
use data provided in Code Files, which should be loaded before the encapsulated functions are used.
To augment the functionality of the encapsulated functions, sequential functions can be executed
immediately after to complete the programming process.
FlashPro2000 Multi-FPA API-DLL User’s Guide PM034A02 Rev.1 20
Table of contents
Other Elprotronic Motherboard manuals