leaps_fw_update_start

Starts firmware update process. Should be called at the beginning before leaps_fw_update_xfer and it can take up to several seconds. If accepted, the request returns command status: “ok” followed by the first data request. The data request should be handled by leaps_fw_update_xfer. The target for the FW update can be either ELDR (extended loader) which has FW ID equal to 1 or the main FW which has FW ID equal to 2. The ELDR is not supported on all HW platforms, see leaps_dev_info_get. command on how to read the device information. Rebooting into the bootloader or into the ELDR is required during the FW update process since the firmware cannot update itself.

The update is not started if refused. The reasons for refused firmware update are:

  • Not permitted - The FW ID given as the FW update target requires either enter the bootloader mode (the bootloader mode is entered always for a short time after reset, the time for which the module stays in the bootloader mode can be configured by leaps_boot_cfg_set).

  • Again - reset is required to switch to ELDR/FW and the update start request needs to be sent again after device reset. The device can be reset by leaps_reset.

  • Internal error

  • Invalid argument - Invalid hardware version or invalid FW ID.

Ongoing firmware update is restarted by this command.


Input
  • hw_version: ? 32-bit integer ? (Hardware version)

  • fw_id: ‘1’ | ‘2’ (1 for ELDR - Extended Loader or 2 for main firmware)

  • fw_checksum: ? 32-bit integer ? (crc32 of the firmware to be uploaded)

  • fw_size: ? 32-bit integer ? (size of the firmware)

Output
  • Status Code

  • offset: ? 32-bit integer ? (Offset of data that need to be written next by leaps_fw_update_xfer)

  • size: ? 32-bit integer ? (Size of data that need to be written by leaps_fw_update_xfer)


Example

TLV request

Type

Length

Value

Hardware version

Firmware ID

reserved

firmware checksum

size

0x3E

0x10

0x2A 0x00 0xCA 0xDE

0x02

0x00 0x00 0x00

0xea 0xF5 0x67 0x6D

0xC4 0x26 0x00 0x00

Type 0x3E (62 dec) means command leaps_fw_update_start

TLV response

Type

Length

Value

Type

Length

Value

Offset

Size

0x40

0x01

0x00

0x7e

0x08

0x00 0x00 0x00 0x00

0x00 0x10 0x00 0x00

Type 0x40 means status code

Type 0x7E (126) means firmware data request