Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Page Tree
root@self
startDepth1

3.1. Multi API-DLL Functions

These functions operate on meta-data within the Multi API-DLL and help manage the underlying API-DLL instances. These functions do not directly program target devices. Use these functions to initialize the desired number of FPAs, selected all or one FPA(s), read FPA serial numbers, or clean-up resources used by Elprotronic’s DLLs.

Once the desired FPAs have been successfully opened, use Generic Functions to initialize the FPAs, and configure them for the target device(s) being programmed.

3.2. Generic Functions

Having correctly configured the top-level Multi API-DLL using Multi API-DLL Functions, the functions in this section can be used to initialize and configure each FPA individually (and it’s API-DLL instance).

...

After the following functions have been used to configure each FPA correctly for its target device, use Data Buffer Functions to determine what code should be written during programming. Finally, Encapsulated functions can perform the process of programming, writing, erasing, verifying, etc., according to the aforementioned settings.

3.3. Data Buffer Functions

Having setup the Multi API-DLL and API-DLL instances for the correct target devices using functions from previous sections. Use the functions in this section to specify what code should be written by each FPA to their target device.

All data coming to and from the target device is saved in temporary buffers located inside each API-DLL instance. In summary, these buffers are the Code Data Buffer, Write Data Buffer, and Read Data Buffer shown below:

Image AddedImage Added

During normal programming using Encapsulated Functions, such as F_AutoProgram, the Code Data Buffer is used to program the target device. For custom modifications the Write Data Buffer can be used to write to the target device without disturbing the Code Data Buffer using Sequential Functions, such as F_Copy_Buffer_to_Flash.

The Read Data Buffer is used for reading from the target device by the F_Copy_Flash_to_Buffer and F_Memory_Read functions, the contents of which can be accessed using F_Get_Byte_from_Buffer.

3.4. Encapsulated Functions

Encapsulated functions are powerful and easy to use. When called, these functions perform all device actions from beginning to end automatically.

These functions require that all FPAs are opened using the Multi API-DLL function F_OpenInstancesAndFPAs and each API-DLL instance is correctly initialized using Generic Functions. If not already included in configuration settings, the code being programmed by each FPA to its target device can be set using Data Buffer Functions.

Encapsulated functions use the following sequence:

  • FPA opens target device according to configuration settings (power source, reset, etc.),

  • FPA establishes communication with target device (JTAG/SWD), checks ID, calibrates clock,

  • FPA performs selected encapsulated function,

  • FPA terminates communication with target device,

FPA closes target device according to configuration settings (power setting, app. start for F_AutoProgram only, adapter line states, etc.)

3.5. Sequential Functions

Sequential functions allow access to the target device in any combination of small instructions like erase, read, write sector, modify part of memory, etc. Sequential functions work correctly after communication between target device and programming adapter has been initialized. This requires the target FPA to be opened using F_OpenInstancesAndFPAs and F Initialization, and for proper configuration options to be set using F_ConfigFileLoad or F_Set_Config_Value_by_Name.

Once the FPA has been initialized using the aforementioned functions, open the target device using the function F_Open_Target_Device. When communication is established, then any of the sequential instructions can be called. When finished, conclude your task by calling F_Close_Target_Device.

NOTE: F_Open_Target_Device is a high overhead function (usually around one second of execution time). Therefore call F_Open_Target_Device only once and perform all sequential functions before closing the target with F_Close_Target_Device. Sample code sequnce:

Code Block
languagecpp
F_OpenInstancesAndFPAs("*# *");//only first FPA
F_Set_FPA_index(1);   //select FPA 1
F_Initialization();   //initialize selected FPA(s)
F_ConfigFileLoad(<config file path>); //load config file to selected FPA(s)
F_Open_Target_Device();  //power on, initialize JTAG/SWD communication, calib clk
... < all sequential functions here > ... 
F_Close_Target_Device(); //power off