OpenWrt Forum Archive

Topic: TP-Link TL-WR703N Reverse Engineering

The content of this topic has been archived between 22 Mar 2018 and 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

IANAL, but I don't see anything illegal here: if it is true that a chip layout may be copyrighted, it is not true for a PCB layout.

Recreating a PCB in CAD is not a trivial task, even less reconstructing the schematic out of it, so it is not a simple copy of an existing work. As long as you don't copy copyrighted logo or trademarks, it doesn't infringe any copyrighted material. And at least in my part of the World, reverse-engineering is legal when used for improving interoperability, which is the case here as we seek to interface the router with external devices.

Back to technical stuff: regarding RF, there are 2 different problems:

  1. Component calibration in function of the PCB layout and characteristics, which requires a Vector Network Analyzer at least to find out the exact values for the different components present in the RF matching networks. However, the topology used in the TL-WR703N is rather standard for WiFi, with separate differential RX/TX path, so we should be able to find documentation on this calibration process. This needs to be performed only once in a lab

  2. Production tuning, which is the purpose of the "ART" RF tuning. I agree that bypassing the ART in-manufacturing RF calibration is not a trivial task without having access to the original software. But if we can gather enough information on what it exactly consists in, then this may be possible. From a manufacturing point of view, it usually requires just a simple spectrum analyzer in pass/fail mode and an assembly-line small Faraday cage, which is not uncommon. For small prototype batches, a small/cheap SDR USB dongle and a tin box might prove sufficient

Now for the price: the figures given by ZoomZoomLuke above should indicate that this might not be out of our reach...

Of course, it will be difficult to compete with the TP-Link manufacturing price and their high-volume production: my guess, given the volumes is that the BOM cost is probably < $10 with packaging. Everything above that is just due to intermediate, shipping, etc. up to the $23 retail price on eBay.

With a rough fully-assembled prototype cost of $50 and a fully-assembled cost of $25/100 pieces, I think it is still a reasonable price for a device which will feature plenty of extension capabilities for hacking...

Just compare it to a $20 Arduino Pro board, or to a $35 Raspberry Pi... The closest match is the $22 Carambola board, but it is not open-hardware.

from the beginning,  to compete with the wr703n,  can we  get more functions?

lan port ?
gpio ?
spi ?
jtag?

for me, just one more lan port is required.

My 2 cents:

I lean toward not wanting to reinvent the wheel so to speak. Most of my 703's have a 8MB flash upgrade and that is enough. The USB2 requirement due to the Atheros defect is a problem that shouldn't be. I have found a USB2 4 port passive hub that fits nearly exacty the form factor of the 703 case and can be attacted to the bottom of it.

If I were given a wad of cash and told to improve the 703 without altering the factory box, I would:

1) Contact Atheros and apply pressure to fix the USB problem
2) Design a custom "USB2 hub plus" that is in a similar case that may be attached under the existing box and implements the added hardware requests through the USB interface including things like NICs and GPIO.
3) Ask TP-Link increase the size of the flash at the factory if they ever retool the product. The price differential between 4MB and 8MB flash is very small.
4) Setup a distributorship to purchase directly from TP-Link and resell to us at cost. I Estimate that the wr703n cost from the factory in bulk to be around 9 USD. This would need to be in China as the 703 isn't really certified for exports as I understand.

(Last edited by perazim on 25 Dec 2012, 16:36)

perazim--can you provide a link for your USB2 4 port passive hub?

I would like to see gpios available.

(Last edited by lizby on 25 Dec 2012, 18:28)

