OpenWrt Forum Archive

Topic: bricked WRT54GL, attempting rescue with serial port

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

Hi,

I bricked my router a few weeks ago and have been unsuccesful in attempts to communicate with it through the serial connection.
I have bought a Nokia usb CA-52 cable and cut off the side that should go into the phone.
Four wires protrude:
yellow
blue
white
green

I have tried to find out which one is which (with a volt meter) and I think these colors represent this:
yellow = vcc
blue = gnd
green = TX
white = RX

I got myself a nine wired serial flat cable and connected that to the ten pin male connector that I soldered onto the router.
Thanks to the wiki I found out that these four pins on the ten pin serial connector are what I want:
Pin  2: 3.3V
Pin  4: Tx (ttyS0)
Pin  6: Rx (ttyS0)
Pin 10: GND

I crossed four of the wires from the flat cable with the four pins of the router, like so:
pin 2     -   yellow
pin 4     -   green
pin 6     -   white
pin 10   -   blue

After that, I plugged the USB cable into my linux machine, powered up the router, and watched my syslog change.
This is the info I get:

Jul  4 21:12:57 ubuntu kernel: [135256.484507] usb 1-3: new full speed USB device using ohci_hcd and address 88
Jul  4 21:12:57 ubuntu kernel: [135257.028081] usb 1-3: new full speed USB device using ohci_hcd and address 89
Jul  4 21:12:58 ubuntu kernel: [135257.735534] usb 1-3: new full speed USB device using ohci_hcd and address 90
Jul  4 21:12:59 ubuntu kernel: [135258.410993] usb 1-3: new full speed USB device using ohci_hcd and address 91
Jul  4 21:12:59 ubuntu kernel: [135259.086479] usb 1-3: new full speed USB device using ohci_hcd and address 92
Jul  4 21:13:00 ubuntu kernel: [135259.761946] usb 1-3: new full speed USB device using ohci_hcd and address 93
Jul  4 21:13:01 ubuntu kernel: [135260.501354] usb 1-3: new full speed USB device using ohci_hcd and address 94
Jul  4 21:13:02 ubuntu kernel: [135261.172826] usb 1-3: new full speed USB device using ohci_hcd and address 95
Jul  4 21:13:02 ubuntu kernel: [135261.348688] usb 1-3: device descriptor read/64, error -62
Jul  4 21:13:03 ubuntu kernel: [135262.124084] usb 1-3: new full speed USB device using ohci_hcd and address 96
Jul  4 21:13:03 ubuntu kernel: [135262.303936] usb 1-3: device descriptor read/64, error -62
Jul  4 21:13:03 ubuntu kernel: [135263.079340] usb 1-3: new full speed USB device using ohci_hcd and address 97
Jul  4 21:13:04 ubuntu kernel: [135263.263185] usb 1-3: device descriptor read/64, error -62
Jul  4 21:13:04 ubuntu kernel: [135263.546975] usb 1-3: device descriptor read/64, error -62
Jul  4 21:13:04 ubuntu kernel: [135263.826740] usb 1-3: new full speed USB device using ohci_hcd and address 98
Jul  4 21:13:05 ubuntu kernel: [135264.502210] usb 1-3: new full speed USB device using ohci_hcd and address 99
Jul  4 21:13:06 ubuntu kernel: [135265.177679] usb 1-3: new full speed USB device using ohci_hcd and address 100
Jul  4 21:13:06 ubuntu kernel: [135265.357541] usb 1-3: device descriptor read/64, error -62
Jul  4 21:13:07 ubuntu kernel: [135266.132929] usb 1-3: new full speed USB device using ohci_hcd and address 101
Jul  4 21:13:07 ubuntu kernel: [135266.804402] usb 1-3: new full speed USB device using ohci_hcd and address 102
Jul  4 21:13:07 ubuntu kernel: [135266.984262] usb 1-3: device descriptor read/64, error -62
Jul  4 21:13:08 ubuntu kernel: [135267.767643] usb 1-3: new full speed USB device using ohci_hcd and address 103
Jul  4 21:13:09 ubuntu kernel: [135268.443113] usb 1-3: new full speed USB device using ohci_hcd and address 104
Jul  4 21:13:10 ubuntu kernel: [135269.118590] usb 1-3: new full speed USB device using ohci_hcd and address 105
Jul  4 21:13:10 ubuntu kernel: [135269.298441] usb 1-3: device descriptor read/64, error -62
Jul  4 21:13:10 ubuntu kernel: [135269.578228] usb 1-3: device descriptor read/64, error -62
Jul  4 21:13:10 ubuntu kernel: [135269.854014] usb 1-3: new full speed USB device using ohci_hcd and address 106
Jul  4 21:13:10 ubuntu kernel: [135270.033865] usb 1-3: device descriptor read/64, error -62
Jul  4 21:13:11 ubuntu kernel: [135270.317644] usb 1-3: device descriptor read/64, error -62
Jul  4 21:13:11 ubuntu kernel: [135270.597429] usb 1-3: new full speed USB device using ohci_hcd and address 107
Jul  4 21:13:11 ubuntu kernel: [135271.001112] usb 1-3: device not accepting address 107, error -62
Jul  4 21:13:12 ubuntu kernel: [135271.176966] usb 1-3: new full speed USB device using ohci_hcd and address 108
Jul  4 21:13:12 ubuntu kernel: [135271.584645] usb 1-3: device not accepting address 108, error -62
Jul  4 21:13:13 ubuntu kernel: [135272.224143] usb 1-3: new full speed USB device using ohci_hcd and address 109
Jul  4 21:13:13 ubuntu kernel: [135272.400019] usb 1-3: device descriptor read/64, error -62
Jul  4 21:13:14 ubuntu kernel: [135273.223359] usb 1-3: new full speed USB device using ohci_hcd and address 110

