Issue with OpenWrt Sysupgrade on IPQ40xx device with QSDK stock firmware

Unable to do sysupgrade of OpenWrt 19.07.0 image on devices running QSDK stock firmware(Eg qualcomm Dakota platform(Model - ipq4019-ap-dk04.1-c1).

QSDK Software details :
uboot revision - (U-Boot 2016.01)
openwrt - OpenWrt Chaos Calmer 15.05.1

  1. Able to load and boot with initramfs of Openwrt by following below commands
    Entered in uboot mode.
    tftpboot 0x82000000 openwrt-19.07.0-ipq40xx-generic-qcom_ap-dk04.1-c1-initramfs-fit-uImage.itb
    set fdt_high 0x83000000
    bootm 0x82000000

Able to boot

| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -| || | | || || |
|
_____|| |
||||___||| |____|
|
| W I R E L E S S F R E E D O M

OpenWrt 19.07.0, r10860-a3ffeb413b

Not able to copy the openwrt-ipq40xx-generic-qcom_ap-dk04.1-c1-squashfs-nand-sysupgrade.bin file as USB and Ethernet interface are not up.

  1. Direct sysupgrade with QSDK stock firmware.
    When using squashfs bin through sysupgrade, it failed

root@OpenWrt:~# sysupgrade -v -n /tmp/openwrt-ipq40xx-generic-qcom_ap-dk04.1-c1-squashfs-nand-sysupgrade.bin
/tmp/openwrt-ipq40xx-generic-qcom_ap-dk04.1-c1-squashfs-nand-sysupgrade.bin is not a valid FIT image
Image check 'platform_check_image' failed.

Any suggestions will be helpful. Thanks in advance.

Please contact your distributor for support about the proprietary QSDK. While being loosely based on an ancient OpenWrt version, it has been substantually changed by the vendor and has little in common with OpenWrt.

1 Like

Thanks for the update. I agree with you. It is Qualcomm Dakota reference platform and no hardware changes are made. Seems like openwrt support ipq4019-ap-dk04.1-c1 models and would like to know if we can flash directly via JTAG or uboot. Will also try to get details from distributor.
Thank you.

Have you tried to produce QSDK-compatible image and flash it inside running QSDK?
I added support for that some time ago here: https://github.com/openwrt/openwrt/commit/bf4630e5adb40aa393f6bd4c560baf42de0f1957

1 Like

Hi,
Thanks for the suggestion. From Openwrt build, we could generate openwrt-ipq40xx-generic-qcom_ap-dk04.1-c1-squashfs-nand-factory.ubi image. Even this image gives the same error.

root@OpenWrt:~# sysupgrade -v -n /tmp/openwrt-ipq40xx-generic-qcom_ap-dk04.1-c1-squashfs-nand-factory.ubi
/tmp/openwrt-ipq40xx-generic-qcom_ap-dk04.1-c1-squashfs-nand-factory.ubi is not a valid FIT image
Image check 'platform_check_image' failed.

Thank you.

You probably did something wrong as the mentioned recipe produces FIT image.
Show me please how you made it.

Hi,

Here is the procedure followed
OpenWrt downloaded from: https://github.com/openwrt/openwrt/tree/openwrt-19.07

Openwrt Build Steps:

# ./scripts/feeds update -a* 
# ./scripts/feeds install -a* 
# make menuconfig*

Selected configuration:

     Target System (Qualcomm Atheros IPQ40XX)
     Subtarget (Generic)
     Target Profile (QCA AP-DK04.1-C1)

     *make V=s*

Binaries Generated:

   3317468 Jan 27 14:55 openwrt-ipq40xx-generic-qcom_ap-dk04.1-c1-fit-uImage.itb
   6420244 Jan 27 14:55 openwrt-ipq40xx-generic-qcom_ap-dk04.1-c1-initramfs-fit-uImage.itb
   6422528 Jan 27 14:51 openwrt-ipq40xx-generic-qcom_ap-dk04.1-c1-squashfs-nand-factory.ubi
   5786370 Jan 27 14:51 openwrt-ipq40xx-generic-qcom_ap-dk04.1-c1-squashfs-nand-sysupgrade.bin 

Generated binaries are copied to : openwrt-19.07/bin/targets/ipq40xx/generic/

The patch you have pointed out is already part of Openwrt. Not sure anything I have missed. Please let me know if any of the steps followed are incorrect.

========================================================
#Init ramfs procedure Update
Also we have enabled USB_STORAGE and able to copy the sysupgrade image after booting from initramfs. On flashing, we see below error

root@OpenWrt:/mnt/openwrt_build# sysupgrade /tmp/openwrt-ipq40xx-generic-qcom_ap-dk04.1-c1-squashfs-nand-sysupgrade.bin
Device qcom,ipq4019 not supported by this image
Supported devices: qcom,ap-dk04.1-c1
Image check failed.

Please let me know if anything I can try further

Thanks

If you have access to u-boot, I'd try to force the sysupgrade.

Hi,

Below are the things we tried from uboot
IPQ4019/AP-DK04.1-C1 smem Info:

IPQ40xx# smeminfo
flash_type:                 0x2
flash_index:               0x0
flash_chip_select:      0x0
flash_block_size:       0x20000
flash_density:             0x100000
partition table offset  0x0
No.: Name                     Attributes            Start               Size
  0: 0:SBL1                     0x0000ffff              0x0              0x100000
  1: 0:MIBIB                    0x0000ffff         0x100000         0x100000
  2: 0:BOOTCONFIG      0x0000ffff         0x200000         0x100000
  3: 0:QSEE                    0x0000ffff         0x300000         0x100000
  4: 0:QSEE_1                0x0000ffff         0x400000         0x100000
  5: 0:CDT                       0x0000ffff         0x500000         0x80000
  6: 0:CDT_1                   0x0000ffff         0x580000         0x80000
  7: 0:BOOTCONFIG1    0x0000ffff         0x600000         0x80000
  8: 0:APPSBLENV         0x0000ffff         0x680000         0x80000
  9: 0:APPSBL                 0x0000ffff         0x700000         0x200000
 10: 0:APPSBL_1            0x0000ffff         0x900000         0x200000
 11: 0:ART                       0x0000ffff         0xb00000         0x80000
 12: rootfs                        0x0000ffff         0xb80000         0x4100000
 13: rootfs_1                    0x0000ffff        0x4c80000         0x3300000
IPQ40xx#

Sysupgarde image flashing through U-boot-2016:


IPQ40xx# tftpboot 0x84000000 openwrt-ipq40xx-generic-qcom_ap-dk04.1-c1-squashfs-nand-sysupgrade.bin
eth0 PHY0 up Speed :100 Full duplex
eth0 PHY1 Down Speed :10 Half duplex
eth0 PHY2 Down Speed :10 Half duplex
eth0 PHY3 Down Speed :10 Half duplex
eth0 PHY4 Down Speed :10 Half duplex
eth0 PHY5 Down Speed :10 Half duplex
Using eth0 device
TFTP from server 192.168.1.63; our IP address is 192.168.1.187
Filename 'openwrt-ipq40xx-generic-qcom_ap-dk04.1-c1-squashfs-nand-sysupgrade.bin'.
Load address: 0x84000000
Loading: *
Got TFTP_OACK: TFTP remote port: changes from 69 to 61554
#################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #####
         1.5 MiB/s
done
Bytes transferred = 5796610 (587302 hex)

IPQ40xx# nand erase 0x00b80000 0x04100000
NAND erase: device 0 offset 0xb80000, size 0x4100000
Erasing at 0x4c60000 -- 100% complete.
OK

IPQ40xx# nand write $fileaddr 0x00b80000 0x01640000
NAND write: device 0 offset 0xb80000, size 0x1640000
 23330816 bytes written: OK

IPQ40xx# bootipq
ubi0: attaching mtd2
ubi0: scanning is finished
UBI init error 22

Net:   MAC0 addr:0:3:7f:ba:db:ad
, eth0
IPQ40xx#

Is this the right method to do direct upgrade using NAND write?

I suggest always to use dumpimage -l and compare the working image with new image you have produced to double check it first. CLI sysupgrade --test does the check as well. QSDK openwrt has sysupgrade image with check routines to detect mandatory image components.

Hi, do you have an example?
I use the scripts/mkits-qsdk-ipq-image.sh, but still failed.

What exactly do you have problem with?

There are two ready recipes for that:

Usage:

1 Like

That's because QSDK checks to make sure you're flashing their firmware.

(This information was provided above.)

Convert to OpenWrt first.

Hi, this is my article:

ERROR:flash openwrt firmware to a board with QSDK firmware

You should probably contact your board vendor and ask for GPL sources to be able to find out how the sysupgrade image format needs to look like.

1 Like