Modify

Opened 4 years ago

Closed 3 years ago

Last modified 22 months ago

#12026 closed enhancement (fixed)

Add support for TL-MR3220v2

Reported by: RalfFriedl Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: base system Version: Trunk
Keywords: mr3220v2 Cc:

Description

TP-Link has a new version of the MR3220, the MR3220 V2.

Attachments (10)

MR3220V2_T.jpg (302.7 KB) - added by RalfFriedl 4 years ago.
MR3200V2B600.jpg (701.7 KB) - added by RalfFriedl 4 years ago.
MR3200V2T600A.jpg (870.8 KB) - added by RalfFriedl 4 years ago.
Kconfig.diff (384 bytes) - added by anonymous 3 years ago.
build_dir/linux-ar71xx_generic_uClibc-0.9.33.2/linux-3.3.8/arch/mips/ath79/Kconfig
mach-tl-wr741nd-v4.diff (716 bytes) - added by anonymous 3 years ago.
build_dir/linux-ar71xx_generic_uClibc-0.9.33.2/linux-3.3.8/arch/mips/ath79/mach-tl-wr741nd-v4.c
Makefile.diff (3.6 KB) - added by anonymous 3 years ago.
target/linux/ar71xx/image/Makefile
mktplinkfw.diff (1.1 KB) - added by anonymous 3 years ago.
tools/firmware-utils/src/mktplinkfw.c
network.diff (300 bytes) - added by anonymous 3 years ago.
target/linux/ar71xx/base-files/etc/uci-defaults/network
Makefile.2.diff (2.2 KB) - added by anonymous 3 years ago.
package/network/utils/iptables/Makefile for qos support
include_linux_netfilter_ipv4_ip_queue.h (2.3 KB) - added by anonymous 3 years ago.
necessary for qos in linux 3.6

Download all attachments as: .zip

Change History (48)

comment:1 follow-up: Changed 4 years ago by RalfFriedl

As a first step this patch adds support to mktplinkfw:

  • mktplinkfw.c

     
    3232#define HEADER_VERSION_V1      0x01000000 
    3333#define HWID_TL_MR3020_V1      0x30200001 
    3434#define HWID_TL_MR3220_V1      0x32200001 
     35#define HWID_TL_MR3220_V2      0x32200002 
    3536#define HWID_TL_MR3420_V1      0x34200001 
    3637#define HWID_TL_WA701N_V1      0x07010001 
    3738#define HWID_TL_WA901ND_V1     0x09010001 
     
    188189               .hw_rev         = 1, 
    189190               .layout_id      = "4M", 
    190191       }, { 
     192               .id             = "TL-MR3220v2", 
     193               .hw_id          = HWID_TL_MR3220_V2, 
     194               .hw_rev         = 1, 
     195               .layout_id      = "4M", 
     196       }, { 
    191197               .id             = "TL-MR3420v1", 
    192198               .hw_id          = HWID_TL_MR3420_V1, 
    193199               .hw_rev         = 1, 

comment:2 in reply to: ↑ 1 ; follow-up: Changed 4 years ago by anonymous

RalfFriedl

New devices MR3420v2/MR3220v2 is AP121 platform you have considered this?

comment:3 in reply to: ↑ 2 ; follow-up: Changed 4 years ago by RalfFriedl

Replying to anonymous:
No, I haven't considered this. I just flashed the firmware for v1 onto the device and it no longer works. I have not yet connected a serial cable.

But the patch above was sufficient to get the firmware to the device.

What do I have to do to get a working firmware? Is it enough to select CONFIG_TARGET_ar71xx_generic_AP121?

comment:4 in reply to: ↑ 3 Changed 4 years ago by Nilfred <nilfred@…>

Replying to RalfFriedl:

I just flashed the firmware for v1 onto the device and it no longer works.
What do I have to do to get a working firmware? Is it enough to select CONFIG_TARGET_ar71xx_generic_AP121?

Try flash TL-WR741ND v4.x firmware, should work without USB.

comment:5 follow-up: Changed 4 years ago by anonymous

Nilfred
Before giving such advice, you need to know the exact size of flash memory.
For example: I do not know what size of flash memory data routers. If 4MB - the loader size 128kb if 8MB - the loader size 256kb. So what advice can result in damage to the router (erase half of the bootloader).

RalfFriedl
Please tell us the name of the chip flash memory if you do not know concretely the size. Also it would be good that you post photos of your PCB devices on wiki resource openwrt. This would help you in further to recovery also for many people in your situation. Together we define the UART port for recovery console.

comment:6 Changed 4 years ago by RalfFriedl

Current Firmware from TP-LINK
http://www.tp-link.com.au/Resources/software/TL-MR3220_V2_120703.zip

GPL Sources
http://www.tp-link.com/resources/gpl/150Router.tar

The size of the firmware is the same as the V1 firmware, so it is also a 4MB model.

This is the begining of the kernel in the original firmware, so I suppose that means that the kernel is LZMA compressed. At least it looks more similar to the LZMA kernel that openwrt creates for the WR741ND v4 than to the MR3220V1 kernel the was a normal gzip file.

0000  5d 00 00 00 02 44 81 27  00 00 00 00 00 00 00 6f  ]....D.' .......o
0010  fd ff ff a3 b7 7f 63 c5  55 7e bc 4d 37 52 96 27  ......c. U~.M7R.'
0020  37 85 77 0a 76 7c 9c ea  33 4a 4b eb b9 9b 7a 11  7.w.v|.. 3JK...z.
0030  fb ce b9 aa a4 90 b9 74  72 ab 50 51 06 2f 6e 57  .......t r.PQ./nW
0040  42 85 14 3b 63 d4 7c e9  c2 20 fb dc 1f 11 83 d4  B..;c.|. . ......

