KCAN Firmware Tools
kcan_fw_tool reads hardware and firmware information, controls built-in termination on supported devices, switches applications 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 application switching. Use the Windows firmware tool instead.
- If a device enters boot mode unexpectedly, disconnect and reconnect it.
Tools
kcan_fw_tool: firmware, termination, application and device-mode operationskcan_fw_upgrade: automatic or manual firmware upgrade
Interactive Menu
bash
sudo kcan_fw_tool can0 menutext
╔════════════════════════════════════════════╗
║ 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 to APP (specify address) ║
║ 6. Switch to Next APP ║
║ 7. Set Device Mode (by channels) ║
║ 0. Exit ║
╚════════════════════════════════════════════╝Read Firmware Version
bash
sudo kcan_fw_tool can0 versionExample:
text
[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
bash
sudo kcan_fw_upgrade can0 autoSelect Installed Firmware
bash
# 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
bash
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.
bash
# 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:
text
$ 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 Protocol Applications
bash
# Switch to the application at address 0x40000
sudo kcan_fw_tool can0 switch-app -a 0x40000
# Switch to the next application
sudo kcan_fw_tool can0 next-appWait for USB re-enumeration before opening the target CAN software.
Change Device Mode
bash
# 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
bash
sudo kcan_fw_tool -h