Swiflash failure in custom board

Hi Jyijyi,
I am trying to flash our custom WP7608 board by swiflash command from host. The board has Release 16 binaries. I am getting following errors:

raghavan@raghavan-HP-350-G2:~/wp7608$ sudo swiflash -m “WP76XX” -i custom-firmware.spk
Detecting USB of the target
DONE
Communicating with the target
DONE
Switching to firmware download mode
…ERROR: Failed to enter download mode
raghavan@raghavan-HP-350-G2:~/wp7608$

Could you please tell me the reason for failure?. 

Logs from board:
swi-mdm9x28-wp login: root
Password:
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# [ 50.181132] gbam_connect_work: gbam_connect_work: Bam channel is not ready
[ 65.811296] diag: download mode set, Rebooting SoC…
[ 65.819538] reboot: Restarting system

Format: Log Type - Time(microsec) - Message - Optional Info
Log Type: B - Since Boot(Power On Reset), D - Delta, S - Statistic
S - QC_IMAGE_VERSION_STRING=BOOT.BF.3.1.2-00089
S - IMAGE_VARIANT_STRING=LAATANAZA
S - OEM_IMAGE_VERSION_STRING=jenkins
S - Boot Config, 0x000002e1
B - 1216 - PBL, Start
B - 3720 - bootable_media_detect_entry, Start
B - 4400 - bootable_media_detect_success, Start
B - 4405 - elf_loader_entry, Start
B - 7859 - auth_hash_seg_entry, Start
B - 31513 - auth_hash_seg_exit, Start
B - 82902 - elf_segs_hash_verify_entry, Start
B - 129966 - PBL, End
B - 138104 - SBL1, Start
B - 195779 - pm_device_init, Start
B - 215879 - PM_SET_VAL:Skip
D - 18391 - pm_device_init, Delta
B - 217221 - boot_config_data_table_init, Start
D - 0 - boot_config_data_table_init, Delta - (0 Bytes)
B - 225944 - CDT version:3,Platform ID:8,Major ID:1,Minor ID:0,Subtype:129
B - 232837 - sbl1_ddr_set_params, Start
B - 236680 - Pre_DDR_clock_init, Start
D - 213 - Pre_DDR_clock_init, Delta
D - 0 - sbl1_ddr_set_params, Delta
B - 249368 - pm_driver_init, Start
D - 4483 - pm_driver_init, Delta
B - 255651 - cpr_init, Start
D - 122 - cpr_init, Delta
B - 260317 - cpr_cx_mx_apc_vol_update, Start
D - 91 - cpr_cx_mx_apc_vol_update, Delta
B - 275506 - clock_init, Start
D - 152 - clock_init, Delta
B - 275720 - boot_flash_init, Start
D - 40260 - boot_flash_init, Delta
B - 777048 - boot_flash_swi_ddr_init, Start
D - 28639 - boot_flash_swi_ddr_init, Delta
B - 919971 - hw_family:5, hw_type:23, hw_rev:40
B - 921130 - SSMEM init OK
B - 939095 - USB non-zero endpoint requirements: 9 in, 5 out
B - 940864 - opening partition 0:SWIFOTA
B - 942877 - error for readpage:0
B - 959011 - Failed to read size: /swinv/item_files/CUST_IM_SWITCH_HIDE
B - 964837 - Failed to read size: /swinv/item_files/FOTA_PARTITION
B - 965965 - Failed to read size: /swinv/item_files/CUST_IM_CONFIG
B - 986675 - ssmem_release: region 20 not exists
B - 986736 - ssmem_get: region 20 not exists
B - 992592 - smart recovery counter cleared

Thanks,
Raghavan.

how about typing “AT!boothold” before running the swiflash command?
it should be forced to go into download mode.

Hi Jyijyi,
I am running below command in WP7608 Linux command line. But i am getting some error:
root@swi-mdm9x28-wp:~# microcom -E /dev/ttyAT
microcom: invalid number ‘/dev/ttyAT’
root@swi-mdm9x28-wp:~#

Thanks,
Raghavan.

