TP-Link Archer C7 V5(EU): Problems to unbrick

Hi,

I had my TP-Link Archer C7 V5 up with OpenWrt 18.06.2 for quite a while. Yesterday I updated to 19.07.01 but had problems as /dev/radio devices were not up. So I took 18.06.2 and flashed back via luci but that lead to a bricked device.

So I soldered RS232 to my PCB and followed the instruction for "Recovery using serial connection" trying http://downloads.openwrt.org/releases/19.07.1/targets/ath79/generic/openwrt-19.07.1-ath79-generic-tplink_archer-c7-v5-squashfs-factory.bin

U-Boot 1.1.4 (Mar  8 2018 - 16:34:18)

ap152 - Dragonfly 1.0

DRAM:  128 MB
Top of RAM usable for U-Boot at: 88000000
Reserving 413k for U-Boot at: 87f98000
Reserving 16448k for malloc() at: 86f88000
Reserving 44 Bytes for Board Info at: 86f87fd4
Reserving 36 Bytes for Global Data at: 86f87fb0
Reserving 128k for boot params() at: 86f67fb0
Stack Pointer at: 86f67f98
Now running in RAM - U-Boot at: 87f98000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16MB, sector count = 256
Flash: 16 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ath_gmac_enet_initialize...
Fetching MAC Address from 0x87fbafdc
ath_gmac_enet_initialize: reset mask:c02200
athr_mgmt_init ::done
Dragonfly  ----> S17 PHY *
athrs17_reg_init: complete
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x80000000 cfg2 0x7114
eth0: 00:00:2f:81:00:00
eth0 up
eth0
Setting 0x181162c0 to 0x264c2100
[NM_Error](nm_api_checkInteger) 00384: extra-para:01 01


[393]factory boot check integer ok.

factory boot load fs uboot len 131072 to addr 0x80010000.
Hit any key to stop autoboot:  0
ath> tftp 0x81000000 factory.bin
Trying eth0
dup 1 speed 1000
Using eth0 device
TFTP from server 192.168.0.10; our IP address is 192.168.0.2
Filename 'factory.bin'.
Load address: 0x81000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ################################
done
Bytes transferred = 4488373 (447cb5 hex)
ath> erase 0x9f020000 +f80000
Erasing flash...
First 0x2 last 0xf9 sector size 0x10000                                      249
Erased 248 sectors
ath> cp.b 0x81000000 0x9f020000 0xf80000
Copy to Flash... write addr: 9f020000
done
ath> reset

so it was booting as follows

U-Boot 1.1.4 (Mar  8 2018 - 16:34:18)

ap152 - Dragonfly 1.0

DRAM:  128 MB
Top of RAM usable for U-Boot at: 88000000
Reserving 413k for U-Boot at: 87f98000
Reserving 16448k for malloc() at: 86f88000
Reserving 44 Bytes for Board Info at: 86f87fd4
Reserving 36 Bytes for Global Data at: 86f87fb0
Reserving 128k for boot params() at: 86f67fb0
Stack Pointer at: 86f67f98
Now running in RAM - U-Boot at: 87f98000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16MB, sector count = 256
Flash: 16 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ath_gmac_enet_initialize...
Fetching MAC Address from 0x87fbafdc
ath_gmac_enet_initialize: reset mask:c02200
athr_mgmt_init ::done
Dragonfly  ----> S17 PHY *
athrs17_reg_init: complete
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x80000000 cfg2 0x7114
eth0: 00:00:2f:81:00:00
eth0 up
eth0
Setting 0x181162c0 to 0x264c2100
[NM_Error](nm_api_checkInteger) 00384: extra-para:6d 5b


[NM_Error](nm_api_checkInteger) 00389: factory boot check integer flag is not 1.

Hit any key to stop autoboot:  0
Trying eth0
eth0 link down
FAIL
Trying eth0
eth0 link down
FAIL
Trying eth0
dup 1 speed 1000
HTTP server is starting at IP: 192.168.0.1
HTTP server is ready!

-> Web failsafe mode

This was not expected but I gave a try and uploaded the factory.bin via webinterface

U-Boot 1.1.4 (Mar  8 2018 - 16:34:18)

ap152 - Dragonfly 1.0

DRAM:  128 MB
Top of RAM usable for U-Boot at: 88000000
Reserving 413k for U-Boot at: 87f98000
Reserving 16448k for malloc() at: 86f88000
Reserving 44 Bytes for Board Info at: 86f87fd4
Reserving 36 Bytes for Global Data at: 86f87fb0
Reserving 128k for boot params() at: 86f67fb0
Stack Pointer at: 86f67f98
Now running in RAM - U-Boot at: 87f98000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16MB, sector count = 256
Flash: 16 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ath_gmac_enet_initialize...
Fetching MAC Address from 0x87fbafdc
ath_gmac_enet_initialize: reset mask:c02200
athr_mgmt_init ::done
Dragonfly  ----> S17 PHY *
athrs17_reg_init: complete
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x80000000 cfg2 0x7114
eth0: 00:00:2f:81:00:00
eth0 up
eth0
Setting 0x181162c0 to 0x264c2100
[NM_Error](nm_api_checkInteger) 00384: extra-para:cd a3


[NM_Error](nm_api_checkInteger) 00389: factory boot check integer flag is not 1.

Hit any key to stop autoboot:  0
Trying eth0
eth0 link down
FAIL
Trying eth0
eth0 link down
FAIL
Trying eth0
dup 1 speed 1000
HTTP server is starting at IP: 192.168.0.1
HTTP server is ready!

