KCAN Firmware Tools
kcan_fw_tool reads hardware and firmware information, controls built-in termination on supported devices, switches firmware and changes device mode. kcan_fw_upgrade performs firmware upgrades.
Important
- Devices with firmware earlier than 8.x.x do not support Linux firmware upgrade or firmware switching. Use the Windows firmware tool instead.
- If a device enters boot mode unexpectedly, disconnect and reconnect it.
Tools
kcan_fw_tool: firmware information, termination, firmware switching and device-mode operationskcan_fw_upgrade: automatic or manual firmware upgrade
Interactive Menu
sudo kcan_fw_tool can0 menu╔════════════════════════════════════════════╗
║ KCAN Factory Mode Tool - Main Menu ║
╠════════════════════════════════════════════╣
║ 1. Get Firmware Version ║
║ 2. Get Termination Status ║
║ 3. Set Termination ON (120Ω) ║
║ 4. Set Termination OFF ║
║ 5. Switch firmware (specify address) ║
║ 6. Switch to next firmware ║
║ 7. Set Device Mode (by channels) ║
║ 0. Exit ║
╚════════════════════════════════════════════╝Read Firmware Version
sudo kcan_fw_tool can0 versionExample:
[INFO] Getting firmware version...
=== Firmware Version ===
Version: 8.5.2
Build Date: 2026-03-26
=== BL Version ===
[INFO] Getting bootloader version...
Version: 0.0.2.1
========================Firmware Upgrade
Automatic
sudo kcan_fw_upgrade can0 autoSelect Installed Firmware
# List firmware under /usr/lib/firmware
sudo kcan_fw_upgrade lsfw
# Upgrade by listed firmware name
sudo kcan_fw_upgrade can0 KH-UCANFD-xxx.encUpgrade from a Path
sudo kcan_fw_upgrade can0 /usr/lib/firmware/KH-UCANFD-xxx.encThe upgrade process sends the device to bootloader mode, waits for the USB mass-storage interface, copies the firmware, unmounts it, waits for the device to restart, and verifies the new version.
Keep USB power stable throughout the operation. Do not unplug the adapter until the tool reports successful completion.
Built-In Termination
These commands require hardware that supports software-controlled termination.
# Read status
sudo kcan_fw_tool can0 term-get
# Enable 120 Ω termination
sudo kcan_fw_tool can0 term-on
# Disable termination
sudo kcan_fw_tool can0 term-offExample:
$ sudo kcan_fw_tool can0 term-get
[INFO] Getting termination status...
Termination resistor: OFF
$ sudo kcan_fw_tool can0 term-on
[INFO] Setting termination resistor: ON
Termination resistor set to: ON (120Ω)Switch Firmware
The switch-app and next-app command names are retained for command-line compatibility; they switch CANmeleon firmware.
# Switch to the firmware at address 0x40000
sudo kcan_fw_tool can0 switch-app -a 0x40000
# Switch to the next firmware
sudo kcan_fw_tool can0 next-appWait for USB re-enumeration before opening the target CAN software.
Change Device Mode
# One channel: FD
sudo kcan_fw_tool can0 device-mode -c 1
# Two channels: FDPRO
sudo kcan_fw_tool can0 device-mode -c 2
# Four channels: KCAN_X4
sudo kcan_fw_tool can0 device-mode -c 4Help
sudo kcan_fw_tool -h