From what I could find, this is simply a hardware error. It is clear that the usb cable cannot be identified as something that will give me a device file. Although I cannot say for certain, I take it that I need something like /dev/ttyUSB0 to actually access the router with something like minicom. Right?
So, how did others make the connection? From what I read on the forum, nobody seems to have had trouble with connecting the router, after the correct pins were found. I must be missing something.

I guess I can still opt for a 'sure to work' cable, but perhaps I just did something silly?

Regards, Warren

I just last night got serial going on a WRT54Gv4 - should be identical in all respects to the GL.  Logical (inverted) to RS-232 levels are needed.  I used a MAX3233 3.3V chip but all over the docs here is a 5V MAX232 chip running at 3.3V. smile

Or... you may have the RX/TX game reversed.  Pin 4 is WRT send-data, pin 6 WRT receive-data (avoiding RS232 DTE/DCE definitions).  WRT-pin-4 should invert and drive the DB9M pin 2 usually found these days.

Sorry if you need the terminal end, too.  No serial port I assume.

(Last edited by Bill_MI on 5 Jul 2007, 03:36)

Reversing TX and RX doesn't make much of a difference. The only noticeable change in the log file lines is that the device is recognized as something with low speed instead of high speed.
I still get the device descriptor error, so no module dares to touch it.

I did buy a serial to ttl convertor, but that didn't help me out either.
I'm not in the States and I had difficulty finding a local shop selling the max323 chip-on-a-board. I found conrad.de which sells some chip which is almost the same, but slightly different. Worst, it didn't come with documentation. We had to measure all the pins with a volt meter, but finding TX and RX is very difficult without power and data through the chip. But since the chip is 12V, I can't hook it up without risking to kill the router, so I was willing to take my chances with a cheap USB cable.

More ideas please!

Partial succes. Missing a prompt on serial connection.

I first used a cheap USB cable and managed nothing with it.
After that I got this cable, which was a lot better:
http://www.ftdichip.com/Products/Evalua … 3V3-AJ.htm

Now that I have a connection to the router, I don't seem to be able to do anything with it.
I have setup a connection through Windows standard Hyperterminal, and I can see loads of info flash by, but I don't seem to be able to give the router any commands.
At the end of the output, it is waiting with a cursor. After a while I see the message: Hit enter to continue.
No input however on my part gives me a prompt. I was expecting CFE.
I read in the wiki that I should try Ctrl-C quickly at boottime, but that didn't work.
What am I missing?

CFE version 1.0.37 for BCM947XX (32bit,SP,LE)
Build Date: Tue Jun 20 16:22:41 CST 2006 (root@localhost.localdomain)
Copyright (C) 2000,2001,2002,2003 Broadcom Corporation.

Initializing Arena
Initializing Devices.

No DPN
et0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller 3.90.37.0
CPU type 0x29008: 200MHz
Total memory: 16384 KBytes

