Bootloader Interface

Bootloader interface is supported by every DLN-series adapter. It is used to update firmware in order to apply new features, updates and fixes.

Since DLN-series adapters are operated via the Application Programming Interface (API), a user can also update firmware for remote devices.

Firmware for DLN-series adapters is supplied encoded. Each DLN-series adapter is only compatible with specifically designed firmware. Do not try to install an incompatible firmware.
Rating: 
Голосов пока нет

Bootloader Device Modes

There are three bootloader modes of a DLN-series adapter:

ModeDescription

Bootloader

This mode is activated in order to use bootloader functions. Only generic and bootloader functions are available in this mode. The Bootloader mode can be accesses either by sending the DLN_BOOT_ENTER_BOOTLOADER command or by setting the respective jumper on the DLN-series adapter board. The jumper must be set before the device is powered up. In case the device is not fitted with external power source, the jumper must be set before connecting the device to a USB port.

Application

When in this mode, the DLN-series adapter functions normally. However, some bootloader functions (DlnBootReadFlash() and DlnBootWriteFlash()) become unavailable.

Update in progress

This mode is activated automatically once the device receives the DLN_BOOT_WRITE_FLASH command. In case of a power failure, the DLN-series adapter will be rebooted and remain in this mode.

Rating: 
Средняя: 5 (1 оценка)

Bootloader Functions

This section describes the Bootloader functions. They are used to control and monitor the Bootloader module of a DLN-series adapter.Actual control of the device is performed by use of commands and responses. Each function utilizes respective commands and responses. You can send such commands directly if necessary.

Rating: 
Голосов пока нет

DlnBootEnterBootloader() Function

The DlnBootEnterBootloader() function enters the Bootloader mode.

This function is defined in the dln_boot.h file.

Syntax
C/C++
DLN_RESULT DlnBootEnterBootloader(
   HDLN handle
);
Parameters
handle

A handle to the DLN-series adapter.

Return Value
DLN_RES_SUCCESS

Function was successfully executed.

DlnBootExitBootloader() Function

The DlnExitBootloader() function exits the Bootloader mode and continues in the Application mode.

This function is defined in the dln_boot.h file.

Syntax
C/C++
DLN_RESULT DlnBootExitBootloader(
    HDLN handle
);
Parameters
handle

A handle to the DLN-series adapter.

Return Value
DLN_RES_SUCCESS

Function was successfully executed.

DlnBootGetMode() Function

The DlnBootGetMode() function retrieves current mode of your DLN-series adapter.

This function is defined in the dln_boot.h file.

Syntax
C/C++
DLN_RESULT DlnBootGetMode(
    HDLN handle, 
    DLN_BOOT_MODE* mode
 );
Parameters
handle

A handle to the DLN-series adapter.

mode

A pointer to the 32-bit DLN_BOOT_MODE variable. This variable will be used to store current device mode after the function execution.

Return Value
DLN_RES_SUCCESS

Function was successfully executed.

DlnBootGetMemDesc() Function

The DlnBootGetMemDesc() function retrieves information about the device internal flash memory.

This function is defined in the dln_adc.h file.

Syntax
C/C++
DLN_RESULT DlnBootGetMemDesc(
    HDLN handle, 
    uint32_t memory, 
    DLN_BOOT_MEM_DESC *descriptor
);
Parameters
handle

A handle to the DLN-series adapter.

memory

Memory type value. Available only DLN_BOOT_MEM_FLASH value.

descriptor

A pointer to the DLN_BOOT_MEM_DESC structure, which will be filled with data after the function execution.

Return Value
DLN_RES_SUCCESS

Function was successfully executed.

DlnBootGetMemCount() Function

The DlnBootGetMemCount() function retrieves the number of flash panes of your DLN-series adapter.

This function is defined in the dln_boot.h file.

Syntax
C/C++
DLN_RESULT DlnBootGetMemCount(
    HDLN handle, 
    uint32_t *count
);
Parameters
handle

A handle to the DLN device.

count

A pointer to 8-bit unsigned integer, which will be filled with the number of flash panes after the function execution.

Return Value
DLN_RES_SUCCESS

The number of flash panes was successfully retrieved.

DlnBootRead() Function

The DlnBootRead() function reads data on the DLN-series adapter current firmware.

This function is defined in the dln_boot.h file.

This function is only available, when the device operates in Bootloader mode.
Syntax
C/C++
DLN_RESULT DlnBootReadFlash(
    HDLN handle,
    uint32_t memory, 
    uint32_t address, 
    uint16_t size, 
    uint8_t* buffer
 );
Parameters
handle

A handle to the DLN-series adapter.

memory

Memory type value. Available only DLN_BOOT_MEM_FLASH value.

address

Address to start reading from.

size

Size of the data to read.

buffer

A pointer to an unsigned 8 bit integer. This integer will be filled with the firmware data after the function execution.

Return Value
DLN_RES_SUCCESS

The number of flash panes was successfully retrieved.

DlnBootWrite() Function

The DlnBootWrite() function writes new firmware into the device internal memory. This function is only available, when the device functions in the Bootloader mode. This function is defined in the dln_boot.h file.

Syntax
C/C++
DLN_RESULT DlnBootWrite(
    HDLN handle,
    uint32_t memory,
    uint32_t address,
    uint16_t size,
    uint8_t* buffer
 );
Parameters
handle

A handle to the DLN-series adapter.

memory

Memory type value. Available only DLN_BOOT_MEM_FLASH value.

address

The address to start writing from.

size

The size of the firmware.

buffer

Buffer with the firmware data.

Return Value
DLN_RES_SUCCESS

The number of flash panes was successfully retrieved.