How about “microcom /dev/ttyAT”

Hi Jyijyi,
The “microcom /dev/ttyAT” command works and “AT!BOOTHOLD” reboots the unit. But swiflash fails to detect the USB port.

raghavan@raghavan-HP-350-G2:~/WP7608 $ swiflash -f -m “WP76XX” -i custom-firmware.spk
Detecting USB of the target
No device connected

Thanks,
Raghavan.

Are you able to find /dev/ttyUSBx on your linux PC after at!boothold ?

Another method is to transfer your spk file to /tmp folder of module by scp command ,and then use “fwupdate download xxx.spk” on module console to update firmware.

Hi Jyijyi,
Unfortunately, i programmed a custom binary without legato.cwe. So fwupdate command is not available. How can i recover the board?

No I cannot find any /dev/ttyUSBx on Linux PC after issuing swiflash command or “at!boothold” command. These 2 commands reboot the board. So /dev/ttyUSBx disappears.

Before “at!boothold” in custom board, i can see below line in lsusb in host computer:
Bus 001 Device 033: ID 1199:68c0 Sierra Wireless, Inc.

After “at!boothold” command in custom board “Sierra Wireless” is not appearing in lsusb output in Host computer.

Board logs:

root@swi-mdm9x28-wp:~# microcom /dev/ttyAT
at!boothold
OK
rcK: Executing run_K_scripts…
Stopping linkmon: no linkmon found; none killed
done
[ 60.914609] [RMNET:HI] rmnet_config_notify_cb(): Kernel is trying to unregister ecm0
[ 60.960294] [RMNET:HI] rmnet_config_notify_cb(): Kernel is trying to unregister ecm0
Stopping port_bridge: no port_bridge found; none killed
Stopping qmi_ip: no qmi_ip_multiclient found; none killed
Stopping eMBMs_TunnelingModule: no eMBMs_TunnelingModule found; none killed
Stopping netmgrd: stopped netmgrd (pid 1422)
done
Stopping qmuxd: stopped qmuxd (pid 1331)
done
no QCMAP_ConnectionManager found; none killed
Stopping fs-scrub-daemon: no fs-scrub-daemon found; none killed
Stopping thermal-engine: stopped thermal-engine (pid 1371)
done
stopped qti (pid 1798)
Stopping reboot daemon: stopped reboot-daemon (pid 1177)
done
Legato shutdown sequence
umount: can’t unmount /etc/ld.so.conf: Invalid argument
umount: can’t unmount /etc/ld.so.cache: Invalid argument
umount: can’t unmount /etc/hosts: Invalid argument
Finished Legato stop Sequence
stopping time daemon
Stopping time_services: stopped time_daemon (pid 1062)
done
stopping ntpd
no ntpd found; none killed
Stopping diagrebootapp: stopped diagrebootapp (pid 1038)
done
stopping DNS forwarder and DHCP server: dnsmasq… stopped /usr/bin/dnsmasq (pid 1116)
done.
Deconfiguring network interfaces… ifdown: interface eth0 not configured
done.
Stopping syslogd/klogd: stopped syslogd (pid 975)
stopped klogd (pid 980)
done
Stopping Dropbear SSH server: stopped /usr/sbin/dropbear (pid 1746)
dropbear.
K96mount_unionfs: RO rootfs fudge allowed.
Stopping system message bus: dbus.
K98mount_early: Executing mount_early_user_stop…
K98mount_early: RO rootfs fudge allowed.
K98mount_early: ubidetach failed for device /dev/mtd16, rcK should take care of it.
K98mount_early: Executing mount_early_legato_stop…
K98mount_early: Executing mount_early_userrw_stop…
K98mount_early: Executing mount_early_unset_timezone…
rcK: Executing kill_all_proc…
rcK: Executing umount_fs_generic…
rcK: Executing print_shutdown_msg…
** SYSTEM SHUTDOWN COMPLETE **
The system is going down NOW!
Sent SIGTERM to all processes
sh: getcwd: No such file or directory
root@swi-mdm9x28-wp:(unknown)# [ 63.017475] [RMNET:HI] rmnet_config_notify_cb(): Kernel is trying to unregister bridge0
[ 63.040661] [RMNET:HI] rmnet_config_notify_cb(): Kernel is trying to unregister bridge0
Sent SIGKILL to all processes
Requesting system reboot
[ 64.970797] reboot: Restarting system