Total memory used by CFE:  0x80300000 - 0x803A39C0 (670144)
Initialized Data:          0x803398D0 - 0x8033BFE0 (10000)
BSS Area:                  0x8033BFE0 - 0x8033D9C0 (6624)
Local Heap:                0x8033D9C0 - 0x803A19C0 (409600)
Stack Area:                0x803A19C0 - 0x803A39C0 (8192)
Text (code) segment:       0x80300000 - 0x803398D0 (235728)
Boot area (physical):      0x003A4000 - 0x003E4000
Relocation Factor:         I:00000000 - D:00000000

Boot version: v3.7
The boot is CFE

mac_init(): Find mac [00:1A:70:4F:72:4F] in location 0
Nothing...

eou_key_init(): Find key pair in location 0
The eou device id is same
The eou public key is same
The eou private key is same
Device eth0:  hwaddr 00-1A-70-4F-72-4F, ipaddr 192.168.1.1, mask 255.255.255.0
        gateway not set, nameserver not set
Loader:raw Filesys:raw Dev:flash0.os File: Options:(null)
Loading: ...... 1617920 bytes read
Entry at 0x80001000
Closing network.
Starting program at 0x80001000
CPU revision is: 00029008
Primary instruction cache 16kb, linesize 16 bytes (2 ways)
Primary data cache 8kb, linesize 16 bytes (2 ways)
Linux version 2.4.20 (hue@sw1.rd) (gcc version 3.2.3 with Broadcom modifications) #1 Wed Nov 1 15:22:08 CST 2006
Setting the PFC value as 0x15
Determined physical RAM map:
memory: 01000000 @ 00000000 (usable)
On node 0 totalpages: 4096
zone(0): 4096 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/mtdblock2 noinitrd console=ttyS0,115200
CPU: BCM5352 rev 0 at 200 MHz
Calibrating delay loop... 199.47 BogoMIPS
Memory: 14388k/16384k available (1380k kernel code, 1996k reserved, 112k data, 64k init, 0k highmem)
Dentry cache hash table entries: 2048 (order: 2, 16384 bytes)
Inode cache hash table entries: 1024 (order: 1, 8192 bytes)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 4096 (order: 2, 16384 bytes)
Checking for 'wait' instruction...  unavailable.
POSIX conformance testing by UNIFIX
PCI: no core
PCI: Fixing up bus 0
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled
ttyS00 at 0xb8000300 (irq = 3) is a 16550A
ttyS01 at 0xb8000400 (irq = 0) is a 16550A
HDLC line discipline: version $Revision: 1.1.1.4 $, maxframe=4096
N_HDLC line discipline registered.
PPP generic driver version 2.4.2
Amd/Fujitsu Extended Query Table v3.3 at 0x0040
number of CFI chips: 1
Flash device: 0x400000 at 0x1c000000
Physically mapped flash: squashfs filesystem found at block 932
le32_to_cpu(trx->magic)=0x30524448 trx->magic=0x30524448
bcm947xx_parts[1].offset=0x0 trx->offsets[1]=0x1 off
off=0xe9080 off1=0x400000 size=0x400000
(Not Found Lang Block)off=0xe9080 off1=0x3a0000 size=0x400000
nvram: offset=0x3f0000 size=0x10000
Creating 5 MTD partitions on "Physically mapped flash":
0x00000000-0x00040000 : "pmon"
0x00040000-0x003a0000 : "linux"
0x000e9080-0x003a0000 : "rootfs"
mtd: partition "rootfs" doesn't start on an erase block boundary -- force read-only
0x003a0000-0x003f0000 : "lang"
0x003f0000-0x00400000 : "nvram"
sflash: found no supported devices
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 1024 bind 2048)
Linux IP multicast router 0.06 plus PIM-SM
ip_conntrack version 2.1 (128 buckets, 1024 max) - 344 bytes per conntrack
ip_conntrack_pptp version 1.9 loaded
ip_nat_pptp version 1.5 loaded
ip_tables: (C) 2000-2002 Netfilter core team
ipt_time loading
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NET4: Ethernet Bridge 008 for NET4.0
802.1Q VLAN Support v1.7 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
cramfs: wrong magic
VFS: Mounted root (squashfs filesystem) readonly.
Mounted devfs on /dev
Freeing unused kernel memory: 64k freed
SQUASHFS error: Can't find a SQUASHFS superblock on mtdblock(31,3)
ret = -1
www -> /www
mount: Inappropriate ioctl for device
Language Package: EN
modules[0]=et buf=[et ]
modules[1]=ctmisc buf=[et ctmisc ]
modules[2]=wl buf=[et ctmisc wl ]
Needed modules: et ctmisc wl
Using /lib/modules/2.4.20/kernel/drivers/net/et/et.o
Using /lib/modules/2.4.20/kernel/drivers/net/ctmisc/ctmisc.o
Using /lib/modules/2.4.20/kernel/drivers/net/wl/wl.o
Hit enter to continue...type = [get_mac]
get_data(): cmd=0x11 count=8 len=18
get_data(): Get MAC count is [1]
get_data(): MAC 0: [00:1A:70:4F:72:4F]
get_data(): done
type = [get_eou]
get_data(): cmd=0x13 count=5 len=522
get_data(): Get EOU count is [1]
get_data(): EOU 0: [UNHC9IQZa1200427630412f7b19a3f6f0b0908bc27e7b8e60fab1283671a36a8360bd472d095f646dbe6adb5696021aa3fff04f9625d8988cafeb66b92ca421913718594784f0adec68c7eef97ea32d28d28d7ad70b168c8c91acf1dae9c8def4f7b34cdc823bdb92fad0429839029e9ecb1f6696e7c190d3787a0a5ac13cdcde6c69459d2b3b6a9a8ddf16b4ab6042ebfa95a31207dca67ed1ac970c1e733c846ad021ffd12df97bd19f6d989cc7acaf139cb6d80a1b3da448829a05d7ea5347be33888e42f83926556e36b9643e59bc867f72c3748dd93422ec8bd0186b53d64a05b6f20ac1876068470fccf00806e321afa2332e7d0c471fbb53069b4b761a1c6d90311]
get_data(): done
type = [get_sn]
get_data(): cmd=0x15 count=8 len=20
get_data(): Get SN count is [1]
get_data(): SN 0: [CL7B1G222920ÿÿÿÿÿÿÿÿ]
get_data(): done
type = [get_flash_type]
get_flash_type(): cmd=0x17 count=0 len=0
Get FLASH TYPE is [Samsung K8D3216UBC 2Mx16 BotB]
The boot is CFE
insmod: writemac.o: no module by that name found
rmmod: writemac: No such file or directory
killall: httpd: no process killed
name=[vlan0] lan_ifname=[br0]
=====> set br0 hwaddr to vlan0
name=[eth1] lan_ifname=[br0]
Write wireless mac successfully
br0: No child processes
name=[eth2] lan_ifname=[br0]
eth2: No such device
name=[eth3] lan_ifname=[br0]
eth3: No such device
lo: File exists
syslogd: 0: Unknown host
The boot is CFE
tftp server started
tftpd: standalone socket
[HTTPD Starting on /www]
br0 192.168.1.100  86400
info, udhcp server (v0.9.8) started
zebra disabled.
EOU: Generate hash of public key: 2B 81 CC A1 4F D0 5C B6 97 35 2E D5 35 80 BE AE - D6 26 16 B6

