Which firmware should I flash with a programmer to chip?

I have TP-Link TL-WR942n. A chip on it is bricked.
I want to flash OpenWRT. There are 2 images:
factory: https://4pda.to/stat/go?u=https%3A%2F%2Fdownloads.openwrt.org%2Freleases%2F19.07.8%2Ftargets%2Far71xx%2Fgeneric%2Fopenwrt-19.07.8-ar71xx-generic-tl-wr942n-v1-squashfs-factory.bin&e=112422744
sysupgrade: https://4pda.to/stat/go?u=https%3A%2F%2Fdownloads.openwrt.org%2Freleases%2F19.07.8%2Ftargets%2Far71xx%2Fgeneric%2Fopenwrt-19.07.8-ar71xx-generic-tl-wr942n-v1-squashfs-sysupgrade.bin&e=112422744

A chip on my router is W25Q128FV (16MB).

The firmwares above are 4.1-4.2 MB.

The original stock firmware on official website is 11.1 MB.
Another stock firmware (but not on official site) is 3.5 MB, but its name lede-ar71xx-generic-tl-wr942n-v1-squashfs-factory.bin.

If I want to install OpenWRT with a programmer, should I use the factory image (by link I provided above)?

I would say so.
The factory file is a binary image, so also meant to be flashed with a chip programmer. The sysupgrade file contains separate partition files which can only be managed by an OpenWrt script (meant to be dd-ed or mtd-ed for example).

Unless you have a specific need of 19.07.8, there is a more recent version 19.07.10
https://firmware-selector.openwrt.org/?version=19.07.10&target=ar71xx%2Fgeneric&id=tl-wr942n-v1

Neither the OEM- nor OpenWrt's factory firmware images are sufficient for flashing with an external spi-nor programmer. In (almost) all cases, there are additional absolutely vital partitions on the device (bootloader, bootloader environment, wireless calibration data, various OEM data) that is not part of downloadable firmware images and non-recoverable (unless you have backups from your own device).

4 Likes

The sysupgrade file is an image of what should be in that partition of flash. Do not use the factory file as it has headers (which are removed as the stock firmware installs the firmware) in addition to the kernel and filesystem image.

But as @slh said, that is only one partition and to rebuild a completely blank or corrupted flash chip, you need to get the bootloader and calibration data images from somewhere else. The calibration data is unit specific and only exists in the flash chip, so if that has been clobbered you really can't recover.

If you have the bootloader in flash and firmware from the Internet and the ART calibration on your hard disk, you can install everything with a serial connection. Assuming the WR942 is a typical Atheros TP-Link. I could not find much detail about that model.

2 Likes

Thanks guys, I got

Indeed guys, the answer is more tricky than I thought.