Skip to main content

← Back to AFE-E630

AFE-E630 Linux update CAN FW

Contents​

  • 1Prepare 1.1New Firmware 1.2Tool 1.3Firmware in DUT
  • 2Enter Upgrade Mode 2.1Stop slcan driver 2.2Get Can port 2.3Swith MCU to IAP mode 2.4Reboot DUT
  • 3Upgrade Firmware 3.1Check IAP Mode 3.2Upgrade Firmware 3.3Reboot DUT
  • 4Check Firmware

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 .

Tool​

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.

# tar -zxvf usb-flash.tar.gz -C /usr/local/bin/
# chmod +x /usr/local/bin/usb-flash

Firmware in DUT​

Check firmware version in DUT, taking can0 for example:

# /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 MCU to enter IAP mode.

# 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 file name of the latest firmware.

Suppose SLCAN-FD0V0102.bin is located in the root folder of the USB flash disk.

Adjust SLCAN-FD0V0102.bin and /run/media/sda1/SLCAN-FD0V0102.bin according to your actual situation.

# cp /run/media/sda1/SLCAN-FD0V0102.bin ./
# usb-flash -f SLCAN-FD0V0102.bin

Enter Y for each can to start upgrade process.

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 %

/dev/hidraw0 update successful

Caution

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

DO NOT power off DUT while upgrade is going.

Reboot DUT​

Reboot DUT for MCU to enter normal mode.

# reboot

Check Firmware

Check if the firmware has been updated successfully, taking can0 for example:

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