The means that unless there is support for GZIP in the new boot loader, it can't even decompress the kernel. This is consistent with the LEDs: First one LED on the left is on for about one second, the all LEDs for about one second, then this repeats. I think that is so short that it didn't even start the kernel.
LZMA support is good news, I tried to add LZMA decompression to the kernel, but so far without success.

I added this line to build a LZMA compressed V2 firmware. With this a file openwrt-ar71xx-generic-tl-mr3220-v2-squashfs-factory.bin was created.

  • target/linux/ar71xx/image/Makefile

     
    904904tlmr3220_cmdline=board=TL-MR3220 console=ttyS0,115200 
    905905define Image/Build/Profile/TLMR3220 
    906906       $(call Image/Build/Template/$(fs_64kraw)/$(1),TPLINK,tl-mr3220-v1,$(tlmr3220_cmdline),0x32200001,1,4M) 
     907       $(call Image/Build/Template/$(fs_64kraw)/$(1),TPLINK-LZMA,tl-mr3220-v2,$(tlmr3220_cmdline),0x32200002,1,4Mlzma) 
    907908endef 
    908909 
    909910tlmr3420_cmdline=board=TL-MR3420 console=ttyS0,115200 

I will make photos and attach a serial console, but I must find that time for that.

Changed 4 years ago by RalfFriedl

comment:7 Changed 4 years ago by RalfFriedl

This is a photo of the top side.

There is an area that looks like a serial console is at the top left. But I didn't get any output from there so far.

I saw this page and it says "serial: unfriendly". What does that mean?

comment:8 Changed 4 years ago by RalfFriedl

Note:
In the Wiki in the table at TP-Link TL-MR3220 v2 & TL-MR3420 v2 either the headers or the WLAN features are swapped. Probably because the table was copied from TP-Link TL-MR3420, TL-MR3220, ..., where the MR3420 comes first.

The MR3220v2 has a Zentel A3S56D40FTP -G5 chip, same as the MR3220v1.2.

comment:9 in reply to: ↑ 5 ; follow-up: Changed 4 years ago by Nilfred <nilfred@…>

Replying to anonymous:

Before giving such advice, you need to know the exact size of flash memory.

I did check against OEM firmware size.

"serial: unfriendly" means: even if you connect the right cables to the right headers it will not work.

I did copy Wiki from AP99 to AP121. There are a few others AP121: 11, 700, 702, 703, 710, 741v4, 800, 3020, 3040. Will try to glue together on the same wiki page ;)

Do the AR3341 belongs to AP121? Where should I find that relationship?

comment:10 in reply to: ↑ 9 Changed 4 years ago by RalfFriedl

Replying to Nilfred <nilfred@…>:

"serial: unfriendly" means: even if you connect the right cables to the right headers it will not work.

So that means you already have a MR3220V2, or is this the same for all AP121?

