TechInfoDepot:DD-WRT/Gateworks Avila/Cambria Installation

Please note: The details in these instructions apply specifically to the GW2348-4 board. If you are using a GW2348-2 or GW2347 there are subtle but important differences in the flashing commands you must use. See the file FLASHING.TXT for details.

The Gateworks GW234x series Network Processor boards provide an excellent platform for building high performance wireless networks using DD-WRT firmware. They are well built, flexible, and relatively much lower in cost than most commercial alternatives.

For more information see: Avila Gateworks GW234x

Installing DD-WRT on the GW2348 board is relatively simple. To install the firmware you will need the following tools:
 * Computer (I use a laptop with wireless internet connectivity as well as an ethernet port)
 * DC power supply (12 to 24 V, 1 A)
 * Coaxial power plug (2.5 mm x 5.5 mm available from Radio Shack)
 * 9 pin serial cable
 * Ethernet cable

Before you begin you will need to download and install some tools unless you already have them. If you don't already have one, download a TFTP server for your computer. I use TFTPD32 which is free and works quite well. You will also need a terminal program to communicate with the GW2348 over its serial port. I use Hyperterminal which comes with Windows XP but you can use another if you wish. What is important is that you configure it with the following settings:
 * Speed: 115200 Baud
 * Parity: None
 * Data Bits: 8
 * Stop Bits: 1
 * Flow Control: None



You will also need to download a copy of the firmware from the DD-WRT Downloads section of the website. The firmware is (as of this writing) located under the beta subsection in a directory called AVILA GATEWORKS. The first file you should get is flashing.txt which describes, albeit in very abbreviated terms, the essential information required to complete the process of flashing DD-WRT firmware onto the GW2348 board. Next, choose the build that you are comfortable with (generally the most recent) and download root.fs and zimage. These two files should be saved in the TFTP Root directory you created when you installed TFTPD32. For the purposes of these instructions you will not need to download the file gateworx-firmware-squashfs.bin as we won't be using it. While you are on the DD-WRT website, visit the online store and purchase an activation key for the GATEWORKS firmware.

When all the files have been downloaded and installed as needed in the computer it is time to set up the computer to connect to the GW2348 board. Plug the serial cable between the serial port on the computer and the serial port on the GW2348. Connect the ethernet cable between the ethernet port on the computer and the eth0 port on the GW2348. The eth0 port is the one closest to the power connector on the GW2348. Next, open the Windows control panel and go into the network connections page. Select the local area connection item that corresponds to the ethernet adapter you connected to the GW2348. Manually configure the TCP/IP settings of this ethernet adapter as follows: Remove any reference to a GATEWAY address as well as references to DNS servers on this adapter's configuration.
 * Manually Specified Address (no DHCP)
 * IP ADDRESS: 192.168.3.1
 * SUBNET MASK: 255.255.255.0

You are now ready to power up the GW2348 for the first time. To do this you will need to connect your 24 volt DC power supply to the coaxial power connector so that the negative (-) terminal of the supply is connected to the outer sleeve of the connector and the Positive (+) terminal is connected to the center conductor. Remember to start up Hyperterminal (or your terminal package of choice) with the settings shown in the image above. Plug in the power to the GW2348 and turn on the power supply. If no smoke comes from the board the ethernet port lights should flicker and then come on. At about the same time Windows should report that the ethernet port is connected at 100 Mb/s and text should start to appear on the Hyperterminal screen looking something like this:

+No devices on IDE controller 0 Trying NPE-B...success. Using NPE-B with PHY 0. Ethernet eth0: MAC address 00:d0:12:xx:xx:xx IP: 192.168.3.2/255.255.255.0, Gateway: 0.0.0.0 Default server: 192.168.3.1 RedBoot(tm) bootstrap and debug environment [ROM] Gateworks certified release, version 2.02 - built 05:22:19, Mar 3 2006 Platform: Gateworks Avila GW234X (IXP42X 533MHz) BE Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. Copyright (C) 2004, 2005 Gateworks Corporation RAM: 0x00000000-0x04000000, [0x000298b0-0x03fc1000] available FLASH: 0x50000000 - 0x51000000, 128 blocks of 0x00020000 bytes each. == Executing boot script in 2.500 seconds - enter ^C to abort