Request for: /
Request for: /favicon.ico
## Error: request file name not suport!
Request for: /favicon.ico
## Error: request file name not suport!
Request for: /favicon.ico
## Error: request file name not suport!
Request for: /favicon.ico
## Error: request file name not suport!
Request for: /favicon.ico
## Error: request file name not suport!
Request for: /favicon.ico
## Error: request file name not suport!
Request for: /favicon.ico
## Error: request file name not suport!
Request for: /favicon.ico
## Error: request file name not suport!
Request for: /favicon.ico
## Error: request file name not suport!
Request for: /favicon.ico
## Error: request file name not suport!
Data will be downloaded at 0x80060000 in RAM
Upgrade type: firmware
Upload file size: 4488373 bytes
Loading: #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         ##########################

Firmware Recovery file length : 4488373

Firmware process common.

Image verify OK!

Firmware file Verify ok!

product-info:product_name:Archer C7
product_ver:5.0.0
special_id:55530000

[Error]sysmgr_cfg_checkSupportList(): 1023 @ specialId 00000000 NOT Match.

[Error]sysmgr_cfg_checkSupportList(): 1023 @ specialId 45550000 NOT Match.

Firmware supports, check OK.

Firmware Recovery check ok!

upgrade_filecheck ok
HTTP upload is done! Upgrading...
do http upgrade
Firmware Recovery file length : 4488373

Firmware process common.

Image verify OK!

Firmware file Verify ok!

product-info:product_name:Archer C7
product_ver:5.0.0
special_id:55530000

[Error]sysmgr_cfg_checkSupportList(): 1023 @ specialId 00000000 NOT Match.

[Error]sysmgr_cfg_checkSupportList(): 1023 @ specialId 45550000 NOT Match.

Firmware supports, check OK.

Firmware Recovery check ok!

set integer flag to 0.

######################################################################
####
Done.
set integer flag to 1.

Firmware Recovery Success!

HTTP ugrade is done! Rebooting...

▒

U-Boot 1.1.4 (Mar  8 2018 - 16:34:18)

ap152 - Dragonfly 1.0

DRAM:  128 MB
Top of RAM usable for U-Boot at: 88000000
Reserving 413k for U-Boot at: 87f98000
Reserving 16448k for malloc() at: 86f88000
Reserving 44 Bytes for Board Info at: 86f87fd4
Reserving 36 Bytes for Global Data at: 86f87fb0
Reserving 128k for boot params() at: 86f67fb0
Stack Pointer at: 86f67f98
Now running in RAM - U-Boot at: 87f98000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16MB, sector count = 256
Flash: 16 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ath_gmac_enet_initialize...
Fetching MAC Address from 0x87fbafdc
ath_gmac_enet_initialize: reset mask:c02200
athr_mgmt_init ::done
Dragonfly  ----> S17 PHY *
athrs17_reg_init: complete
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x80000000 cfg2 0x7114
eth0: 00:00:2f:81:00:00
eth0 up
eth0
Setting 0x181162c0 to 0x264c2100
[NM_Error](nm_api_checkInteger) 00384: extra-para:01 01


[393]factory boot check integer ok.

factory boot load fs uboot len 131072 to addr 0x80010000.
Hit any key to stop autoboot:  0
## Starting application at 0x80010000

grafik

In a second step I gave a try with the sysupgrade image http://downloads.openwrt.org/releases/19.07.1/targets/ath79/generic/openwrt-19.07.1-ath79-generic-tplink_archer-c7-v5-squashfs-sysupgrade.bin

U-Boot 1.1.4 (Mar  8 2018 - 16:34:18)

ap152 - Dragonfly 1.0

DRAM:  128 MB
Top of RAM usable for U-Boot at: 88000000
Reserving 413k for U-Boot at: 87f98000
Reserving 16448k for malloc() at: 86f88000
Reserving 44 Bytes for Board Info at: 86f87fd4
Reserving 36 Bytes for Global Data at: 86f87fb0
Reserving 128k for boot params() at: 86f67fb0
Stack Pointer at: 86f67f98
Now running in RAM - U-Boot at: 87f98000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16MB, sector count = 256
Flash: 16 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ath_gmac_enet_initialize...
Fetching MAC Address from 0x87fbafdc
ath_gmac_enet_initialize: reset mask:c02200
athr_mgmt_init ::done
Dragonfly  ----> S17 PHY *
athrs17_reg_init: complete
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x80000000 cfg2 0x7114
eth0: 00:00:2f:81:00:00
eth0 up
eth0
Setting 0x181162c0 to 0x264c2100
[NM_Error](nm_api_checkInteger) 00384: extra-para:6d 5b


[NM_Error](nm_api_checkInteger) 00389: factory boot check integer flag is not 1.

Hit any key to stop autoboot:  0
ath> tftp 0x81000000 sysupgrade.bin
Trying eth0
dup 1 speed 1000
Using eth0 device
TFTP from server 192.168.0.10; our IP address is 192.168.0.2
Filename 'sysupgrade.bin'.
Load address: 0x81000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ##########################
done
Bytes transferred = 4456749 (44012d hex)
ath> erase 0x9f020000 +f80000
Erasing flash...
First 0x2 last 0xf9 sector size 0x10000                                      249
Erased 248 sectors
ath> cp.b 0x81000000 0x9f020000 0xf80000
Copy to Flash... write addr: 9f020000
done
ath> reset

Then the image restarted with

U-Boot 1.1.4 (Mar  8 2018 - 16:34:18)

ap152 - Dragonfly 1.0

DRAM:  128 MB
Top of RAM usable for U-Boot at: 88000000
Reserving 413k for U-Boot at: 87f98000
Reserving 16448k for malloc() at: 86f88000
Reserving 44 Bytes for Board Info at: 86f87fd4
Reserving 36 Bytes for Global Data at: 86f87fb0
Reserving 128k for boot params() at: 86f67fb0
Stack Pointer at: 86f67f98
Now running in RAM - U-Boot at: 87f98000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16MB, sector count = 256
Flash: 16 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ath_gmac_enet_initialize...
Fetching MAC Address from 0x87fbafdc
ath_gmac_enet_initialize: reset mask:c02200
athr_mgmt_init ::done
Dragonfly  ----> S17 PHY *
athrs17_reg_init: complete
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x80000000 cfg2 0x7114
eth0: 00:00:2f:81:00:00
eth0 up
eth0
Setting 0x181162c0 to 0x264c2100
[NM_Error](nm_api_checkInteger) 00384: extra-para:cd a3


[NM_Error](nm_api_checkInteger) 00389: factory boot check integer flag is not 1.

Hit any key to stop autoboot:  0
Trying eth0
eth0 link down
FAIL
Trying eth0
eth0 link down
FAIL
Trying eth0
dup 1 speed 1000
HTTP server is starting at IP: 192.168.0.1
HTTP server is ready!

Once more entering into the Web failsafe mode from TP Link

I am lost, does someone have an idea what is wrong in my sequencing/images?

Changing from ar71xx to ath79 and trying to save settings will break the wireless and likely other things. Do not save settings when changing between the two targets.

Writing directly to flash you should use the sysupgrade image.

Now that there is a sysupgrade in place try interrupting the bootloader then boot manually with bootm 0x9f020000

If that works you may have the wrong bootcmd in the bootloader. In the bootloader, check printenv to see the bootloader settings.

If OpenWrt does start up, first off backup the ART partition to your PC if you haven't already. Then try a sysupgrade -n to flash again.

2 Likes

Thank you for the rocket fast answer, I directly gave a try

U-Boot 1.1.4 (Mar  8 2018 - 16:34:18)

ap152 - Dragonfly 1.0

DRAM:  128 MB
Top of RAM usable for U-Boot at: 88000000
Reserving 413k for U-Boot at: 87f98000
Reserving 16448k for malloc() at: 86f88000
Reserving 44 Bytes for Board Info at: 86f87fd4
Reserving 36 Bytes for Global Data at: 86f87fb0
Reserving 128k for boot params() at: 86f67fb0
Stack Pointer at: 86f67f98
Now running in RAM - U-Boot at: 87f98000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16MB, sector count = 256
Flash: 16 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ath_gmac_enet_initialize...
Fetching MAC Address from 0x87fbafdc
ath_gmac_enet_initialize: reset mask:c02200
athr_mgmt_init ::done
Dragonfly  ----> S17 PHY *
athrs17_reg_init: complete
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x80000000 cfg2 0x7114
eth0: 00:00:2f:81:00:00
eth0 up
eth0
Setting 0x181162c0 to 0x264c2100
[NM_Error](nm_api_checkInteger) 00384: extra-para:cd a3


[NM_Error](nm_api_checkInteger) 00389: factory boot check integer flag is not 1.

Hit any key to stop autoboot:  0
ath>

I printed the u-boot environment

ath> printenv
bootargs=console=ttyS0,115200 board=AP152 rootfstype=squashfs init=/etc/preinit mtdparts=spi0.0:128k(factory-uboot),192k(u-boot),64k(ART),1536k(uImage),14464k@0x1e0000(rootfs) mem=128M
bootcmd=bootm 0x9f0c0000
bootdelay=1
baudrate=115200
ethaddr=0x00:0xaa:0xbb:0xcc:0xdd:0xee
ipaddr=192.168.0.2
serverip=192.168.0.10
dir=
lu=tftp 0x80060000 ${dir}tuboot.bin&&erase 0x9f000000 +$filesize&&cp.b $fileaddr 0x9f000000 $filesize
lf=tftp 0x80060000 ${dir}ap152${bc}-jffs2&&erase 0x9f010000 +$filesize&&cp.b $fileaddr 0x9f010000 $filesize
lk=tftp 0x80060000 ${dir}vmlinux${bc}.lzma.uImage&&erase 0x9f300000 +$filesize&&cp.b $fileaddr 0x9f300000 $filesize
stdin=serial
stdout=serial
stderr=serial
ethact=eth0

Environment size: 701/65532 bytes
ath>

and entered bootm 0x9f020000

Hit any key to stop autoboot:  0
ath> bootm 0x9f020000
## Booting image at 9f020000 ...
   Image Name:   MIPS OpenWrt Linux-4.14.167
   Created:      2020-01-29  16:05:35 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1595947 Bytes =  1.5 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum at 0x9f020040 ...OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 134217728

Starting kernel ...

[    0.000000] Linux version 4.14.167 (builder@buildhost) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r10911-c155900f66)) #0 Wed Jan 29 16:05:35 2020
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019750 (MIPS 74Kc)
[    0.000000] MIPS: machine is TP-Link Archer C7 v5
[    0.000000] SoC: Qualcomm Atheros QCA956X ver 1 rev 0
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] random: get_random_bytes called from 0x804fd740 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200n8 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 123296K/131072K available (4027K kernel code, 156K rwdata, 532K rodata, 1228K init, 212K bss, 7776K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] CPU clock: 775.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 4932285024 ns
[    0.000007] sched_clock: 32 bits at 387MHz, resolution 2ns, wraps every 5541893118ns
[    0.008216] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.074762] pid_max: default: 32768 minimum: 301
[    0.079783] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.086768] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.097844] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.108240] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.114734] pinctrl core: initialized pinctrl subsystem
[    0.122282] NET: Registered protocol family 16
[    0.129470] PCI host bridge /ahb/apb/pcie-controller@18250000 ranges:
[    0.136315]  MEM 0x0000000012000000..0x0000000013ffffff
[    0.141818]   IO 0x0000000000000000..0x0000000000000000
[    0.162294] PCI host bridge to bus 0000:00
[    0.166620] pci_bus 0000:00: root bus resource [mem 0x12000000-0x13ffffff]
[    0.173902] pci_bus 0000:00: root bus resource [io  0x0000]
[    0.179766] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.186925] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.195676] pci 0000:00:00.0: BAR 0: assigned [mem 0x12000000-0x121fffff 64bit]
[    0.203426] pci 0000:00:00.0: BAR 6: assigned [mem 0x12200000-0x1220ffff pref]
[    0.213601] clocksource: Switched to clocksource MIPS
[    0.219828] NET: Registered protocol family 2
[    0.225186] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.232537] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.239288] TCP: Hash tables configured (established 1024 bind 1024)
[    0.246118] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.252290] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.259139] NET: Registered protocol family 1
[    0.266345] Crashlog allocated RAM at address 0x3f00000
[    0.272982] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    0.284038] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.290185] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.308902] io scheduler noop registered
[    0.313032] io scheduler deadline registered (default)
[    0.318796] ar7200-usb-phy usb-phy: phy reset is missing
[    0.325927] pinctrl-single 1804002c.pinmux: 544 pins at pa b804002c size 68
[    0.333740] gpio-export gpio-export: 1 gpio(s) exported
[    0.339954] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.348714] console [ttyS0] disabled
[    0.352512] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 1562500) is a 16550A
[    0.361643] console [ttyS0] enabled
[    0.361643] console [ttyS0] enabled
[    0.369210] bootconsole [early0] disabled
[    0.369210] bootconsole [early0] disabled
[    0.394592] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    0.399508] 8 fixed-partitions partitions found on MTD device spi0.0
[    0.406091] Creating 8 MTD partitions on "spi0.0":
[    0.411048] 0x000000000000-0x000000020000 : "factory-uboot"
[    0.417496] 0x000000020000-0x000000040000 : "u-boot"
[    0.423248] 0x000000040000-0x000000050000 : "partition-table"
[    0.429879] 0x000000050000-0x000000060000 : "art"
[    0.435443] 0x000000060000-0x000000080000 : "info"
[    0.441031] 0x000000080000-0x0000000c0000 : "user-config"
[    0.447300] 0x0000000c0000-0x000000fc0000 : "firmware"
[    0.468948] 0x000000ff0000-0x000001000000 : "default-config"
[    0.476471] libphy: Fixed MDIO Bus: probed
[    0.482793] ag71xx 19000000.eth: invalid MAC address, using random address
[    1.163962] libphy: ag71xx_mdio: probed
[    1.170928] switch0: Atheros AR8337 rev. 2 switch registered on mdio-bus.0
[    1.825079] ag71xx 19000000.eth: connected to PHY at mdio-bus.0:00 [uid=004dd036, driver=Atheros AR8216/AR8236/AR8316]
[    1.836665] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: sgmii
[    1.845750] NET: Registered protocol family 10
[    1.855669] Segment Routing with IPv6
[    1.859532] NET: Registered protocol family 17
[    1.864207] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    1.877604] 8021q: 802.1Q VLAN Support v1.8
[    1.883906] hctosys: unable to open rtc device (rtc0)
[    1.889990] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.897767] Please append a correct "root=" boot option; here are the available partitions:
[    1.906410] 1f00             128 mtdblock0
[    1.906415]  (driver?)
[    1.913166] 1f01             128 mtdblock1
[    1.913168]  (driver?)
[    1.919921] 1f02              64 mtdblock2
[    1.919924]  (driver?)
[    1.926686] 1f03              64 mtdblock3
[    1.926689]  (driver?)
[    1.933431] 1f04             128 mtdblock4
[    1.933434]  (driver?)
[    1.940188] 1f05             256 mtdblock5
[    1.940191]  (driver?)
[    1.946944] 1f06           15360 mtdblock6
[    1.946948]  (driver?)
[    1.953702] 1f07              64 mtdblock7
[    1.953706]  (driver?)
[    1.960454] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.969638] Rebooting in 1 seconds..
▒

U-Boot 1.1.4 (Mar  8 2018 - 16:34:18)

ap152 - Dragonfly 1.0

DRAM:  128 MB
Top of RAM usable for U-Boot at: 88000000
Reserving 413k for U-Boot at: 87f98000
Reserving 16448k for malloc() at: 86f88000
Reserving 44 Bytes for Board Info at: 86f87fd4
Reserving 36 Bytes for Global Data at: 86f87fb0
Reserving 128k for boot params() at: 86f67fb0
Stack Pointer at: 86f67f98
Now running in RAM - U-Boot at: 87f98000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16MB, sector count = 256
Flash: 16 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ath_gmac_enet_initialize...
Fetching MAC Address from 0x87fbafdc
ath_gmac_enet_initialize: reset mask:c02200
athr_mgmt_init ::done
Dragonfly  ----> S17 PHY *
athrs17_reg_init: complete
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x80000000 cfg2 0x7114
eth0: 00:00:2f:81:00:00
eth0 up
eth0
Setting 0x181162c0 to 0x264c2100
[NM_Error](nm_api_checkInteger) 00384: extra-para:cd a3


[NM_Error](nm_api_checkInteger) 00389: factory boot check integer flag is not 1.

Hit any key to stop autoboot:  0
Trying eth0
eth0 link down
FAIL
Trying eth0
eth0 link down
FAIL
Trying eth0
dup 1 speed 1000
HTTP server is starting at IP: 192.168.0.1
HTTP server is ready!

So looks like I am a step forward now thanks to your help, but now I have some problem with my root fs

