KiNOS Firmware Update

You are here:
Estimated reading time: 3 min

In order to provide the ability to incorporate new features, fixing possible bugs or change the firmware operation purpose (general firmware, sniffer firmware, and golden reference firmware), KiNOS allows different firmware flashing methods, with the following features:

  • To update the firmware modifying it with a small size binary patch that includes only the new features to add to the running version.
    Example: KiNOS-GEN-KTWM102-1.1.6539.61189-to-1.1.6539.62822.dfu
  • Possibility to upgrade the firmware overwriting the entire flash with a full binary firmware.
    Example: KiNOS-GEN-KTWM102-1.1.6539.62822.dfu
  • Different physical interfaces: USB and UART.
  • Authenticity and security of the binaries is assured by AES-128 with EAX mode encryption.
  • Fail safe recovery to older firmware in case of power shortage or update error.
  • Optimized patch compression to reduce update timing and power consumption.
  • Typical patch size is in the order of a few kilobytes, compared to the 200 kB of a complete firmware image.
  • The name of the file provides information about the firmware version of the file itself, if it is a complete firmware or a patch, the firmware version for which the patch is applicable and the hardware platform that it targets.


Firmware update through USB

To top
We provide an easy-to-use software tool to update all of your Kirale devices in parallel. Run KiTools from a Command Line or Powershell in Windows.

The protocol used to flash a binary file to Kirale KTDG102 USB Dongle through its USB interface is the standard DFU 1.1.

To perform a firmware update with the DFU method two prerequisites are required:

  • The dfu-util tool must be installed on your platform.
  • The drivers for the bootloader USB interface KiNOS Boot DFU must be installed on your platform.
Install dfu-util
  • On Windows : download dfu-util and extract the files in the desired folder.
  • On MAC OS : get Homebrew and then execute the following command
    $ brew install dfu-util
  • On Linux :
    $ sudo apt install dfu-util
Install KiNOS Boot DFU interface drivers

KTDG102 USB Dongle has different USB interfaces. When it is in bootloader mode, the KiNOS Boot DFU USB interface is activated and drivers must be installed to ensure proper functioning. To activate bootloader mode run dfu-util and type:

$ dfu-util ––detach

This interface is a libusbK USB interface like the KiNOS DFU one, therefore to install its drivers please follow the Install USB drivers guide and follow the same steps than for KiNOS DFU interface.

Flash a new firmware with DFU mode

Run “dfu-util” tool, and follow these steps:

First list the attached devices and find the one with the desired serial number.

$ dfu-util ––list
Found Runtime: [2def:0102] ver=0100, devnum=8, cfg=1, intf=0, path=”1-1.4.3″, alt=0, name=”KiNOS DFU”, serial=”8404D2000000045B”
Found Runtime: [2def:0102] ver=0100, devnum=9, cfg=1, intf=0, path=”1-1.4.4″, alt=0, name=”KiNOS DFU”, serial=”8404D2000000045C”

Download the firmware file to the desired device (specifying the serial number). The transfer time could take several seconds.

$ dfu-util –download KiNOS-GEN-KTWM102-1.1.6556.39545.dfu –serial 8404D2000000045B
Match vendor ID from file: 2def
Opening DFU capable USB device…
ID 2def:0102
Run-time device DFU version 0110
Claiming USB DFU Runtime Interface…
Determining device status: state = appIDLE, status = 0
Device really in Runtime Mode, send DFU detach request…
Device will detach and reattach…
Opening DFU USB Device…
Claiming USB DFU Interface…
Setting Alternate Setting #0 …
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 64
Copying data from PC to DFU device
Download [=========================] 100% 239632 bytes
Download done.
state(6) = dfuMANIFEST-SYNC, status(0) = No error condition is present
dfu-util: unable to read DFU status after completion

Once dfu-util has finished the transference of the firmware, the KTDG102 USB Dongle will reboot and start to apply the new firmware in the internal flash (led fast flashing). It could take several seconds as well. When the led begins to flash slowly (in stable way) the firmware flashing has finished and KiNOS firmware is operating!


Firmware Update through Serial

To top
Please refer to Send UART serial commands in order to understand the serial peripheral configuration, how to interface it to a host and serial commands frame format.

This firmware update feature has been designed specifically for automated host processors that control the Kirale KTWM102 module through serial interface, however it is perfectly suitable to computer running a simple script and connected to the KTDG102 USB Dongle through its serial connector.

The transfer protocol is very simple, it only involves the use of a special FW Update KBI command. The host needs to split the firmware file in blocks of 64 bytes, excluding the last 16 bytes (DFU suffix). The last block size could be smaller than 64 bytes.

Every block is sent in order as the payload of the FW Update command, using a simple stop-and-wait mechanism. If the block sent is valid, the KTDG102 USB Dongle replies with a success response code and returns the block number in the response payload. If one of the blocks is not successfully acknowledged after several retries (five could be a reasonable number), the host may start again with the first block. A block is considered as not successfully acknowledged when:

  • A FW Update Error code is received in the response.
  • A COBS error is received as response.
  • The timeout for the command has passed.

Once all the blocks are sent and correctly acknowledged, the host should send a reset command to force a reboot and the application of the new firmware.

The process of applying and rebooting could take several seconds. In order to know whether the device has finished the updating, check the LED state and wait until it begins to blink slowly (in stable way).