After a couple of seconds (2 and 1/2 to be exact) the text will continue scrolling by. When it is finished open a web browser and type in the URL http://192.168.3.2/. This should give you a basic web page from the embedded copy of Linux that is running on the GW2348. If you have gotten this far you have a working GW2348 and are ready to flash in a copy of DD-WRT. be sure to start up the TFTPd32 program with both the root.fs and zimage files in the tftpd root directory. Remember to set the TFTP server address to 192.168.3.1. This is easiest to do while the GW2348 is still turned on and the ethernet port is active. Unplug the power (or switch off the supply) to the GW2348 and then make sure that the Hyperterminal program is running. Also bring up a text editor such as "Notepad" and open the flashing.txt file you downloaded from the DD-WRT website when you were downloading the DD-WRT image files. You will be referring to this file during the next phase of the process and will probably be copying and pasting lines from it into the Hyperterminal window since this will save a lot of tedious typing and will likely reduce thechances of making an unfortunate error.

It's time to begin the flashing process in earnest now. Here goes nothing... Plug in the GW2348 power supply while watching the Hyperterminal Window. When you see the line:

== Executing boot script in 2.500 seconds - enter ^C to abort

you have 2 and one half seconds to hit CTRL-C. When you do you should see a prompt that looks like this:

^C RedBoot>

At this prompt enter the line:

fis init -f

The GW2348 will respond with:

About to initialize [format] FLASH image system - continue (y/n)?

As long as you are ready to continue enter a Y to get the following response:

*** Initialize FLASH Image System ... Erase from 0x50080000-0x50fe0000: ............................... ..................................................................... ....................... ... Unlock from 0x50fe0000-0x51000000:. ... Erase from 0x50fe0000-0x51000000:. ... Program from 0x03fe0000-0x04000000 at 0x50fe0000:. ... Lock from 0x50fe0000-0x51000000:. RedBoot>

Enter the following line: (you may want to refer to the flashing.txt file for this and subsequent lines to enter since they could change in future builds)

load -r -v -b 0x00800000 zImage

At this point you will find out for sure if your TFTP server is working correctly. If it isn't you will get something like this:

Using default protocol (TFTP) __udp_sendto: Can't find address of server Can't load 'zImage': some sort of network error RedBoot>

When I got this message it was because I had forgotten to set my TFTP server to use 192.168.3.1 as its address so it was not seeing the TFTP request coming from the GW2348. I changed the setting and then the reply coming from the GW2348 looked like this:

Using default protocol (TFTP) / Raw file loaded 0x00800000-0x00967c93, assumed entry at 0x00800000 RedBoot>

This took several seconds as the zimage file was downloaded to the Gateworks board from my computer. After this completes execute the following command:

fis create -b 0x00800000 -f 0x050080000 -l 0x00200000 -r 0x00800000 linux

The response should look like this:

... Erase from 0x50080000-0x50280000: ................ ... Program from 0x00800000-0x00a00000 at 0x50080000: ................ ... Unlock from 0x50fe0000-0x51000000:. ... Erase from 0x50fe0000-0x51000000:. ... Program from 0x03fe0000-0x04000000 at 0x50fe0000:. ... Lock from 0x50fe0000-0x51000000:. RedBoot>

Then enter this command:

fis create -n linux

You will get a caution message:

An image named 'linux' exists - continue (y/n)? y * CAUTION * about to program 'linux' at 0x50080000..0x501e7c93 from 0x00800000 - continue (y/n)? y

The message repeats twice since this is when you are actually overwriting the original version of Linux installed on the board. They really want you to be sure and it is wise to reread your command line to be sure that you aren't doing something stupid... but forge ahead... The GW2348 will respond:

... Unlock from 0x50fe0000-0x51000000:. ... Erase from 0x50fe0000-0x51000000:. ... Program from 0x03fe0000-0x04000000 at 0x50fe0000:. ... Lock from 0x50fe0000-0x51000000:. RedBoot>