[    1.889990] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.897767] Please append a correct "root=" boot option; here are the available partitions:
[    1.906410] 1f00             128 mtdblock0
[    1.906415]  (driver?)
[    1.913166] 1f01             128 mtdblock1
[    1.913168]  (driver?)
[    1.919921] 1f02              64 mtdblock2
[    1.919924]  (driver?)
[    1.926686] 1f03              64 mtdblock3
[    1.926689]  (driver?)
[    1.933431] 1f04             128 mtdblock4
[    1.933434]  (driver?)
[    1.940188] 1f05             256 mtdblock5
[    1.940191]  (driver?)
[    1.946944] 1f06           15360 mtdblock6
[    1.946948]  (driver?)
[    1.953702] 1f07              64 mtdblock7
[    1.953706]  (driver?)
[    1.960454] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Do you have an idea how to solve this?

That partial boot does show the V5's flash partitioning according to OpenWrt. It is different from most TP-Link models.

Creating 8 MTD partitions on "spi0.0":
[ 0.411048] 0x000000000000-0x000000020000 : "factory-uboot" 
[ 0.417496] 0x000000020000-0x000000040000 : "u-boot" 
[ 0.423248] 0x000000040000-0x000000050000 : "partition-table" 
[ 0.429879] 0x000000050000-0x000000060000 : "art" 
[ 0.435443] 0x000000060000-0x000000080000 : "info" 
[ 0.441031] 0x000000080000-0x0000000c0000 : "user-config" 
[ 0.447300] 0x0000000c0000-0x000000fc0000 : "firmware" 
[ 0.468948] 0x000000ff0000-0x000001000000 : "default-config"

The firmware should be placed starting at C0000 not 20000 where you wrote it.
This brings up the serious problem that the ART partition was not at the end of the flash as is usual, but in block 5, which has been clobbered.

So you mean I should change 0x9f020000 to 0x9f0C0000 for this sequence?

ath> erase 0x9f020000 +f80000
Erasing flash...
First 0x2 last 0xf9 sector size 0x10000                                      249
Erased 248 sectors
ath> cp.b 0x81000000 0x9f020000 0xf80000
Copy to Flash... write addr: 9f020000

I took the sequence from https://openwrt.org/toh/tp-link/archer-c5-c7-wdr7500 " Recovery using serial connection", does the V5 have another memory layout than V2, which is written to be

16MB Flash Chip (Archer C7 V2)
0x000000000000-0x000000020000 “u-boot”
0x000000020000-0x000000120000 “kernel”
0x000000120000-0x000000fa0000 “rootfs”
0x000000fa0000-0x000000ff0000 “config”
0x000000ff0000-0x000001000000 “ART”

Indeed the V5 is different from the V2 and the wiki does not explain that.

Yes you can flash to 9f0c0000, but also don't erase so far-- it only needs to be enough for the size of the file so use like 0x800000 as the last parameter.

It is much safer not to write directly to the flash in the first place. What I prefer to do is:

  • Obtain an initramfs build for the model and version. These are found in the snapshot directory.
  • TFTP the initramfs build to somewhere in RAM (0x81000000 for this system)
  • bootm 0x81000000 to launch the initramfs build directly in RAM. The router is now running a full OpenWrt, but from RAM. This is only for recovery purposes since it can't save any files permanently, and won't boot again after the power is cut off.
  • scp a sysupgrade build to /tmp in OpenWrt.
  • use sysupgrade -n to flash this file. OpenWrt will take care of placing it at the right flash address and not damaging other data in flash.
1 Like

I downloaded https://downloads.openwrt.org/releases/19.07.1/targets/ath79/generic/openwrt-19.07.1-ath79-generic-tplink_archer-c7-v5-initramfs-kernel.bin and renamed to initramfs-kernel.bin

ath> tftp 0x81000000 initramfs-kernel.bin
Trying eth0
Using eth0 device
TFTP from server 192.168.0.10; our IP address is 192.168.0.2
Filename 'initramfs-kernel.bin'.
Load address: 0x81000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###############################
done
Bytes transferred = 3816391 (3a3bc7 hex)
ath> bootm 0x81000000
## Booting image at 81000000 ...
Bad Magic Number

I am not sure what this means, but then I changed the flashing to 0x9f0C0000 to follow your quite valid suggestion:

U-Boot 1.1.4 (Mar  8 2018 - 16:34:18)

ap152 - Dragonfly 1.0

DRAM:  128 MB
Top of RAM usable for U-Boot at: 88000000
Reserving 413k for U-Boot at: 87f98000
Reserving 16448k for malloc() at: 86f88000
Reserving 44 Bytes for Board Info at: 86f87fd4
Reserving 36 Bytes for Global Data at: 86f87fb0
Reserving 128k for boot params() at: 86f67fb0
Stack Pointer at: 86f67f98
Now running in RAM - U-Boot at: 87f98000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16MB, sector count = 256
Flash: 16 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ath_gmac_enet_initialize...
Fetching MAC Address from 0x87fbafdc
ath_gmac_enet_initialize: reset mask:c02200
athr_mgmt_init ::done
Dragonfly  ----> S17 PHY *
athrs17_reg_init: complete
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x80000000 cfg2 0x7114
eth0: 00:00:2f:81:00:00
eth0 up
eth0
Setting 0x181162c0 to 0x264c2100
[NM_Error](nm_api_checkInteger) 00384: extra-para:cd a3


[NM_Error](nm_api_checkInteger) 00389: factory boot check integer flag is not 1.

Hit any key to stop autoboot:  0
ath> tftp 0x81000000 squashfs-sysupgrade.bin
Trying eth0
dup 1 speed 1000
Using eth0 device
TFTP from server 192.168.0.10; our IP address is 192.168.0.2
Filename 'squashfs-sysupgrade.bin'.
Load address: 0x81000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ##########################
done
Bytes transferred = 4456749 (44012d hex)
ath> erase 0x9f0c0000 +800000
Erasing flash...
First 0xc last 0x8b sector size 0x10000                                      139
Erased 128 sectors
ath> cp.b 0x81000000 0x9f0c0000 0x800000
Copy to Flash... write addr: 9f0c0000
done
ath> reset

