2. Configuration

2. Configuration

Configuration Overview

The FlashPro X DLL provides a flexible configuration interface that allows developers to customize programming operations for individual Flash Programming Adapters (FPAs) and their connected target microcontrollers.

Configuration settings determine how each adapter communicates with its target MCU and performs programming operations, including memory access, erase, program, verify, reset, and device security.

The API supports a wide range of microcontroller manufacturers, including Texas Instruments, STMicroelectronics, Silicon Labs, Silergy, Renesas, NXP / Freescale, Nordic Semiconductor, Maxim, Microchip / Atmel, GigaDevice, Infineon / Cypress, Analog Devices, and Active-Semi.

Most general configuration parameters are common across supported MCU families. However, certain settings, particularly Memory Protection, are specific to the selected MCU manufacturer, family, or device.

Memory Protection settings are described separately in the corresponding vendor-specific sections.

Important: If a configuration file contains Memory Protection settings that are not applicable to the currently selected MCU, those settings are ignored and the corresponding default values are used (typically no protection). Always verify the active protection configuration before programming production devices.

Configuration Parameters

Configuration settings can be managed directly through API functions or loaded from an existing configuration file.

The following functions provide access to configuration parameters:

Function

Description

Function

Description

F_ConfigFileLoad()

Loads programming configuration settings from a file.

F_Set_Config_Value_By_Name()

Modifies a configuration parameter using its name.

F_Get_Config_Value_By_Name()

Retrieves the current value or properties of a configuration parameter.

F_Get_Config_Name_List()

Enumerates available configuration parameter names.

F_Set_FPA_index()

Selects the programming adapter whose configuration will be accessed.

Configuration parameter names are case-sensitive string identifiers as defined by the API-DLL. These names can be used both in configuration files and when accessing parameters programmatically.

When multiple programming adapters are connected, select the appropriate FPA index before accessing or modifying its configuration.

Retrieving Configuration Parameters

The FlashPro X DLL allows applications to retrieve a complete list of supported configuration parameters for the selected API-DLL instance.

First, select the desired programming adapter using:

F_Set_FPA_index(fpa)

Then, enumerate configuration parameter names using:

F_Get_Config_Name_List(index)

For each returned parameter name, the function F_Get_Config_Value_By_Name() can be used to retrieve additional information.

The second argument specifies which property should be returned:

Selector

Constant

Description

Selector

Constant

Description

0

CONFSEL_VALIDATE

Checks whether the configuration parameter name is valid.

1

CONFSEL_VALUE

Returns the current parameter value.

2

CONFSEL_MIN

Returns the minimum allowed value.

3

CONFSEL_MAX

Returns the maximum allowed value.

4

CONFSEL_DEFAULT

Returns the default parameter value.

C++ Example: Enumerating Configuration Parameters

The following example retrieves all available configuration parameter names and displays their current values, valid ranges, and default values.

#include <cstring> #include <iomanip> #include <sstream> // Configuration parameter selectors #define CONFSEL_VALIDATE 0 #define CONFSEL_VALUE 1 #define CONFSEL_MIN 2 #define CONFSEL_MAX 3 #define CONFSEL_DEFAULT 4 std::stringstream msg; // Select the desired programming adapter F_Set_FPA_index(1); for (int i = 0; ; ++i) { char* name = F_Get_Config_Name_List(i); // End of configuration parameter list if (name == nullptr || name[0] == '\0') break; // Validate configuration parameter name if (!F_Get_Config_Value_By_Name(name, CONFSEL_VALIDATE)) { msg << "Invalid configuration parameter: " << name << "\r\n"; continue; } unsigned int value = F_Get_Config_Value_By_Name(name, CONFSEL_VALUE); unsigned int minValue = F_Get_Config_Value_By_Name(name, CONFSEL_MIN); unsigned int maxValue = F_Get_Config_Value_By_Name(name, CONFSEL_MAX); unsigned int defaultValue = F_Get_Config_Value_By_Name(name, CONFSEL_DEFAULT); // Display parameter information msg << name << " = 0x" << std::hex << value << " Range: [0x" << minValue << " - 0x" << maxValue << "] Default: 0x" << defaultValue << "\r\n"; // Validate current parameter value if (value < minValue || value > maxValue) { msg << "WARNING: Current value is outside " "the allowed range.\r\n"; } // Validate default parameter value if (defaultValue < minValue || defaultValue > maxValue) { msg << "WARNING: Default value is outside " "the allowed range.\r\n"; } } // msg.str() contains the complete configuration report

The generated report contains the available configuration parameters, including their current values, minimum and maximum limits, and default settings.

This functionality is particularly useful for developing custom configuration interfaces, validating programming settings, and diagnosing configuration issues.

Note: The available configuration parameters and their values may vary depending on the selected MCU and API-DLL version. Applications should retrieve parameter names dynamically rather than assuming that every parameter is supported by all devices.t: