Numberedheadings | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||
IntroductionThis document describes the FlashPro-ARM M and GangPro-ARM M API-DLL, and explains how to use it. The API-DLL is a dynamic library that can control multiple Flash Programming Adapters (FPAs) simultaneously. It is intended for users that need to use multiple ARM M FPAs to program a board with multiple ARM microcontroller units (MCUs)target devices. An example hardware setup is shown below: Figure 1.1: Multiple FlashPro-ARM adapters controlled from one user application : Multiple GangPro-ARM adapters controlled from one user applicationSoftware InstallationFlashPro-ARM M or GangPro-ARM M Programmer package contains:
The FlashPro-ARMM/GangPro-ARM software runs under Windows (x86/x64) and Linux (amd64/armhf). Follow instructions below to install the software: The USB-FPA 6.1 adapter (grey) only supports the Windows x86 installer. The XStream-Iso, and XStreamPro-Iso adapters (black) support all installers.M software runs under Windows (x86/x64) and Linux (amd64/armhf). Follow instructions below to install the software:
Driver InstallationThe Linux installation relies on the default libusb-1.0 packages that can be installed using apt. The Windows installation will install the Elprotronic USB driver files in Windows directories "Windows\inf" and "Windows\system32\drivers".
Hardware Setup
DLL OverviewThe FlashPro-ARMM/GangPro-ARM M DLL setup is implemented using two DLLs, the Multi API-DLL and the API-DLL. One instance of the top-level Multi API-DLL controls multiple instances of the API-DLL. The Multi API-DLL manages all global meta-data and control flow while the API-DLL controls one adapter individually. The user interacts only with the Multi API-DLL. Initializing multiple FPAs using the Multi API-DLL is straightforward. The top-level function F_OpenInstancesAndFPAs() accepts a string or file input path that specifies the index and serial numbers (SNs) of all the FPAs the user wishes to control. With this input the Multi API-DLL will create enough API-DLL instances to manage all FPAs automatically. Afterwards, the Multi API-DLL has several functions which allow the user to select which FPA is controlled (or all at once), and issue commands that will be automatically forwarded to the corresponding API-DLL. Currently, up to 64 individual FPAs can be controlled using the Multi API-DLL (these would normally be connected using USB hubs connected to the host computer’s USB port). Setting up DLL Demo EnvironmentAfter installation, the relevant files are found in the directory:
The relative directories FlashPro-ARM M and GangPro-ARM M will contain the FlashPro-ARM M and GangPro-ARM M executables. The API-DLL directory contains all the demo applications, and the bin and debug directories that have the Multi API-DLL and API-DLL files. The easiest way to get started using the DLL is to run the executable code examples. To run the examples:
Running Demo ApplicationsThe FlashPro-ARM M and GangPro-ARM M installation package has demos in C++, C#, Python and Labview. The projects have already been compiled and the executables are available in the API-DLL\bin\ and API-DLL\debug directories. The demo projects have been configured such that they will build their executables to the bin directory for release build and debug directory for debug build. Debug symbols for FlashPro-ARM M or GangPro-ARM M libraries are not available. The code examples provided illustrate how to use most, but not all available DLL functions. C/C++ Basic demo code sequenceThe aforementioned code snippet works both with the FlashPro-ARM M and GangPro-ARM M libraries because those functions are common to both adapters. For specific functions exclusive to the FlashPro-ARM M or GangPro-ARM M please consult the DLL functions chapter within this guide. Required filesThe following files should be placed within the current working directory of the application executable:
C++ Demo SpecificsWhen a C++ demo application is created, the following files should be added to the project:
The source code is also available for the provided demo executables; if converting from the current Visual Studio 2005 project, to newer versions, sometimes incorrect conversions can break intended GUI dimensions. C# Demo SpecificsWhen the C# demo application is created, the following files should be added to the project (taken from any C# demo directory):
The source code is also available for the provided demo executables; if converting from the current Visual Studio 2005 project, to newer versions, sometimes incorrect conversions can break intended GUI dimensions. Python Basic demo code sequenceData and Control FlowThe Multi API-DLL (FlashProARMFlashProM-FPAsel.dll, and GangProARMGangProM-FPAsel.dll) forwards calls coming from application software to individual API-DLL instances (FlashProARMFlashProM-FPA1.dll to FlashProARMFlashProM-FPA64.dll, and GangProARMGangProM-FPA1.dll to GangProARMGangProM-FPA64.dll respectively). A representation of the control and data flow is shown in Figure 1.8 and Figure 1.9. The desired destination FPA can be selected using the function F_Set_FPA_index( fpa ) where indices 1 to 64 select only one desired FPA. Select index 0 when ALL FPAs should be selected. The selected FPA index modified by the F_Set_FPA_index( fpa ) function 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 modified. When FPA index 1 to 64 is used, then the result of any forwarded function call will be directly returned to application software from the single API-DLL instance being invoked transparently. When FPA index 0 is used (ALL-FPAs) and results are the same from all FPAs, then the same result is passed back to application software. If results are not the same, then the Multi API-DLL will return value FPA UNMATCHED RESULTS (-1 or 0xFFFFFFFF). To obtain individual results per API-DLL instance use the function F_LastStatus( FPA ). This function will read back the results of the previously called API-DLL function, which was stored internally in the Multi API-DLL's result buffer. This temporary result buffer will be overwritten on the next call to each API-DLL instance. |
...