EOU: The EoU is not already configured
EOU: /usr/sbin/wl add_ie 2 29 00:03:47 0202010103142B81CCA14FD05CB697352ED53580BEAED62616B6

SES_SUPPORT_NEW_BOARD=1
SES2: In brcm_ses_event_get(), event in = SES2: In brcm_ses_event_notify(), event = SES_EVTO_CONFIGURED!!!
calling upnp_main
SES2: brcm_ses_network_restore1
nvram = wl_ssid, value = linksys
nvram = wl_closed, value = 0
nvram = wl_wpa_psk, value =
nvram = wl_auth, value = 0
nvram = wl_wep, value = disabled
nvram = wl_auth_mode, value = none
nvram = wl_crypto, value = tkip
nvram = wl_akm, value =
tallest:=====( wan_or_lan=wan )=====
tallest:=====( wan_or_lan=wan is wan !!)=====
Hit enter to continue...info, udhcp client (v0.9.8) started
No interface specified. Quitting...
Hit enter to continue...Hit enter to continue...SES2: In brcm_ses_event_get(), event in = No interface specified. Quitting...
SES_EVTI_NULL!!!
SES_EVTI_NULL!!!

OMG! I found out that I had made a mistake. The router wasn't as bricked as I expected. Stupid, stupid, stupid. Certainly not going to explain how and what.
Enjoying Kamikaze now.

The discussion might have continued from here.