Format: Log Type - Time(microsec) - Message - Optional Info
Log Type: B - Since Boot(Power On Reset), D - Delta, S - Statistic
S - QC_IMAGE_VERSION_STRING=BOOT.BF.3.1.2-00089
S - IMAGE_VARIANT_STRING=LAATANAZA
S - OEM_IMAGE_VERSION_STRING=jenkins
S - Boot Config, 0x000002e1
B - 1216 - PBL, Start
B - 3720 - bootable_media_detect_entry, Start
B - 4400 - bootable_media_detect_success, Start
B - 4405 - elf_loader_entry, Start
B - 7860 - auth_hash_seg_entry, Start
B - 31513 - auth_hash_seg_exit, Start
B - 82901 - elf_segs_hash_verify_entry, Start
B - 129965 - PBL, End
B - 138378 - SBL1, Start
B - 196145 - pm_device_init, Start
B - 216275 - PM_SET_VAL:Skip
D - 18391 - pm_device_init, Delta
B - 217617 - boot_config_data_table_init, Start
D - 0 - boot_config_data_table_init, Delta - (0 Bytes)
B - 226340 - CDT version:3,Platform ID:8,Major ID:1,Minor ID:0,Subtype:129
B - 233233 - sbl1_ddr_set_params, Start
B - 237076 - Pre_DDR_clock_init, Start
D - 213 - Pre_DDR_clock_init, Delta
D - 0 - sbl1_ddr_set_params, Delta
B - 249764 - pm_driver_init, Start
D - 4514 - pm_driver_init, Delta
B - 256047 - cpr_init, Start
D - 122 - cpr_init, Delta
B - 260714 - cpr_cx_mx_apc_vol_update, Start
D - 61 - cpr_cx_mx_apc_vol_update, Delta
B - 275872 - clock_init, Start
D - 152 - clock_init, Delta
B - 276116 - boot_flash_init, Start
D - 40046 - boot_flash_init, Delta
B - 777201 - boot_flash_swi_ddr_init, Start
D - 28639 - boot_flash_swi_ddr_init, Delta
B - 966118 - hw_family:5, hw_type:23, hw_rev:40
B - 967246 - SSMEM init OK
B - 985363 - USB non-zero endpoint requirements: 9 in, 5 out
B - 987132 - opening partition 0:SWIFOTA
B - 989176 - error for readpage:0
B - 1005341 - Failed to read size: /swinv/item_files/CUST_IM_SWITCH_HIDE
B - 1011197 - Failed to read size: /swinv/item_files/FOTA_PARTITION
B - 1012325 - Failed to read size: /swinv/item_files/CUST_IM_CONFIG
B - 1033126 - ssmem_release: region 20 not exists
B - 1033187 - ssmem_get: region 20 not exists
B - 1039074 - smart recovery counter cleared

Thanks,
Raghavan.

Did you install the GobiSerial driver in linux ?
https://source.sierrawireless.com/resources/airprime/software/usb-drivers-linux-qmi-software-s2,-d-,42n2,-d-,64/#sthash.EVthsMay.dpbs

You can also plug the USB cable to Windows and use the exe to do official FW upgrade

Hi Jyijyi,

Could you please provide link for fwupdate from windows?.

I have compiled GobiSerial driver. Should I install by insmod command?. Even before this GobiSerial driver compilation, i could ping the 192.168.2.2 IP address. My linux PC got 192.168.2.3 ip address automatically after plugging USB cable.

 What is next step after GobiSerial compilation?.

Thanks,
Raghavan.

You need to type “sudo make install” to install the driver

Windows platform is using exe file, not fwupdate

https://source.sierrawireless.com/resources/airprime/software/wp76xx/wp76xx-firmware-release-16/