I made some bad experience using USB devices on my wr1043. What I did was connect a USB-I2C converter and connect it to an I2C-GPIO expander. Also, I made use of an external flash drive, all at a passive USB hub - since this seemed to be the only usable way with those Atheros SoC. This all works quite good for a certain amount of time - somehow between a few days and a few weeks. But somehow randomly I either get just a plain USB disconnect message on dmesg, or one that states some EMI problems. The result is, that all USB devices get newly detected, while the old ones are still locked. So, when calling mount, it shows up sda1, sdb1, sdc1,... although just the last one would really be present. The same with the exported GPIOs, which still somehow exist in sysfs.
So, in conclusion, I would not recommend to go the USB way to get GPIOs or more disk space. Better have as much of the native SoC IOs exposed and maybe go from there with SPI, I2C and SD/MMC.

Unfortunately, the AR9331 SoC used in the TL-WR703N router alerady uses the SPI bus for Flash memory (it is still possible to connect other devices on the same bus, but it is quite tricky since you will have to restore the bus as soon as the system is trying to access Flash memory) and does not feature any native I2C interface (only I2S, but that is absolutely not the same thing), nor SD/MMC interface sad

The only possibilities left are to use the few available GPIOs and I2C bit-banging, or to rely on USB with periodic system reboots or just USB power cycling.

I have a TL-WR702N and i just upgrade the flash and mem + flashed with TL-WR703N openwrt Firmware + Uboot. Everything work but the wifi is NOT working :'(

Can someone please send me their MTD4 ("ART") and MTD0("Boot loader") backup file  please please!! sad

There are command to backup:
cat /dev/mtd4 > /tmp/backup_art.bin
cat /dev/mtd0 > /tmp/backup_u-boot.bin

then copy bin file from tmp dir on router in your computer via WinSCP.

Thank you very much!!!

Sorry for thread jacking guy

(Last edited by b18vtecturbo on 26 Dec 2012, 13:49)

the ART partition is device-specific, you can't just copy it from one 703 to another.

I would say that just the MAC is the device specific part of the ART (and should be cleared when giving that data to anyone else).

I have several 703's that I upgraded to 8MB flash and I can certify that the ART partitions are different, device to device. I checked this before I went to the trouble of individually backing them up and restoring to new flash.

MBS wrote:

I would say that just the MAC is the device specific part of the ART (and should be cleared when giving that data to anyone else).

The ART partition contains device-specific RF information, but NOT the MAC address, which is stored in the uboot partition.

Thus, both partitions are device-specific, although the uboot one is easy to customize using an hex editor.

Squonk wrote:
MBS wrote:

I would say that just the MAC is the device specific part of the ART (and should be cleared when giving that data to anyone else).

The ART partition contains device-specific RF information, but NOT the MAC address, which is stored in the uboot partition.

Thus, both partitions are device-specific, although the uboot one is easy to customize using an hex editor.

I have a TL-WR702N It have 2MB flash(stock) I replaced the flash chip with 8MB flash+ add USB port.
The TL-WR702N used a different bootloader and partition table I think.
Will the art partition still located 64kb at the end?

Here is my flash dump: https://www.dropbox.com/s/qfqe8zsy169a5 … -stock.bin

For U-boot I need the 1kb config at the end of uboot. Can you tell me how to customize using an hex editor?

Thank you for all your help!

b18vtecturbo wrote:
Squonk wrote:
MBS wrote:

I would say that just the MAC is the device specific part of the ART (and should be cleared when giving that data to anyone else).

The ART partition contains device-specific RF information, but NOT the MAC address, which is stored in the uboot partition.

Thus, both partitions are device-specific, although the uboot one is easy to customize using an hex editor.

I have a TL-WR702N It have 2MB flash(stock) I replaced the flash chip with 8MB flash+ add USB port.
The TL-WR702N used a different bootloader and partition table I think.
Will the art partition still located 64kb at the end?

Here is my flash dump: https://www.dropbox.com/s/qfqe8zsy169a5 … -stock.bin

For U-boot I need the 1kb config at the end of uboot. Can you tell me how to customize using an hex editor?

Thank you for all your help!

This is your art.bin https://www.dropbox.com/s/qtvf2u3ngj4xef4/702_art.bin