I measured the voltage at the connector. The PINs 3 and 4 have 0V and 3,3V as expected. PIN 2 seems to be also fixed at 0V, while PIN 1 seems to be not at all connected, it doesn't have any voltage against any of the others.

Do you have an idea how to recover such a device?

comment:11 follow-ups: Changed 4 years ago by anonymous

Nilfred

AR933X - AP121

AR934X - DB120

RalfFriedl

What name on CPU in your device - AR933X or AR934X?

Try to connect via UART as recommended - with 10k resistor for most TP-Link's

comment:12 in reply to: ↑ 11 ; follow-up: Changed 4 years ago by RalfFriedl

Replying to anonymous:

What name on CPU in your device - AR933X or AR934X?

AR9331-Al1A

comment:13 in reply to: ↑ 12 Changed 4 years ago by RalfFriedl

That should have been a capital 'L':
AR9331-AL1A

comment:14 in reply to: ↑ 11 Changed 4 years ago by RalfFriedl

Replying to anonymous:

Try to connect via UART as recommended - with 10k resistor for most TP-Link's

I was able to recover the MR3220V1.2 even without the resistor. The output from the device to the computer gets a little mangled sometimes, but it is readable. I suppose TX means transmit as seen from the device to the computer. The other direction, RX device from computer worked without problems.

With the MR3220V2 I don't get anything on the serial line, not even some garbage. Also the RX side doesn't seem to work. I used "yes tpl" to stop the boot process (as I do it on the V1.2), but that had no effect, so either it has a different password or the RX side is also not connected.

So this is much worse than the "unfriendly" of the V1.2.

comment:15 Changed 4 years ago by Nilfred <nilfred@…>

TL-MR3220v1.2 has the most "friendly" one. Here are examples of most "unfriendly" ones:
http://wiki.openwrt.org/_media/toh/tp-link/serialcon.jpg
WR743ND Serial Connector Pinout NOTE: Solder the bridges marked with red bars.

http://wiki.openwrt.org/_media/toh/tp-link/tl-wr740n-serial.jpgWR740N

http://wiki.openwrt.org/_media/toh/tp-link/tl-wr741nd-v4-serial-fix.jpgWR741NDv4

http://wiki.openwrt.org/_media/toh/tp-link/tl-wr841nd-v3.2-serial.jpgWR841NDv3.2

Choose your foe ;)

comment:16 Changed 4 years ago by RalfFriedl

So I have to find out where serial signal actually is?

At the moment, my "foe" is the MR3220V2.

comment:17 Changed 4 years ago by dioptimizer <dioptimizer@…>

RalfFriedl

As a variant please send a photo of selected region in the best quality so that you can to distinguish the tracks and crossings.

Also need a photo the same region but on the back side of PCB!

http://img254.imageshack.us/img254/1788/mr3220v2t1.jpg
http://dioptimizer.narod.ru/files/images/MR3220V2-006.jpg

On the back side of the PCB can be seen first contact (presumably TX) and coming from it contact TP#. Maybe there should bridge the break and the contacts between TP#. Please send a photo back next UART in better quality. Perhaps even so together we can deal with this recovery.

comment:18 Changed 4 years ago by dioptimizer <dioptimizer@…>

Do not turn this thread in the forum.
Go to: https://forum.openwrt.org/viewforum.php?id=10

Here it is better to publish the solution of the problem how to restore the router.

comment:19 Changed 4 years ago by RalfFriedl

I have created a new thread in the forum: https://forum.openwrt.org/viewtopic.php?pid=175777

I also have higher quality pictures, but I can't upload them here. They are more than 1MB but less then the supposed 2MB limit, but I get an error when I try to upload them.

comment:20 Changed 4 years ago by RalfFriedl

I found the serial signal. It is on the two small pads on the back side.
TP18 is TX.
TP23 is RX.

I now came up to the message "Please be patient, while OpenWrt loads ...", which means that /dev/console can't be opened.

comment:21 Changed 4 years ago by RalfFriedl

