OpenWrt Forum Archive

Topic: Firmware Code Pattern on WRT54G3G-ST

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

Hello,
I have a WRT54G3G-ST.  I've pulled down openwrt-wrt54g3g-squashfs.bin to flash the unit with.  I've have the unit wired up for serial output.  I could not get the web interface to accept the openwrt image.  So, I set boot_wait=on in the CFE and attempted to tftp the image.

On the CFE console I get:
CODE Pattern is INCORRECT! (W3GS)

Looking at the head of the openwrt .bin file I see W54F.  A version of the firmware for the router from Linksys (WRT54G3G-ST_2.00.9_US_code.bin) starts with W3GS.

So, is this openwrt image for a different version/flavor of the WRT54G3G?  How can circumvent this "CODE Pattern" check and is it (fairly) safe to do so?

Thanks

The whiterussian trx supports the broadcom 47xx processors, the bin files are just thin wrappers around the trx file to add a model number and checksum. The model number is the first 4 bytes, referred to as the code pattern, you can easily change those bytes with a hex editor (the checksum doesn't cover that part of the file).

As for safety, I'm not familiar with that device, so I don't know how likely it is to boot; worst case you may need to build serial or jtag cables.

Ok, thank you for the reply.  I have a serial cable setup already, so I guess I'll just take the plunge.  I'm confused as to why the G3G openwrt firmware is not considered (by the bin file header) to be valid for a G3G router.

I'll post back here after I flash the unit, which will be a couple of days from now.

I have attempted to modify the bin in hex to put the proper model number and flashing is still failing. I changed W54F -> W3GS. Firmware attempts to update(takes longer) and fails.

Any idea? This is for the WRT54G3G-ST

Probably it needs some other modifications, too. Is there a factory firmware binary somewhere? I could look into it.

Ah, there is one now smile Give me a few minutes smile

That worked perfectly, thank you very much! You have saved me a lot of effort in locating a viable hardware revision.

Great smile Could you confirm that failsafe is working, and the leds are showing you what they should?

While the LED indicators all appear proper, I have so far been unable to throw the router into failsafe mode. I can get it to flash all LEDS rapidly but it seems to hang and is non-responsive to SSH or Telnet during this time. The router needs a power cycle to recover at that point.

I have not tested the EVDO functionality while running openWRT as of yet.

please post the output of "nvram show" cat /proc/pci" and "dmesg"

root@OpenWrt:~# nvram show cat /proc/pci
os_ram_addr=80001000
wan_device=vlan1
il0macaddr=00:18:39:bd:9f:86
boardrev=0x10
et0macaddr=00:18:39:BD:9F:84
bootnv_ver=5
watchdog=5000
boot_wait=on
wl0_infra=1
et0mdcport=0
pmon_ver=CFE 3.91.37.0
wl0_ifname=eth1
vlan0ports=1 2 3 4 5*
gpio5=robo_reset
wl0_mode=ap
os_flash_addr=bfc40000
sromrev=2
boardtype=0x0101
lan_netmask=255.255.255.0
wl0_ssid=OpenWrt
wl0id=0x4320
ag0=255
wl0gpio1=0
wl0gpio2=0
wl0gpio3=0
boardflags2=0
wan_proto=dhcp
pa0itssit=62
cctl=0
lan_ifnames=vlan0 eth1 eth2
pa0maxpwr=0x4e
lan_proto=static
lan_ipaddr=192.168.1.1
clkfreq=200
aa0=3
vlan1hwname=et0
sdram_config=0x0062
vlan1ports=0 5
scratch=a0180000
ccode=0
lan_ifname=br0
boardflags=0x0318
sdram_refresh=0x0000
sdram_ncdl=0xfc0009
et0phyaddr=30
wan_ifname=vlan1
wl0_radio=1
pa0b0=0x15eb
pa0b1=0xfa82
pa0b2=0xfe66
sdram_init=0x010b
vlan0hwname=et0
dl_ram_addr=a0001000
boot_ver=v3.6
boardnum=42
size: 895 bytes (31873 left)


=============

root@OpenWrt:~# dmesg
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.30 (nbd@ds10) (gcc version 3.4.4 (OpenWrt-1.0)) #1 Sat Feb 3 13:16:08 CET 2007
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 rootfstype=squashfs,jffs2 init=/etc/preinit noinitrd console=ttyS0,115200
CPU: BCM4712 rev 1 at 200 MHz
Using 100.000 MHz high precision timer.
Calibrating delay loop... 199.47 BogoMIPS
Memory: 14228k/16384k available (1455k kernel code, 2156k reserved, 104k data, 80k 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: Fixing up bus 0
PCI: Fixing up bridge
PCI: Setting latency timer of device 01:00.0 to 64
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
Registering mini_fo version $Id$
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
Squashfs 2.1-r2 (released 2004/12/15) (C) 2002-2004 Phillip Lougher
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
b44.c:v0.93 (Mar, 2004)
PCI: Setting latency timer of device 00:02.0 to 64
eth0: Broadcom 47xx 10/100BaseT Ethernet 00:18:39:bd:9f:84
Physically mapped flash: Found an alias at 0x400000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x800000 for the chip at 0x0
Physically mapped flash: Found an alias at 0xc00000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1000000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1400000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1800000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1c00000 for the chip at 0x0
cfi_cmdset_0001: Erase suspend on write enabled
0: offset=0x0,size=0x2000,blocks=8
1: offset=0x10000,size=0x10000,blocks=63
Using word write method
Flash device: 0x400000 at 0x1c000000
bootloader size: 262144
Physically mapped flash: Filesystem type: squashfs, size=0xfb158
Creating 5 MTD partitions on "Physically mapped flash":
0x00000000-0x00040000 : "cfe"
0x00040000-0x003f0000 : "linux"
0x000be400-0x001c0000 : "rootfs"
mtd: partition "rootfs" doesn't start on an erase block boundary -- force read-only
0x003f0000-0x00400000 : "nvram"
0x001c0000-0x003f0000 : "OpenWrt"
Initializing Cryptographic API
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)
ip_conntrack version 2.1 (5953 buckets, 5953 max) - 332 bytes per conntrack
ip_tables: (C) 2000-2002 Netfilter core team
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NET4: Ethernet Bridge 008 for NET4.0
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Mounted root (squashfs filesystem) readonly.
Mounted devfs on /dev
Freeing unused kernel memory: 80k freed
Algorithmics/MIPS FPU Emulator v1.5
diag: Detected 'Linksys WRT54G3G'
Probing device eth0: found!
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.
mini_fo: using base directory: /
mini_fo: using storage directory: /jffs
jffs2.bbc: SIZE compression mode activated.
PCI: Setting latency timer of device 00:01.0 to 64
eth1: Broadcom BCM4320 802.11 Wireless Controller 3.90.37.0
BFL_ENETADM not set in boardflags. Use force=1 to ignore.
device eth0 entered promiscuous mode
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.
vlan0: add 01:00:5e:00:00:01 mcast address to master interface
vlan0: dev_set_promiscuity(master, 1)
vlan0: dev_set_allmulti(master, 1)
device eth1 entered promiscuous mode
br0: port 2(eth1) entering learning state
br0: port 1(vlan0) entering learning state
br0: port 2(eth1) entering forwarding state
br0: topology change detected, propagating
br0: port 1(vlan0) entering forwarding state
br0: topology change detected, propagating
vlan1: add 01:00:5e:00:00:01 mcast address to master interface
root@OpenWrt:~#

"cat /proc/pci" should be another separate command, sorry.. regarding the rest button, please use the gpio utility as described in http://forum.openwrt.org/viewtopic.php?id=7839 to find the reset button

Is this firmware any different (other than the W3GS Code) from the one available for download from the main site?

All I did (last month) was change the Code Pattern on the one available from the main site and it flashed fine.

My problem is, I cannot get a Sierra S720 (CDMA) or a Sierra 875 (GSM/UTMS) card to work.  This is a step back for me since the S720 works with the original Linksys firmware.  My primary goal is to get the 875 working though.

After fiddling around with Whiterussian for a couple weeks I gave up and tried Kamikaze today, but I can't even find the pcmcia package. sad  So I guess I'll go back to Whiterussian and see if I can make any headway there again.

This is just one with the changed codepattern. No idea about the problems with the card, as I don't have one (nor a WRT54G3G) to test on.

Kaloz wrote:

This is just one with the changed codepattern. No idea about the problems with the card, as I don't have one (nor a WRT54G3G) to test on.

Ok, thanks.   I'll plug away at the 875 problem and report here if I make any progress.

Ok it looks like the 875 is possibly aready supported in Whiterussian.  I found patches that add it to usbserial for instance.  So, my problem was I hadn't installed kmod-usb-ohci.

Now I have the correct /dev nodes (/dev/usb/tts/0... etc).  I have my chat scripts all set up and pppd is installed.

I can microcom into the 875 and ask it about its status.  It thinks it's registered to the cellular network as it should since it works in my laptop under Linux just fine.

The problem is, it won't connect.  I don't seem to be getting challenges back from the network for authenication.

root@OpenWrt:/etc/ppp# pppd call cingular               
Serial connection established.
using channel 13
Using interface ppp0
Connect: ppp0 <--> /dev/usb/tts/0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x54e2a36b>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x54e2a36b>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x54e2a36b>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x54e2a36b>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x54e2a36b>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x54e2a36b>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x54e2a36b>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x54e2a36b>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x54e2a36b>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x54e2a36b>]
LCP: timeout sending Config-Requests
Connection terminated.
Modem hangup


