C/C++ Basic Demo Code Sequence

Any application using the library will call most of the following functions. First, any one adapter is found, and initialized. Assuming at least one adapter was found (F_OpenInstancesAndFPAs returns > 0), the config and code files are loaded to select the MCU and data to be programmed. Finally, the procedure F_AutoProgram will run the full programming sequence of Erase, Blank Check, Write, Verify, and optionally Lock the MCU.

//Open adapters - this binds adapter(s) to this application. Any adapters not opened here could potentially be opened by another application in parallel. F_OpenInstancesAndFPAs("*# *");//find any adapter, opens only one //F_OpenInstancesAndFPAs("*# FPA-1 20171645 FPA-2 20210120 ");//open two adapters over USB //F_OpenInstancesAndFPAs("*# FPAETH-IP-1 192.168.0.101 FPAETH-IP-2 192.168.0.102);//open two adapters over LAN (XStreamPro-Iso only) //F_OpenInstancesAndFPAs( <path to FPAs-setup.ini file> );//read configuration from file //Select adapter index for accepting commands F_Set_FPA_index (0); //select all opened adapters for sending commands //F_Set_FPA_index (1); //select only adapter 1 for sending commands //F_Set_FPA_index (2); //select only adapter 2 for sending commands F_Initialization(); //initialize selected adapter(s) F_ConfigFileLoad( <path to config file> ); //config file can be easily created in the GUI, or parameters can be set using F_Set_Config_Value_By_Name //If the configuration file above already has a valid code path, the following function(s) is(are) not necessary F_ReadCodeFile( <path to code file> ); //flush code buffer, read first code file. Can be used for *.hex, *.txt, *.srec, *.sxx etc. //F_ReadCodeFile_BaseAddr( <path to code file>, UINT32 baseAddr ) //same as above but designed for *.bin files. Function will add baseAddr to code address. Can also be used to shift regular code files. //F_AppendCodeFile( <path to code file> ); //append code file, does not flush code buffer. //F_AppendCodeFile_BaseAddr( <path to code file>, UINT32 baseAddr ) //same as F_ReadCodeFile_BaseAddr but used for appending //Factory erase target (optional) //F_Clear_Locked_Device(); //Erase, Blank Check, Write and Verify code programmed to target(s) F_AutoProgram(); //Print output cout << F_Report_Message() << endl;

Running the aforementioned code snippet within the FP-M-Demo-C#.exe produces the following result:

Running the aforementioned code snippet within the GP-M-PB-Demo-C++.exe produces the following result:

 

Â