Hi Jyijyi,
I have done following steps:

  1. Connect the board USB in Windows PC. And it is detected as Sierra Wireless
  2. Run WP76xx_Release16_SIERRA exe file
  3. Board is rebooting and stopped at same log messages in previous comments
  4. Board is not detected at this time. So exe file gives error.

Before running exe file, the Windows Device Manager output shows “Sierra Wireless USB Composite Device”

I am getting following output in Windows when I run WP76xx_Release16_SIERRA exe file.

Board Logs:

Windows Device Manager at this stage:

Thanks,
Raghavan.

Another way to update module FW is as follows:

  1. download a WP76 FW EXE
  2. use 7zip to extract it
  3. there should be a fdt2.exe inside
  4. there should be xxx.spk file inside
  5. use command prompt to update by “fdt2.exe xxx.spk”

Hi Jyijyi,

I ran below command:
fdt2.exe WP76xx_Release16_SIERRA.spk

It failed. I got same logs as previous comment in this thread.

Thanks,
Raghavan.

What port do you have in device manager?

Hi Jyijyi,

  1. Board is booted upto Linux
  2. Connect USB cable between board and Windows PC.
  3. Device Manager shows “Sierra Wireless USB Composite Device”
  4. In “Terra Term” window, I can see some ports. Only COM3 was there before inserting the USB cable. Our board has separate RS232 port. But that is not connected during this test.

Thanks,
Raghavan.

Can you use winscp to transfer the spk file to module /tmp folder?

Hi Jyijyi,
Yes, I can do. But fwupdate and related libraries are not available in the board. So fwupdate command will not work.

Thanks,
Raghavan.

You can use fwupdate on linux pc

https://docs.legato.io/latest/toolsHost_fwupdate.html

Hi Jyijyi,
I cannot find out any fwupdate command in ubuntu 14.04. That command is not appearing in Linux PC even after “sudo apt-get install fwupdate”.

Thanks,
Raghavan.

I did it in “leaf shell”


owner@owner-ThinkPad-X220:~/LEAF/wp77$ leaf shell
bash: export: `--': not a valid identifier
Leaf Shell /bin/bash started in Leaf environment.

(lsh:wp77) owner@owner-ThinkPad-X220:~/LEAF/wp77$ fwupdate -h


NAME
    fwupdate - download or query modem firmware

SYNOPSIS
    fwupdate help
    fwupdate downloadOnly FILE [TARGET_IP]
    fwupdate query [TARGET_IP]
    fwupdate install [TARGET_IP]
    fwupdate checkStatus [TARGET_IP]
    fwupdate markGood [TARGET_IP]
    fwupdate download FILE [TARGET_IP]

DESCRIPTION

    fwupdate help
      - Print this help message and exit
    
    fwupdate query [TARGET_IP]
      - Query the current firmware version. This includes the modem firmware version, the
        bootloader version, and the linux kernel version.
        This can be used after a download and modem reset, to confirm the firmware version.
    
    fwupdate downloadOnly FILE [TARGET_IP]
      - Download the given CWE file.
        Waits for another command after a successful download.
    
    fwupdate checkStatus [TARGET_IP]
      - Check the status of the downloaded package (DualSys platform only).
    
    fwupdate install [TARGET_IP]
      - Install the downloaded firmware.
        Single System: Trigger reset to initiate install.
        Dual System: Swap and reset to run the downloaded firmware or go back to the old system
        if the running system is not marked good.
    
    fwupdate markGood [TARGET_IP]
      - Mark good the current system (DualSys platform only).
    
    fwupdate download FILE [TARGET_IP]
      - do download, install and markGood in one time.
        After a successful download, the modem will reset.


ENVIRONMENT

    If the TARGET_IP value is not given and the environment variable DEST_IP
    is set then DEST_IP will be used as TARGET_IP


(lsh:wp77) owner@owner-ThinkPad-X220:~/LEAF/wp77$

BTW, it seems your module really has problem as it cannot FW upgrade through Linux PC and Windows PC…