RK Platform Upgrage Firmware USB CAN

From ESS-WIKI
Revision as of 09:19, 8 April 2025 by Yunjin.jiang (talk | contribs)
Jump to: navigation, search

Prepare

For Upgrade firmware, A tool named usb-flash and a new firmware are needed.

New Firmware

Ask PM for help to get the latest firmware like SLCAN-FD0V0102.bin.

Tools

usb-flash is integrated by default in version 20250408 or later.

Check usb-flash :

# usb-flash -v
Advantech HID IAP Console v0.1

For early versions, download the tool from here : usb-flash

And unzip usb-flash to /usr/local/bin/ on DUT.

Firmware in DUT

Check firmware version in DUT, taking can0 for example:

# Command
# /tools/test/adv/can/can_get_firmware_version.sh can0
[   OK   ]: can0 Firmware Version : 0102

CAUTION

Firmware upgrades are only supported in V0102 or later versions

Enter Upgrade Mode

Stop slcan driver

# pkill slcanfd

Get Can port

Get can port ttyACMx (x=0、1、2...)

# dmesg | grep slcan
[    6.880193] can0: slcan on ttyACM0.
[    6.890344] can1: slcan on ttyACM1.

Swith MCU to IAP mode

# usb-flash -s /dev/ttyACM0
# usb-flash -s /dev/ttyACM1
# usb-flash -s /dev/ttyACM2
... ...

Reboot DUT

Reboot DUT for upgrading.

# reboot

Upgrade Firmware

Check IAP Mode

Check whether MCU is in IAP mode.If there are nodes hirawx (x=0、1、2...), MCU is in IAP mode.

# ls /dev/hidraw* -al
crw------- 1 root root 235, 0 Apr  8 05:56 /dev/hidraw0
crw------- 1 root root 235, 1 Apr  8 05:56 /dev/hidraw1

Upgrade Firmware

Taking SLCAN-FD0V0102.bin as an example of the name of the latest version firmware.

# usb-flash -f SLCAN-FD0V0102.bin

Enter Y for echo can to upgrade

Do you want to update firmware on this device? (Y/N)Y
[==================================================] 100 %

/dev/hidraw1 update successful
Do you want to update firmware on this device? (Y/N)Y
[==================================================] 100 %

Caution

DO NOT cancel the process of upgrade while upgrade is going.

DO NOT power off DUT while upgrade is going.

Check Firmware