so system reboots, I interrupted in u-boot and entered bootm manually

U-Boot 1.1.4 (Mar  8 2018 - 16:34:18)

ap152 - Dragonfly 1.0

DRAM:  128 MB
Top of RAM usable for U-Boot at: 88000000
Reserving 413k for U-Boot at: 87f98000
Reserving 16448k for malloc() at: 86f88000
Reserving 44 Bytes for Board Info at: 86f87fd4
Reserving 36 Bytes for Global Data at: 86f87fb0
Reserving 128k for boot params() at: 86f67fb0
Stack Pointer at: 86f67f98
Now running in RAM - U-Boot at: 87f98000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16MB, sector count = 256
Flash: 16 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ath_gmac_enet_initialize...
Fetching MAC Address from 0x87fbafdc
ath_gmac_enet_initialize: reset mask:c02200
athr_mgmt_init ::done
Dragonfly  ----> S17 PHY *
athrs17_reg_init: complete
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x80000000 cfg2 0x7114
eth0: 00:00:2f:81:00:00
eth0 up
eth0
Setting 0x181162c0 to 0x264c2100
[NM_Error](nm_api_checkInteger) 00384: extra-para:cd a3


[NM_Error](nm_api_checkInteger) 00389: factory boot check integer flag is not 1.

Hit any key to stop autoboot:  0
ath> bootm 0x9f0c0000

and system boots - great!

ath> bootm 0x9f0c0000
## Booting image at 9f0c0000 ...
   Image Name:   MIPS OpenWrt Linux-4.14.167
   Created:      2020-01-29  16:05:35 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1595947 Bytes =  1.5 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum at 0x9f0c0040 ...OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 134217728

Starting kernel ...

[    0.000000] Linux version 4.14.167 (builder@buildhost) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r10911-c155900f66)) #0 Wed Jan 29 16:05:35 2020
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019750 (MIPS 74Kc)
[    0.000000] MIPS: machine is TP-Link Archer C7 v5
[    0.000000] SoC: Qualcomm Atheros QCA956X ver 1 rev 0
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] random: get_random_bytes called from 0x804fd740 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200n8 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
...

So I entered into the shell, copied the file from https://downloads.openwrt.org/releases/19.07.1/targets/ath79/generic/openwrt-19.07.1-ath79-generic-tplink_archer-c7-v5-squashfs-sysupgrade.bin to /tmp/squashfs-sysupgrade.bin and executed sysupgrade -n /tmp/squashfs-sysupgrade.bin

root@OpenWrt:/# sysupgrade -n /tmp/squashfs-sysupgrade.bin
Commencing upgrade. Closing all shell sessions.
Watchdog handover: fd=3
- watchdog -
killall: telnetd: no process killed
Sending TERM to remaining processes ... logd rpcd netifd odhcpd uhttpd dnsmasq ntpd ubusd urngd
Sending KILL to remaining processes ... ntpd
Switching to ramdisk...
Performing system upgrade...
Unlocking firmware ...

Writing from <stdin> to firmware ...
Upgrade completed
Rebooting system...
umount: can't unmount /dev: Resource busy
[  303.313898] reboot: Restarting system
▒

U-Boot 1.1.4 (Mar  8 2018 - 16:34:18)

ap152 - Dragonfly 1.0

DRAM:  128 MB
Top of RAM usable for U-Boot at: 88000000
...

on any boot I still have to enter bootm 0x9f0c0000 (will change it later in u-boot after system runs fine) but then the system comes up to luci and initial configuration dialog to change pw of root.