Here's (part of) the output from my (successfully working) laptop:

[root@d600 ppp]$ pppd call cingular debug
Serial connection established.
using channel 2
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x8eea8803> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x2 <asyncmap 0x0> <auth chap MD5> <magic 0x7a1bada2> <pcomp> <accomp>]
sent [LCP ConfAck id=0x2 <asyncmap 0x0> <auth chap MD5> <magic 0x7a1bada2> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x8eea8803> <pcomp> <accomp>]
rcvd [LCP DiscReq id=0x3 magic=0x7a1bada2]
rcvd [CHAP Challenge id=0x1 <9837f32398eec63438585af0ce3f56bb>, name = "UMTS_CHAP_SRVR"]
sent [CHAP Response id=0x1 <d2c52fe45edb8ab12bd1474e59a8228a>, name = "ISPDA@CINGULARGPRS.COM"]
rcvd [CHAP Success id=0x1 ""]
CHAP authentication succeeded
CHAP authentication succeeded


So, anyone have some insight?

Thanks.

Ok, it just started working.  I don't know what I did.  I may have had a syntax error in my ppp script, but I'm not so sure.  It's possible things won't work right if you insert the card after the router is up.  I'll have to experiment with that.  For now I'll bring up the router with the card installed.

Anyhow, I can start pppd up manually and get on the net, so now I just have to work out the nvram stuff and automate the startup.

hello.. i uploaded a file to the router named.. 1_openwrt-wrt54g3g-st-squashfs
now i cant figure out how to use it... i thought it was wat i needed. but it isnt . and i dont want to waste time trying to fix it. Instead i want to go back to factory settings... I tried dling the firmware from sprint website, but the  one from openwrt is not allowing it. saying it has to be a trx or a tgz... well.. they made their files .bin.so what do i do...

Can someone help me make it go back to factory settings please.!!

ok... i think i bricked it now... i cant access the router at all..i was deleteing things and now router isnt shooting a networkat allto the computer

The discussion might have continued from here.