4 Attachment(s)
Howto add serial port to WL-500gx/gp
The Asus wl500g deluxe has uart pinout onboard, so 2 serial ports can be added to the unit.
The only difference between wl500g and wl500gx that the deluxe does not require a UART chip, so a simple RS232 transceiver will do the trick.
Here are my experiences adding a single serial port to the router
The parts you need:
- 1 MAX3232 IC (SO-IC)
- 5 1uF capacitors
- cables, connectors
I attached the PCB layout I made, and a few pictures that might help.
There are 2 jumpers on the pcb, which switches between the Tx-Rx, so it doesn't matter what kind of serial cable you actually use.
Good juper configurations:
._ ._ and _. _.
Don't mix them! Next time i'm going to use a switch instead :)
You need to connect the router's 3.3v, GND, UART_TX0, UART_RX0 pins to the left side of the pcb, set the jumpers, and connect a DB9 connector to the right side.
Note: Actually i was able to add the serial port without actually removing the warranty sticker. I left the screw with the sticker untouched, and stretched the unit just enough to get the connector on the pins.
Important: Don't try this, unless you know what you are doing. I take no responsibility for damaging your router
Code:
CFE version 1.0.37 for BCM947XX (32bit,SP,LE)
Build Date: ¤* 7¤ë 16 19:48:38 CST 2004 (root@PaNLinux)
Copyright (C) 2000,2001,2002,2003 Broadcom Corporation.
Initializing Arena.
Initializing Devices.
et0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller 1.3.2.0
rndis0: Broadcom USB RNDIS Network Adapter (P-t-P)
CPU type 0x29007: 200MHz
Total memory: 0x1000000 bytes (16MB)
Total memory used by CFE: 0x80300000 - 0x80436CF0 (1273072)
Initialized Data: 0x803311B0 - 0x80333540 (9104)
BSS Area: 0x80333540 - 0x80334CF0 (6064)
Local Heap: 0x80334CF0 - 0x80434CF0 (1048576)
Stack Area: 0x80434CF0 - 0x80436CF0 (8192)
Text (code) segment: 0x80300000 - 0x803311B0 (201136)
Boot area (physical): 0x00437000 - 0x00477000
Relocation Factor: I:00000000 - D:00000000
Device eth0: hwaddr 00-11-D8-XX-XX-XX, ipaddr 192.168.1.1, mask 255.255.255.0
gateway not set, nameserver not set
Rescue Flag disable.
Reading :: TFTP Server.
Failed.: Timeout occured
Loader:raw Filesys:raw Dev:flash0.os File: Options:(null)
Loading: ...... 1748992 bytes read
Entry at 0x80001000
Closing network.
Starting program at 0x80001000
CPU revision is: 00029007
Primary instruction cache 8kB, physically tagged, 2-way, linesize 16 bytes.
Primary data cache 4kB, 2-way, linesize 16 bytes.
Linux version 2.4.29 (josephus@arrakis) (gcc version 3.3.5) #1 Sun Mar 6 02:01:59 CET 2005
WL500gx serial port success
I have successfully connected to the serial port on J5.
I've used a small converter board from a usb->serial cable (an old phone data cable), and will mount that board inside the case, with just a USB device port added to the back panel. Pictures later ...
Here is the output from the serial console on boot (running Oleg's firmware).
Code:
CFE version 1.0.37 for BCM947XX (32bit,SP,LE)
Build Date: ¤G 3¤ë 1 16:49:41 CST 2005 (root@PaNLinux)
Copyright (C) 2000,2001,2002,2003 Broadcom Corporation.
Initializing Arena.
Initializing Devices.
et0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller 1.3.2.0
rndis0: Broadcom USB RNDIS Network Adapter (P-t-P)
CPU type 0x29007: 200MHz
Total memory: 0x2000000 bytes (32MB)
Total memory used by CFE: 0x80300000 - 0x80436F10 (1273616)
Initialized Data: 0x803313D0 - 0x80333760 (9104)
BSS Area: 0x80333760 - 0x80334F10 (6064)
Local Heap: 0x80334F10 - 0x80434F10 (1048576)
Stack Area: 0x80434F10 - 0x80436F10 (8192)
Text (code) segment: 0x80300000 - 0x803313D0 (201680)
Boot area (physical): 0x00437000 - 0x00477000
Relocation Factor: I:00000000 - D:00000000
Device eth0: hwaddr 00-11-D8-??-??-??, ipaddr 192.168.??.??, mask 255.255.255.0
gateway not set, nameserver not set
Rescue Flag disable.
Reading :: TFTP Server.
Failed.: Timeout occured
Loader:raw Filesys:raw Dev:flash0.os File: Options:(null)
Loading: .. 3560 bytes read
Entry at 0x80001000
Closing network.
Starting program at 0x80001000
cpu probe
prom init
cpu report
CPU revision is: 00029007
Primary instruction cache 8kb, linesize 16 bytes (2 ways)
Primary data cache 4kb, linesize 16 bytes (2 ways)
Linux version 2.4.20 (root@omnibook) (gcc version 3.2.3 with Broadcom modifications) #62 Mon Mar 14 21:39:22 MSK 2005
Setting the PFC value as 0x15
Determined physical RAM map:
memory: 02000000 @ 00000000 (usable)
On node 0 totalpages: 8192
zone(0): 8192 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/mtdblock2 noinitrd init=/linuxrc console=ttyS0,115200
CPU: BCM5365 rev 1 at 200 MHz
Calibrating delay loop... 199.47 BogoMIPS
Memory: 30128k/32768k available (1755k kernel code, 2640k reserved, 220k data, 68k init, 0k highmem)
Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
Inode cache hash table entries: 2048 (order: 2, 16384 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: 8192 (order: 3, 32768 bytes)
Checking for 'wait' instruction... unavailable.
POSIX conformance testing by UNIFIX
PCI: Fixing up bus 0
PCI: Fixing up bridge
PCI: Fixing up bus 1
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Journalled Block Device driver loaded
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
NTFS driver v1.1.22 [Flags: R/O]
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
loop: loaded (max 8 devices)
PPP generic driver version 2.4.2
PPP Deflate Compression module registered
PPP BSD Compression module registered
MPPE/MPPC encryption/compression module registered
Amd/Fujitsu Extended Query Table v1.1 at 0x0040
number of CFI chips: 1
Flash device: 0x400000 at 0x1c000000
Physically mapped flash: squashfs filesystem found at block 936
Creating 5 MTD partitions on "Physically mapped flash":
0x00000000-0x00040000 : "pmon"
0x00040000-0x003e0000 : "linux"
0x000ea190-0x003e0000 : "rootfs"
0x003f0000-0x00400000 : "nvram"
0x003e0000-0x003f0000 : "config"
sflash: found no supported devices
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 2048 bind 4096)
ip_conntrack version 2.1 (256 buckets, 2048 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.
IPv6 v0.8 for NET4.0
IPv6 over IPv4 tunneling driver
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>
FAT: bogus logical sector size 38400
FAT: bogus logical sector size 38400
NTFS: Unable to set blocksize 512.
VFS: Mounted root (squashfs filesystem) readonly.
Mounted devfs on /dev
Freeing unused kernel memory: 68k freed
Algorithmics/MIPS FPU Emulator v1.5
eth0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller 1.3.2.0
robosw_attach_ocp: no Robo device on OCP bus
PCI: Enabling device 01:03.0 (0004 -> 0006)
eth1: Broadcom BCM4320 802.11 Wireless Controller 3.90.7.0
device eth1 entered promiscuous mode
eth0.1: No such device
device eth0 entered promiscuous mode
br0: port 2(eth0) entering learning state
br0: port 1(eth1) entering learning state
br0: port 2(eth0) entering forwarding state
br0: topology change detected, propagating
br0: port 1(eth1) entering forwarding state
br0: topology change detected, propagating
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
usb-uhci.c: $Revision: 1.275 $ time 20:26:03 Mar 3 2005
usb-uhci.c: High bandwidth mode enabled
PCI: Enabling device 01:02.0 (0000 -> 0001)
usb-uhci.c: USB UHCI at I/O 0x100, IRQ 2
usb-uhci.c: Detected 2 ports
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
PCI: Enabling device 01:02.1 (0000 -> 0001)
usb-uhci.c: USB UHCI at I/O 0x120, IRQ 2
usb-uhci.c: Detected 2 ports
usb.c: new USB bus registered, assigned bus number 2
hub.c: USB hub found
hub.c: 2 ports detected
usb-uhci.c: v1.275:USB Universal Host Controller Interface driver
PCI: Enabling device 01:02.2 (0000 -> 0002)
ehci_hcd 01:02.2: PCI device 1106:3104
ehci_hcd 01:02.2: irq 2, pci mem c00af000
usb.c: new USB bus registered, assigned bus number 3
PCI: 01:02.2 PCI cache line size set incorrectly (0 bytes) by BIOS/FW, correcting to 32
ehci_hcd 01:02.2: USB 2.0 enabled, EHCI 1.00, driver 2003-Dec-29/2.4
hub.c: USB hub found
hub.c: 4 ports detected
usb.c: registered new driver usblp
printer.c: v0.13: USB Printer Device Class driver
usb.c: registered new driver audio
audio.c: v1.0.0:USB Audio Class driver
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
PCI devices found:
Class 0501: PCI device 14e4:0800 (rev 1).
Class 0200: PCI device 14e4:4713 (rev 1).
Class 1000: PCI device 14e4:4718 (rev 1).
Class 0c03: PCI device 14e4:4715 (rev 1).
Class 0604: PCI device 14e4:0804 (rev 1).
Class 0b30: PCI device 14e4:0816 (rev 1).
Class 0500: PCI device 14e4:080f (rev 1).
Class 0600: PCI device 14e4:5365 (rev 0).
Class 0c03: PCI device 1106:3038 (rev 97).
Class 0c03: PCI device 1106:3038 (rev 97).
Class 0c03: PCI device 1106:3104 (rev 99).
Class 0280: PCI device 14e4:4320 (rev 3).
echo for PaN ::: &&&PaN
How to disable pmon on serial port
I installed the MAX3232 on serial 0 (/dev/tts/0) and it worked immediately. I used a flat cable with a dual row connector and I was able, as suggested by Josephus, to hook the connector to the internal PCB connector without removing the middle 'guarantee' screw. I even could easely close the box again and lead the flat cable out of the side of the box.
While booting I see the same messages in serial console as shown earlier in this thread. For some experiments I want to disable the console mapped to serial0. I read that console is enable in firmware (1.9.2.7-cr5). Does anyone know how to disable the console or how to kill the proces driving the consoleso that the serial port can be freed for own applications?
I see output appearing in the terminal session when I do an echo "Hello" > /dev/tts/0 . I can even reset the terminal baud rate using busybox stty 9600 < /dev/tts/0 and output characters on this baudrate. However, as soon as I type a character in the serial terminal, the terminal is reset back to the original speed of 115200 baud as shown below
Code:
[admin@wl500gx harddisk]$ ./busybox stty 9600 < /dev/tts/0
[admin@wl500gx harddisk]$ ./busybox stty -a < /dev/tts/0
speed 9600 baud; rows 0; columns 0;
intr = <undef>; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon ixoff
-iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke
<type a Carriage Return in terminal session>
[admin@wl500gx harddisk]$ ./busybox stty -a < /dev/tts/0
speed 115200 baud; rows 0; columns 0;
intr = <undef>; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon ixoff
-iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke
It seems that a process whatches the serial port and resets its baudrate when receiving input. Any suggestions? I tried the second serial port (UART_RX1/TX1) , but as described earlier, the systems hangs as soon as output is sent to this port. Has that anything to to with IRQ 0 used by this port?