I have OpenWRT running on the MR3220V2.
I used the following change instead of the one in 6 because of the changes in the file format.

  • target/linux/ar71xx/image/Makefile

     
    767767 
    768768$(eval $(call SingleProfile,TPLINKOLD,$(fs_squash),TLWR841NV15,tl-wr841nd-v1.5,TL-WR841N-v1.5,ttyS0,115200,0x08410002,2,4M)) 
    769769 
    770 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLMR3220,tl-mr3220-v1,TL-MR3220,ttyS0,115200,0x32200001,1,4M)) 
    771 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLMR3420,tl-mr3420-v1,TL-MR3420,ttyS0,115200,0x34200001,1,4M)) 
     770$(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLMR3220V1,tl-mr3220-v1,TL-MR3220,ttyS0,115200,0x32200001,1,4M)) 
     771$(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLMR3420V1,tl-mr3420-v1,TL-MR3420,ttyS0,115200,0x34200001,1,4M)) 
    772772$(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWA701NV1,tl-wa701n-v1,TL-WA901ND,ttyS0,115200,0x07010001,1,4M)) 
    773773$(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWA901NV1,tl-wa901nd-v1,TL-WA901ND,ttyS0,115200,0x09010001,1,4M)) 
    774774$(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWA901NV2,tl-wa901nd-v2,TL-WA901ND-v2,ttyS0,115200,0x09010002,1,4M)) 
     
    789789$(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR11U,tl-mr11u-v1,TL-MR11U,ttyATH0,115200,0x00110101,1,4Mlzma)) 
    790790$(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR3020,tl-mr3020-v1,TL-MR3020,ttyATH0,115200,0x30200001,1,4Mlzma)) 
    791791$(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR3040,tl-mr3040-v1,TL-MR11U,ttyATH0,115200,0x30400001,1,4Mlzma)) 
     792$(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR3220V2,tl-mr3220-v2,TL-MR3220,ttyATH0,115200,0x32200002,1,4Mlzma)) 
     793$(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR3420V2,tl-mr3420-v2,TL-MR3420,ttyATH0,115200,0x34200002,1,4Mlzma)) 
    792794$(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR703,tl-wr703n-v1,TL-WR703N,ttyATH0,115200,0x07030101,1,4Mlzma)) 
    793795$(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR740NV4,tl-wr740n-v4,TL-WR741ND-v4,ttyATH0,115200,0x07400004,1,4Mlzma)) 
    794796$(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR741NV4,tl-wr741nd-v4,TL-WR741ND-v4,ttyATH0,115200,0x07410004,1,4Mlzma)) 

comment:22 Changed 4 years ago by dioptimizer <dioptimizer@…>

In fact, no guarantee that MR3420 router has AP121 platform. The fact is that the AR9331 supports up 1x1 MIMO. This means that it is not possible to realize on AR9331 the Wi-Fi speed up to 300Mbit (except that only the external WLAN chip).

RalfFriedl
Request for photos still relevant, please post pictures of high resolution in a forum or any file hosting.

Changed 4 years ago by RalfFriedl

Changed 4 years ago by RalfFriedl

comment:23 Changed 4 years ago by RalfFriedl

Here are the images.

While I can access the device now, the USB port doesn't work. I have this in the log:

Sep  9 07:09:29 OpenWrt kern.info kernel: usb 1-1: new high-speed USB device number 58 using ehci-platform
Sep  9 07:09:29 OpenWrt kern.info kernel: usb-storage 1-1:1.0: Quirks match for vid 0457 pid 0151: 80
Sep  9 07:09:29 OpenWrt kern.info kernel: scsi56 : usb-storage 1-1:1.0
Sep  9 07:09:29 OpenWrt kern.info kernel: usb 1-1: USB disconnect, device number 58
Sep  9 07:09:29 OpenWrt kern.info kernel: usb 1-1: new high-speed USB device number 59 using ehci-platform
Sep  9 07:09:30 OpenWrt kern.info kernel: usb-storage 1-1:1.0: Quirks match for vid 0457 pid 0151: 80
Sep  9 07:09:30 OpenWrt kern.info kernel: scsi57 : usb-storage 1-1:1.0
Sep  9 07:09:30 OpenWrt kern.info kernel: usb 1-1: USB disconnect, device number 59

Sep  9 07:09:54 OpenWrt kern.info kernel: usb 1-1: new high-speed USB device number 62 using ehci-platform
Sep  9 07:09:54 OpenWrt kern.info kernel: scsi60 : usb-storage 1-1:1.0
Sep  9 07:09:54 OpenWrt kern.info kernel: usb 1-1: USB disconnect, device number 62
Sep  9 07:09:55 OpenWrt kern.info kernel: usb 1-1: new high-speed USB device number 63 using ehci-platform
Sep  9 07:10:00 OpenWrt kern.info kernel: scsi61 : usb-storage 1-1:1.0
Sep  9 07:10:00 OpenWrt kern.info kernel: usb 1-1: USB disconnect, device number 63