Now it is time to TFTP in the second file (root.fs):

load -r -v -b 0x00800000 root.fs

If all is working well the response should look something like this:

Using default protocol (TFTP) / Raw file loaded 0x00800000-0x00d13fff, assumed entry at 0x00800000 RedBoot>

When the loading of the root filesystem is complete (it will take a few seconds because it is a large file) you will create several files The first looks like this:

fis create -b 0x00800000 -f 0x050280000 -l 0x00D20000 ramdisk

The response from the GW2348 will look like:

... Erase from 0x50280000-0x50fa0000: ............................... ..................................................................... ..... ... Program from 0x00800000-0x01520000 at 0x50280000: ............... ..................................................................... ..................... ... Unlock from 0x50fe0000-0x51000000:. ... Erase from 0x50fe0000-0x51000000:. ... Program from 0x03fe0000-0x04000000 at 0x50fe0000:. ... Lock from 0x50fe0000-0x51000000:.

Programming this block of the flash memory takes quite a while because it is a very large file. You will now do two more similar commands that will execute in exactly the same way but will finish much faster. They are:

fis create -b 0x00800000 -f 0x050FA0000 -l 0x00020000 mampf

and...

fis create -b 0x00800000 -f 0x050FC0000 -l 0x00020000 nvram

When these are done we will run the fconfig utility at the RedBoot> prompt. The GW2348's output is shown in regular type. Your entries are shown in italic:

RedBoot> fconfig Run script at boot: true Boot script: .. fis load ramdisk .. fis load zimage .. exec Enter script, terminate with empty line >> fis load linux >> exec >> Boot script timeout (100ms resolution): 25 Use BOOTP for network configuration: false Gateway IP address: Local IP address: 192.168.1.1 Local IP address mask: 255.255.255.0 Default server IP address: 192.168.1.2 Console baud rate: 115200 GDB connection port: 9000 Force console for special debug messages: false Network debug at boot time: false Default network device: npe_eth0 Update RedBoot non-volatile configuration - continue (y/n)? y ... Unlock from 0x50fe0000-0x51000000:. ... Erase from 0x50fe0000-0x51000000:. ... Program from 0x03fe0000-0x04000000 at 0x50fe0000:. ... Lock from 0x50fe0000-0x51000000:. RedBoot>

Many of these values will be automatically filled in. You only need to backspace and edit to change them. Otherwise you can simply hit enter for the next line. when the computer pauses on a blank line that needs to remain blank such as the gateway address just hit enter to proceed to the next line. When you have finished and are at the RedBoot> prompt you are ready to reboot the GW2348. Before you do this you will need to make a few changes in your computer configuration. First, shut down the TFTP server. You won't be needing it. Then open the control panel and go back to the network connections page and change your IP address on the ethernet adapter from 192.168.3.1 to 192.168.1.2. Now, start up a web browser and type in the URL http://192.168.1.1 but don't hit enter just yet... Unplug the power to the GW2348 and repower it. Wait about 30-45 seconds then hit enter on the web browser. You should get a page that looks a lot like the one shown below:



If you have gotten this far successfully you have done the hard part. All that remains is to register the board using the web based registration server at DD-WRT. It might be a good time now to copy that big system key that is on the web page to the clipboard. After doing that, start up a second browser (here is where having that wireless internet connectivity comes in handy) and browse back to the DD-WRT website and go to the DD-WRT shop where you will need to log in with the email address and password you used when you bought your activation key. When you go to My Account you will see a link to the Activation Center at the bottom of the page. click on it and you will be taken to a page where you can paste in that hairy long system key from the clipboard and generate an activation key that you can take back to the first browser and paste into the available space as shown below:



When you press the activate button the board will reboot and you may have to restart your browser to get it to display properly but you should get the familiar DD-WRT main screen. The username and password are "root" and "admin" just like other DD-WRT versions. You can now power down the board and install up to four mini-PCI radio cards and start to have fun. Remember though that if you are using high power cards you will need a power supply with adequate voltage and current.