You can write to art partition but first make your art partition write enable.

xopal wrote:
b18vtecturbo wrote:
Squonk wrote:

The ART partition contains device-specific RF information, but NOT the MAC address, which is stored in the uboot partition.

Thus, both partitions are device-specific, although the uboot one is easy to customize using an hex editor.

I have a TL-WR702N It have 2MB flash(stock) I replaced the flash chip with 8MB flash+ add USB port.
The TL-WR702N used a different bootloader and partition table I think.
Will the art partition still located 64kb at the end?

Here is my flash dump: https://www.dropbox.com/s/qfqe8zsy169a5 … -stock.bin

For U-boot I need the 1kb config at the end of uboot. Can you tell me how to customize using an hex editor?

Thank you for all your help!

This is your art.bin https://www.dropbox.com/s/qtvf2u3ngj4xef4/702_art.bin

You can write to art partition but first make your art partition write enable.

I flashed that into art using "mtd write 702_art.bin art" all went well and wifi is now show up but i can't enable it sad
But after reboot i try "wifi detect" it return nothing sad

here is my boot log: http://pastebin.com/yAvsy8qS

Could it be cause by missing uboot configuration?

do you mind send me your 703 flash dump? It will help me alot

(Last edited by b18vtecturbo on 27 Dec 2012, 02:24)

@b18vtecturbo

I look to your flash dump file and found  uboot size is 256 KiB and I can't locate the mac address  by the way 256 KiB uboot is something new for me.

If you like you can try custom uboot for 703 here

Here is my previous 8MB rom template for 3020

https://www.dropbox.com/s/7s8y0oi58v7s0 … edited.bin


1FC00 MAC address

1FD00 router type

1FE00 router PIN number

ART partition start at 7F0000

(Last edited by xopal on 27 Dec 2012, 11:34)

xopal wrote:

@b18vtecturbo

I look to your flash dump file and found  uboot size is 256 KiB and I can't locate the mac address  by the way 256 KiB uboot is something new for me.

If you like you can try custom uboot for 703 here

Here is my previous 8MB rom template for 3020

https://www.dropbox.com/s/7s8y0oi58v7s0 … edited.bin


1FC00 MAC address

1FD00 router type

1FE00 router PIN number

ART partition start at 7F0000

Thank you I will try it now

and for 1FD00 router type what is it represent?

(Last edited by b18vtecturbo on 28 Dec 2012, 00:42)

Thank everyone! I successfully run Openwrt + wifi running on my TL-WR702N. It turn out that the ram is not enough 16MB i upgraded to 32MB.

Page 255 of the datasheet talks about USBMode and the Stream Disable Mode. By default the  Stream Disable Mode is inactive.  It appears that if it is made active - then overruns/underruns of the latency FIFO are eliminated for low bandwidth systems.

May be worth trying to set that bit  4 to "1".

Ashok



Squonk wrote:
ultramancool wrote:

In case anyone is interested, I found a copy of the datasheet on a chinese website.

http://ishare.sina.cn/dintro.php?id=34775768

ultramancool, you are my hero!!!

Thank you for sharing!

Carambola2 will be released next month running AR9331.
Specs:

  • 16MB flash

  • 64MB RAM

  • 2x Ethernet

  • WiFi +21 dBm b/g/n

  • Serial port

  • USB host/slave

  • SPI

  • 23x GPIO

http://www.8devices.com/ly4bx/cara_2_1.jpg

PDF with motherboard schematic available here.


Now what about other drivers, that are not available in OpenWRT. E.g. I'm really interested in I2S driver.

Scrts wrote:

Carambola2 will be released next month running AR9331.

Any information regarding its price?

There are equivalent modules on TaoBao for 150 Yuans ($24) per unit.

time to start anew thread?

Scrts wrote:

Carambola2 will be released next month running AR9331.
Specs:

  • WiFi +21 dBm b/g/n

More info or detail about this?