I tried two different USB storage devices. There seems to be a problem with the USB host.

Are there yet any AP121 based devices where USB host works?

comment:24 follow-up: Changed 4 years ago by RalfFriedl

I found that the USB disconnect doesn't happen when I remove CONFIG_PACKAGE_kmod-ledtrig-usbdev. But low-speed USB devices still don't work (they did with MR3220V1). I get these messages:

Sep  9 03:45:20 OpenWrt kern.err kernel: hub 1-0:1.0: connect-debounce failed, port 1 disabled
Sep  9 03:45:23 OpenWrt kern.err kernel: hub 1-0:1.0: connect-debounce failed, port 1 disabled
Sep  9 03:45:25 OpenWrt kern.err kernel: hub 1-0:1.0: connect-debounce failed, port 1 disabled

Also, WLAN is not detected at all.

comment:25 in reply to: ↑ 24 Changed 4 years ago by anonymous

Replying to RalfFriedl:

But low-speed USB devices still don't work (they did with MR3220V1).

#11985

comment:26 Changed 4 years ago by RalfFriedl

Yes, the same symptoms as in #11985. Just for the record, the MR3220V1 has no problem with low-speed USB devices on the ehci, it doesn't even need a ohci module loaded.

But it seems that other AP121 based devices can use the WLAN. Which driver is necessary to access the WLAN?

comment:27 Changed 4 years ago by anonymous

hello dev's any updates ?

comment:28 Changed 3 years ago by Loucif Amirouche

I wanna to have access to my MR3220 v2 with serial. I have found Tx and Rx at TPA8 and TP 28 at the back of PCB bu my question is where I can find GND ???

comment:29 Changed 3 years ago by RalfFriedl

TP18 is TX.
TP23 is RX.
There are certainly enough places on the board where you can find GND. On of the is on the pins of the serial connector.

Beware however that it may not be a good idea to connect Rx directly to TP23 without the resistors of the voltage divider. I killed the RX input of my device, so I can only watch it boot a non working firmware, without a possibility to flash a new firmware with uBoot.

comment:30 Changed 3 years ago by dioptimizer <dioptimizer@…>

How to connect UART
See on Photo

comment:31 Changed 3 years ago by bp1994@…

Has anyone else found a way to fix the WiFi? I built it myself too, but the leds are messy, and the WiFi doesn't start.

comment:32 Changed 3 years ago by RalfFriedl

It seems that cindy.wijaya managed to build a working firmware, but didn't share the instructions how to do so.

Changed 3 years ago by anonymous

build_dir/linux-ar71xx_generic_uClibc-0.9.33.2/linux-3.3.8/arch/mips/ath79/Kconfig

Changed 3 years ago by anonymous

build_dir/linux-ar71xx_generic_uClibc-0.9.33.2/linux-3.3.8/arch/mips/ath79/mach-tl-wr741nd-v4.c

Changed 3 years ago by anonymous

target/linux/ar71xx/image/Makefile

Changed 3 years ago by anonymous

tools/firmware-utils/src/mktplinkfw.c

Changed 3 years ago by anonymous

target/linux/ar71xx/base-files/etc/uci-defaults/network

Changed 3 years ago by anonymous

package/network/utils/iptables/Makefile for qos support

Changed 3 years ago by anonymous

necessary for qos in linux 3.6

comment:33 Changed 3 years ago by anonymous

I added the necessary patches in order to build it. Please devs include them

comment:34 Changed 3 years ago by juhosg

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker (trunk)
  • Resolution set to fixed
  • Status changed from new to closed

The support for the MR3220v2 has been added into trunk a week ago with r34779, r34780, r34781, r34782.
With regard to the libipq patches: libipq support has been removed intentionally with r34069, and the patches are not related to the ticket at all.

comment:35 Changed 3 years ago by anonymous

ale kurwa hujnia

comment:36 Changed 2 years ago by Thebatman

This is a poor man's router with a lot of ethernets and USB. Please add support for it.

comment:37 Changed 2 years ago by anonymous

Its supported for a LONG time already!

comment:38 in reply to: ↑ description Changed 22 months ago by anonymous

Replying to RalfFriedl:

TP-Link has a new version of the MR3220, the MR3220 V2.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.