But, I still have no radio devices (my initial problem after migration from 18.06.2 to 19.07.01. The is the point that you mentioned above by: "Changing from ar71xx to ath79 and trying to save settings will break the wireless and likely other things. Do not save settings when changing between the two targets."

Do you have an idea how to adress this remaining issue?

root@OpenWrt:~# uci show wireless
uci: Entry not found
root@OpenWrt:~#

1 Like

Might it be the case that my ART partition is corrupted?

I checked the kernel logs and first failure is
[ 9.986406] ath10k_pci 0000:00:00.0: Direct firmware load for ath10k/pre-cal-pci-0000:00:00.0.bin failed with error -2

The good news I have another Archer C7 V5 which is still running fine unmodified using 18.06.2. so I recovered the bricked one to the same sw version.

Looking for how to backup/recover ART partitions I found this page: https://openwrt.org/docs/guide-user/installation/restore_art_partition

Ok, I checked the partition scheme via 'cat /proc/mtd' and get

root@OpenWrt:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00020000 00010000 "factory-uboot"
mtd1: 00020000 00010000 "u-boot"
mtd2: 00010000 00010000 "art"
mtd3: 00180000 00010000 "kernel"
mtd4: 00d80000 00010000 "rootfs"
mtd5: 00af0000 00010000 "rootfs_data"
mtd6: 00f00000 00010000 "firmware"

Schemes are idential on both machines, I took a backup from both ART partitions via 'dd if=/dev/mtd2 of=/tmp/art_EG.backup' (running one) and 'dd if=/dev/mtd2 of=/tmp/art_DG.backup' (broken one).

root@OpenWrt:~# dd if=/dev/mtd2 of=/tmp/art_DG.backup
128+0 records in
128+0 records out

Now the guide in https://openwrt.org/docs/guide-user/installation/restore_art_partition says that have to modify the MAC in 0x120C and 0x520c but looks like there is no MAC?

grafik

As I have a backup from "good" (EG) and "bricked" (DG) device I tried to write the ART partition from "good" to "bricked" device

root@OpenWrt:~# mtd -r write /tmp/art_EG.backup art
Could not open mtd device: art
Can't open device for writing!

OK, let's give a try via kmod-mtd-rw

root@OpenWrt:~# opkg update
Downloading http://downloads.openwrt.org/releases/18.06.2/targets/ar71xx/generic/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading http://downloads.openwrt.org/releases/18.06.2/targets/ar71xx/generic/packages/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/18.06.2/targets/ar71xx/generic/kmods/4.9.152-1-def6b4b6fd5b0fd8587fe8dbf55baf5c/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_kmods
Downloading http://downloads.openwrt.org/releases/18.06.2/targets/ar71xx/generic/kmods/4.9.152-1-def6b4b6fd5b0fd8587fe8dbf55baf5c/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/base/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/luci/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/packages/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/routing/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/telephony/Packages.sig
Signature check passed.
root@OpenWrt:~# opkg install kmod-mtd-rw
Installing kmod-mtd-rw (4.9.152+git-20160214-1) to root...
Downloading http://downloads.openwrt.org/releases/18.06.2/targets/ar71xx/generic/kmods/4.9.152-1-def6b4b6fd5b0fd8587fe8dbf55baf5c/kmod-mtd-rw_4.9.152%2bgit-20160214-1_mips_24kc.ipk
Configuring kmod-mtd-rw.
root@OpenWrt:~#

and executed

root@OpenWrt:~# insmod mtd-rw.ko i_want_a_brick=1
root@OpenWrt:~# mtd -r write /tmp/art_EG.backup art
Unlocking art ...

Writing from /tmp/art_EG.backup to art ...
Rebooting ...

Now I cant't boot anymore

ath> bootm 0x9f020000
## Booting image at 9f020000 ...
   Image Name:   MIPS OpenWrt Linux-4.14.167
   Created:      2020-01-29  16:05:35 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1595947 Bytes =  1.5 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum at 0x9f020040 ...Bad Data CRC

I'm lost.... any idea?

Also copy over the second stage bootloader (mtd1) from the good unit.

Your last attempt you tried to boot from 9f02 it's 9f0c.

I was not giving up an playing a little bit more....

Flash via tftp

tftp 0x81000000 18_06_2_squashfs-sysupgrade.bin
erase 0x9f0c0000 +800000
cp.b 0x81000000 0x9f0c0000 0x800000
reset

boot via
bootm 0x9f0c0000

let system startup and ...works!

I could configure the wireless devices

1 Like

Ok, time to clean up.....

You say I still need to carry over mtd1 from good unit, will this adress that I still have to start manually via bootm 0x9f0c0000 or is this just not needed due to flashing once more?

I guess I have to use kmod-mtd-rw once more then, as this will change the partition to writeable, do I need to do some further cleanups after doing so to get this back to just readable?

1 Like

I think that the second bootloader actually boots the firmware. The first bootloader tries to boot 9f02 because that is where the second bootloader is stored.

kmod-mtd-rw must be manually loaded into the kernel, so it is only active until the next reboot. There is no need to clean up, as in restoring write protection. The package should be removed after you're done to save flash space and prevent unintentional loading.

I just copied the mtd1 from good one

root@OpenWrt:~# mtd -r write /tmp/EG_mtd1_uboot.backup u-boot
Unlocking u-boot ...

Writing from /tmp/EG_mtd1_uboot.backup to u-boot ...
Rebooting ...

but automatic boot still fails

U-Boot 1.1.4 (Mar  8 2018 - 16:34:18)

ap152 - Dragonfly 1.0

DRAM:  128 MB
Top of RAM usable for U-Boot at: 88000000
Reserving 413k for U-Boot at: 87f98000
Reserving 16448k for malloc() at: 86f88000
Reserving 44 Bytes for Board Info at: 86f87fd4
Reserving 36 Bytes for Global Data at: 86f87fb0
Reserving 128k for boot params() at: 86f67fb0
Stack Pointer at: 86f67f98
Now running in RAM - U-Boot at: 87f98000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16MB, sector count = 256
Flash: 16 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ath_gmac_enet_initialize...
Fetching MAC Address from 0x87fbafdc
ath_gmac_enet_initialize: reset mask:c02200
athr_mgmt_init ::done
Dragonfly  ----> S17 PHY *
athrs17_reg_init: complete
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x80000000 cfg2 0x7114
eth0: 00:00:2f:81:00:00
eth0 up
eth0
Setting 0x181162c0 to 0x264c2100
[NM_Error](nm_api_checkInteger) 00384: extra-para:cd a3


[NM_Error](nm_api_checkInteger) 00389: factory boot check integer flag is not 1.

Hit any key to stop autoboot:  0
Trying eth0
eth0 link down
FAIL
Trying eth0
dup 1 speed 1000
HTTP server is starting at IP: 192.168.0.1
HTTP server is ready!

so I still have to enter 'bootm 0x9f0c0000' to get unit after restart

I did printenv in u-boot and here 'bootm 0x9f0c0000' is defined as bootcmd:

ath> printenv
bootargs=console=ttyS0,115200 board=AP152 rootfstype=squashfs init=/etc/preinit mtdparts=spi0.0:128k(factory-uboot),192k(u-boot),64k(ART),1536k(uImage),14464k@0x1e0000(rootfs) mem=128M
bootcmd=bootm 0x9f0c0000
bootdelay=1
baudrate=115200
ethaddr=0x00:0xaa:0xbb:0xcc:0xdd:0xee
ipaddr=192.168.0.2
serverip=192.168.0.10
dir=
lu=tftp 0x80060000 ${dir}tuboot.bin&&erase 0x9f000000 +$filesize&&cp.b $fileaddr 0x9f000000 $filesize
lf=tftp 0x80060000 ${dir}ap152${bc}-jffs2&&erase 0x9f010000 +$filesize&&cp.b $fileaddr 0x9f010000 $filesize
lk=tftp 0x80060000 ${dir}vmlinux${bc}.lzma.uImage&&erase 0x9f300000 +$filesize&&cp.b $fileaddr 0x9f300000 $filesize
stdin=serial
stdout=serial
stderr=serial
ethact=eth0

Why doesn't that work?

It boots also quite fine if i just enter 'boot' without any additional adress

I'm guessing it finds something wrong in the flash and determines that recovery is needed, so it launches the http server instead of booting. Maybe it is related to that "factory boot check" message. Have you tried going to the http server and recovering with stock firmware?

1 Like

I did this some days ago - I used the file from https://static.tp-link.com/2019/201908/20190816/Archer%20C7(EU)_V5_190726.zip and installed. The installation was processed fine from browser view, but device came up as model AC1900 (not Archer C7 anymore) afterwards, mean entire web interface etc.

Maybe that this was due to the problem with ART partition -> wrong device identification?

I gave a try but flashing via Web Recovery leads to failure :

U-Boot 1.1.4 (Mar  8 2018 - 16:34:18)

ap152 - Dragonfly 1.0

DRAM:  128 MB
Top of RAM usable for U-Boot at: 88000000
Reserving 413k for U-Boot at: 87f98000
Reserving 16448k for malloc() at: 86f88000
Reserving 44 Bytes for Board Info at: 86f87fd4
Reserving 36 Bytes for Global Data at: 86f87fb0
Reserving 128k for boot params() at: 86f67fb0
Stack Pointer at: 86f67f98
Now running in RAM - U-Boot at: 87f98000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16MB, sector count = 256
Flash: 16 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ath_gmac_enet_initialize...
Fetching MAC Address from 0x87fbafdc
ath_gmac_enet_initialize: reset mask:c02200
athr_mgmt_init ::done
Dragonfly  ----> S17 PHY *
athrs17_reg_init: complete
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x80000000 cfg2 0x7114
eth0: 00:00:2f:81:00:00
eth0 up
eth0
Setting 0x181162c0 to 0x264c2100
[NM_Error](nm_api_checkInteger) 00384: extra-para:cd a3


[NM_Error](nm_api_checkInteger) 00389: factory boot check integer flag is not 1.

Hit any key to stop autoboot:  0
Trying eth0
eth0 link down
FAIL
Trying eth0
dup 1 speed 1000
HTTP server is starting at IP: 192.168.0.1
HTTP server is ready!

Request for: /
Request for: /favicon.ico
## Error: request file name not suport!
Request for: /favicon.ico
## Error: request file name not suport!
Request for: /favicon.ico
## Error: request file name not suport!
Request for: /favicon.ico
## Error: request file name not suport!
Request for: /favicon.ico
## Error: request file name not suport!
Request for: /favicon.ico
## Error: request file name not suport!
Request for: /favicon.ico
## Error: request file name not suport!
Request for: /favicon.ico
## Error: request file name not suport!
Request for: /favicon.ico
## Error: request file name not suport!
Request for: /favicon.ico
## Error: request file name not suport!
Data will be downloaded at 0x80060000 in RAM
Upgrade type: firmware
Upload file size: 15567490 bytes
Loading: #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         ############

Firmware Recovery file length : 15567490

Firmware process id 2.

handle_fw_cloud 146

Image verify OK!

Firmware file Verify ok!

product-info:product_name:Archer C7
product_ver:5.0.0
special_id:55530000

[Error]sysmgr_cfg_checkSupportList(): 1023 @ specialId 45550000 NOT Match.

Firmware supports, check OK.

Firmware Recovery check ok!

upgrade_filecheck ok

I just took a look to this https://openwrt.org/toh/tp-link/archer-c5-c7-wdr7500#return_to_factory_firmware with is for V2

This is the binwalk for the latest stock firmware

peter@PetersVBox:~/work/Updates_TP_Link$ binwalk Archer\ C7\(EU\)_V5_190726.bin 

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
21876         0x5574          U-Boot version string, "U-Boot 1.1.4-g4480d5f9-dirty (May 20 2019 - 18:45:16)"
21940         0x55B4          CRC32 polynomial table, big endian
23232         0x5AC0          uImage header, header size: 64 bytes, header CRC: 0x386C2BD5, created: 2019-05-20 10:45:17, image size: 41162 bytes, Data Address: 0x80010000, Entry Point: 0x80010000, data CRC: 0xC9CD1E38, OS: Linux, CPU: MIPS, image type: Firmware Image, compression type: lzma, image name: "u-boot image"
23296         0x5B00          LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 97476 bytes
64968         0xFDC8          XML document, version: "1.0"
78448         0x13270         uImage header, header size: 64 bytes, header CRC: 0x78A267FF, created: 2019-07-26 07:46:14, image size: 1088500 bytes, Data Address: 0x80060000, Entry Point: 0x80060000, data CRC: 0xBB9D4F94, OS: Linux, CPU: MIPS, image type: Multi-File Image, compression type: lzma, image name: "MIPS OpenWrt Linux-3.3.8"
78520         0x132B8         LZMA compressed data, properties: 0x6D, dictionary size: 8388608 bytes, uncompressed size: 3164228 bytes
1167013       0x11CEA5        Squashfs filesystem, little endian, version 4.0, compression:xz, size: 14388306 bytes, 2541 inodes, blocksize: 65536 bytes, created: 2019-07-26 07:51:38
15555328      0xED5B00        gzip compressed data, from Unix, last modified: 2019-07-26 07:51:41