I have a TP-Link Archer C7 v1.0, and I can run OpenWRT v15.05.x. However, I cannot seem to restore the stock TP-link firmware nor can I boot any newer OpenWRT version.
Stock firmware problem
I downloaded the latest (Archer C7_V1_141204_US) firmware, extracted the bin file and renamed it so it would get picked up by the TFTP client. In the serial console I can see the download succeed, but then it doesn't appear to erase and program the flash. Instead it appears to reboot (crash?):
U-Boot 1.1.4 (Jun 25 2014 - 17:27:33)
ap135 - Scorpion 1.0DRAM:
sri
Scorpion 1.0
ath_ddr_initial_config(178): (32bit) ddr2 init
tap = 0x00000003
Tap (low, high) = (0x4, 0x1f)
Tap values = (0x11, 0x11, 0x11, 0x11)
128 MB
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x17
flash size 8MB, sector count = 128
Flash: 8 MB
Using default environment
*** Warning *** : PCIe WLAN Module not found !!!
In: serial
Out: serial
Err: serial
Net: ath_gmac_enet_initialize...
athrs_sgmii_res_cal: cal value = 0xe
No valid address in Flash. Using fixed address
No valid address in Flash. Using fixed address
ath_gmac_enet_initialize: reset mask:c02200
Scorpion ----> S17 PHY *
athrs17_reg_init: complete
: cfg1 0x80000000 cfg2 0x7114
eth0: ba:be:fa:ce:08:41
eth0 up
athrs17_reg_init_wan done
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x800c0000 cfg2 0x7214
eth1: ba:be:fa:ce:08:41
eth1 up
eth0, eth1
Setting 0x18116290 to 0x50a1214f
dup 1 speed 1000
Using eth1 device
TFTP from server 192.168.1.66; our IP address is 192.168.1.86
Filename 'ArcherC7v1_tp_recovery.bin'.
Load address: 0x80060000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#########################################
done
Bytes transferred = 8192512 (7d0200 hex)
original_product_id = 75000001
original_product_ver = 01
recovery_product_id = 75000001
recovery_product_ver = 01
auto update firmware: product id verify sucess!
Firmware recovery: product id verify sucess!
Firmware recovery: FLASH_SIZE = 8 filesize = 0x7d0200.
U-Boot 1.1.4 (Jun 25 2014 - 17:27:33)
... (previously flashed OpenWRT begins to boot here) ...
Strangely, if I truncate the file (it appears to be padded anyway) to the same size as the OpenWRT -factory bin file via truncate -s 8126464 ArcherC7v1_tp_recovery.bin
and run the TFTP recovery again it does erase and program the flash. Unfortunately, it then fails to boot:
U-Boot 1.1.4 (Jun 25 2014 - 17:27:33)
ap135 - Scorpion 1.0DRAM:
sri
Scorpion 1.0
ath_ddr_initial_config(178): (32bit) ddr2 init
tap = 0x00000003
Tap (low, high) = (0x4, 0x1f)
Tap values = (0x11, 0x11, 0x11, 0x11)
128 MB
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x17
flash size 8MB, sector count = 128
Flash: 8 MB
Using default environment
*** Warning *** : PCIe WLAN Module not found !!!
In: serial
Out: serial
Err: serial
Net: ath_gmac_enet_initialize...
athrs_sgmii_res_cal: cal value = 0xe
No valid address in Flash. Using fixed address
No valid address in Flash. Using fixed address
ath_gmac_enet_initialize: reset mask:c02200
Scorpion ----> S17 PHY *
athrs17_reg_init: complete
: cfg1 0x80000000 cfg2 0x7114
eth0: ba:be:fa:ce:08:41
eth0 up
athrs17_reg_init_wan done
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x800c0000 cfg2 0x7214
eth1: ba:be:fa:ce:08:41
eth1 up
eth0, eth1
Setting 0x18116290 to 0x50a1214f
dup 1 speed 1000
Using eth1 device
TFTP from server 192.168.1.66; our IP address is 192.168.1.86
Filename 'ArcherC7v1_tp_recovery.bin'.
Load address: 0x80060000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
############################
done
Bytes transferred = 8126464 (7c0000 hex)
original_product_id = 75000001
original_product_ver = 01
recovery_product_id = 75000001
recovery_product_ver = 01
auto update firmware: product id verify sucess!
Firmware recovery: product id verify sucess!
Firmware recovery: FLASH_SIZE = 8 filesize = 0x7c0000.
Erasing flash...
First 0x2 last 0x7d sector size 0x10000
125
Erased 124 sectors
Copy to Flash... write addr: 9f020000
done
U-Boot 1.1.4 (Jun 25 2014 - 17:27:33)
ap135 - Scorpion 1.0DRAM:
sri
Scorpion 1.0
ath_ddr_initial_config(178): (32bit) ddr2 init
tap = 0x00000003
Tap (low, high) = (0x4, 0x1f)
Tap values = (0x11, 0x11, 0x11, 0x11)
128 MB
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x17
flash size 8MB, sector count = 128
Flash: 8 MB
Using default environment
*** Warning *** : PCIe WLAN Module not found !!!
In: serial
Out: serial
Err: serial
Net: ath_gmac_enet_initialize...
athrs_sgmii_res_cal: cal value = 0xe
No valid address in Flash. Using fixed address
No valid address in Flash. Using fixed address
ath_gmac_enet_initialize: reset mask:c02200
Scorpion ----> S17 PHY *
athrs17_reg_init: complete
: cfg1 0x80000000 cfg2 0x7114
eth0: ba:be:fa:ce:08:41
eth0 up
athrs17_reg_init_wan done
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x800c0000 cfg2 0x7214
eth1: ba:be:fa:ce:08:41
eth1 up
eth0, eth1
Setting 0x18116290 to 0x50a1214f
Autobooting in 1 seconds
## Booting image at 9f020000 ...
Uncompressing Kernel Image ... Too big uncompressed streamLZMA ERROR 1 - must RESET board to recover
U-Boot 1.1.4 (Jun 25 2014 - 17:27:33)
... (repeats forever) ...
Upgrade OpenWRT problem
It seems like there's something wrong with the ath10k_pci
(ath10k_core
?) module for this hardware in the newer versions of OpenWRT. Here's the last thing I see when trying to boot them:
[ 10.584069] PCI: Enabling device 0000:01:00.0 (0000 -> 0002)
[ 10.589963] ath10k_pci 0000:01:00.0: pci irq legacy oper_irq_mode 1 irq_mode 0 reset_mode 0
[ 10.648991] Data bus error, epc == 8756a460, ra == 8756a460
[ 10.654646] Oops[#1]:
[ 10.656956] CPU: 0 PID: 500 Comm: kmodloader Not tainted 4.4.92 #0
[ 10.663218] task: 87d79e30 ti: 87fd6000 task.ti: 87fd6000
[ 10.668688] $ 0 : 00000000 80440000 deadc0de 00000000
[ 10.674020] $ 4 : b2009030 00009030 00000196 00009034
[ 10.679352] $ 8 : 00000010 800650a0 00000000 6f646520
[ 10.684685] $12 : 00000000 ffffff80 00000000 65203120
[ 10.690019] $16 : 00009030 874b9460 00000000 803d0000
[ 10.695351] $20 : ffff901e ffffffff 00000001 80370040
[ 10.700684] $24 : 803cc034 8756a3dc
[ 10.706016] $28 : 87fd6000 87fd7b38 00000000 8756a460
[ 10.711350] Hi : 00000196
[ 10.714271] Lo : 2a840000
[ 10.717191] epc : 8756a460 0x8756a460 [ath10k_pci@87568000+0x6dd0]
[ 10.723632] ra : 8756a460 0x8756a460 [ath10k_pci@87568000+0x6dd0]
[ 10.730067] Status: 1100fc03 KERNEL EXL IE
[ 10.734337] Cause : 0080001c (ExcCode 07)
[ 10.738403] PrId : 00019750 (MIPS 74Kc)
[ 10.742378] Modules linked in: ath10k_pci(+) ath10k_core ath mac80211 cfg80211 compat ledtrig_usbport ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables x_tables ehci_platform ehci_hcd gpio_button_hotplug usbcore nls_base usb_common
[ 10.767403] Process kmodloader (pid: 500, threadinfo=87fd6000, task=87d79e30, tls=7717dd48)
[ 10.775861] Stack : 87fd6000 87fd7b60 00000000 8756b7cc 1100fc03 00000196 2a840000 874b9460
00000000 8756b744 80370040 8756b518 874b9460 874b9460 874b9460 874b9460
8756e4bc 8756e49c 87570000 87cec068 8756db78 8756b9ac 87cec000 801fc624
875bd780 8756ac64 803e00c8 00000001 874b9460 8756bb74 874b9460 800aa470
00000040 8758bf68 00000000 874b9460 874b9460 87570000 874b9460 00000000
...
[ 10.812188] Call Trace:[<8756b7cc>] 0x8756b7cc [ath10k_pci@87568000+0x6dd0]
[ 10.819263] [<8756b744>] 0x8756b744 [ath10k_pci@87568000+0x6dd0]
[ 10.825351] [<8756b518>] 0x8756b518 [ath10k_pci@87568000+0x6dd0]
[ 10.831444] [<8756b9ac>] 0x8756b9ac [ath10k_pci@87568000+0x6dd0]
[ 10.837536] [<801fc624>] 0x801fc624
[ 10.841077] [<8756ac64>] 0x8756ac64 [ath10k_pci@87568000+0x6dd0]
[ 10.847166] [<8756bb74>] 0x8756bb74 [ath10k_pci@87568000+0x6dd0]
[ 10.853252] [<800aa470>] 0x800aa470
[ 10.856793] [<8758bf68>] 0x8758bf68 [ath10k_core@87580000+0x3c2b0]
[ 10.863062] [<8756c314>] 0x8756c314 [ath10k_pci@87568000+0x6dd0]
[ 10.869154] [<801fbbbc>] 0x801fbbbc
[ 10.872694] [<801d9194>] 0x801d9194
[ 10.876229] [<801ff6d4>] 0x801ff6d4
[ 10.879770] [<801ffcf4>] 0x801ffcf4
[ 10.883304] [<800e604c>] 0x800e604c
[ 10.886845] [<801ffed0>] 0x801ffed0
[ 10.890379] [<801fe11c>] 0x801fe11c
[ 10.893918] [<801ffe54>] 0x801ffe54
[ 10.897453] [<801fe1d8>] 0x801fe1d8
[ 10.900992] [<8035e4bc>] 0x8035e4bc
[ 10.904533] [<8756f000>] 0x8756f000 [ath10k_pci@87568000+0x6dd0]
[ 10.910619] [<801fdfac>] 0x801fdfac
[ 10.914160] [<801ff404>] 0x801ff404
[ 10.917694] [<8009baa0>] 0x8009baa0
[ 10.921238] [<8756f000>] 0x8756f000 [ath10k_pci@87568000+0x6dd0]
[ 10.927322] [<802005e8>] 0x802005e8
[ 10.930866] [<8756f000>] 0x8756f000 [ath10k_pci@87568000+0x6dd0]
[ 10.936960] [<8756f02c>] 0x8756f02c [ath10k_pci@87568000+0x6dd0]
[ 10.943048] [<80069c7c>] 0x80069c7c
[ 10.946585] [<800a1d24>] 0x800a1d24
[ 10.950122] [<80092ab8>] 0x80092ab8
[ 10.953661] [<800909d8>] 0x800909d8
[ 10.957200] [<800904c8>] 0x800904c8
[ 10.960740] [<800c3558>] 0x800c3558
[ 10.964273] [<800f992c>] 0x800f992c
[ 10.967812] [<800c4a08>] 0x800c4a08
[ 10.971350] [<800c2bfc>] 0x800c2bfc
[ 10.974888] [<800f9e08>] 0x800f9e08
[ 10.978424] [<800f2e3c>] 0x800f2e3c
[ 10.981962] [<800c4c04>] 0x800c4c04
[ 10.985499] [<800c4ca0>] 0x800c4ca0
[ 10.989041] [<80062c6c>] 0x80062c6c
[ 10.992577]
[ 10.994084]
Code: 8e243b84 0c071ef2 00902021 <00408021> 92223e45 10400004 02001021 0dd5a6ed 02202021
[ 11.004239] ---[ end trace 804bc45f84034d1a ]---
[ 11.010486] Fatal exception: panic in 5 seconds
Typical TFTP "recovery" session to load firmware
U-Boot 1.1.4 (Jun 25 2014 - 17:27:33)
ap135 - Scorpion 1.0DRAM:
sri
Scorpion 1.0
ath_ddr_initial_config(178): (32bit) ddr2 init
tap = 0x00000003
Tap (low, high) = (0x4, 0x1f)
Tap values = (0x11, 0x11, 0x11, 0x11)
128 MB
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x17
flash size 8MB, sector count = 128
Flash: 8 MB
Using default environment
*** Warning *** : PCIe WLAN Module not found !!!
In: serial
Out: serial
Err: serial
Net: ath_gmac_enet_initialize...
athrs_sgmii_res_cal: cal value = 0xe
No valid address in Flash. Using fixed address
No valid address in Flash. Using fixed address
ath_gmac_enet_initialize: reset mask:c02200
Scorpion ----> S17 PHY *
athrs17_reg_init: complete
: cfg1 0x80000000 cfg2 0x7114
eth0: ba:be:fa:ce:08:41
eth0 up
athrs17_reg_init_wan done
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x800c0000 cfg2 0x7214
eth1: ba:be:fa:ce:08:41
eth1 up
eth0, eth1
Setting 0x18116290 to 0x50a1214f
dup 1 speed 1000
Using eth1 device
TFTP from server 192.168.1.66; our IP address is 192.168.1.86
Filename 'ArcherC7v1_tp_recovery.bin'.
Load address: 0x80060000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
############################
done
Bytes transferred = 8126464 (7c0000 hex)
original_product_id = 75000001
original_product_ver = 01
recovery_product_id = 75000001
recovery_product_ver = 01
auto update firmware: product id verify sucess!
Firmware recovery: product id verify sucess!
Firmware recovery: FLASH_SIZE = 8 filesize = 0x7c0000.
Erasing flash...
First 0x2 last 0x7d sector size 0x10000
125
Erased 124 sectors
Copy to Flash... write addr: 9f020000