Archive

Tag Archives: Netfaster

In a previous post I described how you can backup the flash image of the Netfaster WLAN 3. In this post I’ll show you how you can restore the image by writing directly to the modem’s flash.

To restore the image we will be using the following hardware and software:

  • Bus Pirate to connect computer and modem flash chip.
  • (Optional) Pomona 5250 SOIC 8-pin Test Clip, to simplify the task of attaching the Bus Pirate to the flash chip.
  • flashrom to perform the write to flash.

(I admit that the 5250 Test Clip is an expensive little piece of equipment – currently going for about $12 – but I find that it is nearly impossible to connect directly to the flash chip otherwise; the chip pins are 0.41 mm wide, spaced 1.27 mm apart. Perhaps you could try one of these (just the cable and clip) instead of the 5250; they should be cheaper. As I said above, this is optional).

The flash chip is depicted below. It is the Macronix (MXIC) MX25L1606E M2 (2 MB, SPI, 200mil 8-SOP).

Netfaster WLAN 3 flash chip

The Netfaster WLAN 3 PCB. The position of the flash chip is shown.

Implement the following connection between Bus Pirate and flash chip. The modem must be turned off.

bus_pirate-flash_connection

The Bus Pirate connected to the flash chip.

Bus Pirate pin Flash Chip pin
CS 1
MISO 2
3.3v 3
GND 4
MOSI 5
CLK 6
3.3v 7
3.3v 8

Now connect the Bus Pirate to your computer via USB.

With the connection in place, we are ready to write the image file to the flash. (Here is the image backup I created in that previous post).

Do not turn on the modem. If you do, flashrom won’t be able to write to the flash. Assuming the image backup is named fw.bin and that you have installed flashrom (sudo apt-get install flashrom on Ubuntu, else check http://flashrom.org/Downloads), open a command terminal and issue the following command:

$sudo flashrom -p buspirate_spi:dev=/dev/ttyUSB0,spispeed=1M -w fw.bin

This will start the process of writing fw.bin to the flash. You will get the following output:

flashrom v0.9.6.1-r1563 on Linux 3.13.0-37-generic (x86_64)
flashrom is free software, get the source code at http://www.flashrom.org

Calibrating delay loop... OK.
Found Macronix flash chip "MX25L1605" (2048 kB, SPI) on buspirate_spi.
Reading old flash chip contents... done.
Erasing and writing flash chip... Erase/write done.
Verifying flash... VERIFIED.          
$

The whole process lasts about 12 minutes, with the ‘Reading old flash contents‘ and ‘Verifying flash‘ stages taking the most time. Just be patient. Notice that flashrom v0.9.6.1 reports having found an MX25L1605 flash chip, even though the modem uses an MX25L1606E. This is ok.

Once the process is completed you can disconnect the Bus Pirate and boot the modem. You should be good to go!

One last note: when you attempt to run flashrom, you may get an error along the lines of:

Found Generic flash chip "unknown SPI chip (RDID)" (0 kB, SPI) on
buspirate_spi.
===
This flash part has status NOT WORKING for operations: PROBE READ ERASE
WRITE

In this case proceed as follows:

  1. Disconnect the Bus Pirate from the computer USB port (not from the modem).
  2. With the modem PSU connected, do a quick on/off of the modem. Turn it on, wait 2 seconds, turn it off.
  3. Disconnect the modem PSU.
  4. Again do a quick on/off without the PSU connected.
  5. Connect the modem PSU but do not turn on the modem.
  6. Lastly, connect the Bus Pirate via USB, and rerun flashrom.

flashrom should now be able to identify the modem’s flash chip properly.

(I admit that the above procedure seems a bit like voodoo to me, but it’s the only way I’ve found to make flashrom identify the chip. Anybody can explain what is going on behind the scenes?)

If you have any questions or if you spotted any errors or omissions, please leave me a comment.

The Netfaster WLAN 3 is an ADSL modem/router provided by greek ISP Hellas Online. Internally the device is identified as AR7505SW11 7-A-LIC and built around the following hardware:

Type Part Notes
CPU Lantiq PSB 50601 HL v1.2 133/266 MHz
Flash Macronix (MXIC) MX25L1606E M2 2 MB, SPI, 200mil 8-SOP
RAM Winbond W9812G6JH-6 16MB @ 166 MHz
Switch Lantiq PSB 6970V v1.3
WiFi Atheros AR9271-ALJA

The admin page of this modem will not give you the option to backup the firmware the device is running (you can only backup your configuration), and you won’t be able to find it anywhere on the internet either, which means that if you accidentally erase or in any way corrupt the firmware, you won’t have a clean, working version to restore. The purpose of this post is to show you how you can get this backup.

Serial Connection

To get the firmware backup we first need to connect to the modem’s serial port. To implement this connection you’ll need a USB-to-UART serial converter such as this one.

The modem board and the serial port are pictured below. (Note you will need to do a little soldering in order to use the serial port).

Netfaster WLAN 3 PCB

The Netfaster WLAN 3 PCB. The serial port pin positions are shown.

Assuming you have the USB-to-UART converter I mentioned above or similar, with the modem powered off, implement a straight connection between converter and serial port:

  • Converter GND to modem GND (pin 4)
  • Converter Rx to modem Rx (pin 3)
  • Converter Tx to modem Tx (pin 2)

Do not power on the modem yet. Launch your preferred terminal emulator (I’ll be using PuTTY in this post) and point it to the serial line (/dev/ttyUSB0 in my case). Set connection speed 115200, data bits 8, parity None, stop bits 1 (8N1) and open the connection.

PuTTY serial connection settings.

PuTTY serial connection settings.

Note: For PuTTY to be able to open /dev/ttyUSB0 on Ubuntu you need to run it as root. To do so, open a command terminal and enter gksudo putty & .

With the PuTTY connection opened power on the modem. You will receive the following output:

ROM VER: 1.2.0
CFG 04
EEPROM Data OK

=========================================================================
Wireless ADSL Gateway AMAZON_SE Loader 7505.03 build Sep 20 2010 11:36:23
                      Arcadyan Technology Corporation
=========================================================================
SPI FLASH
RDID: c22015

Copying boot params.....DONE

Press Space Bar 3 times to enter command mode ...

Immediately press spacebar 3 times. This will halt the boot process and take you to the bootloader prompt. At the bootloader prompt press ! to enter administrator mode.

Press Space Bar 3 times to enter command mode ...123
Yes, Enter command mode ...

[AMAZON_SE Boot]:!

Enter Administrator Mode !

Once you enter administrator mode close PuTTY but do not disconnect the modem from the converter. To perform the backup we will use a different program called ‘brntool’. You can download brntool from https://github.com/rvalles/brntool.

Performing the Backup

Before running brntool we need to make a few modifications to its code, so that it is compatible with this modem. Open brntool.py with a text editor and comment-out lines 22-23, 29-31 and 59-60 by inserting a ‘#’ at the beginning of each line. Conversely, uncomment line 58 and, optionally, change the value of bs to 2048 or to any other number you prefer, as long as it is less than 10000 (bs denotes the number of bytes the program will read at a time). In the screenshots below I’ve set bs to 2048.

code

code2

Comment-out lines 22-23, 29-31 and 59-60. Uncomment line 58 and, optionally, change bs to 2048.

With the changes detailed above completed, the modem at the administrative bootloader prompt and PuTTY closed, open a command terminal and run brntool by issuing the following command:

$sudo ./brntool.py --read=fw.bin --addr=0x0 --verbose --size=0x200000

If all has gone well you should see a series of dots appear as the firmware is being read. Each ‘.’ represents a successful read of ‘bs’ bytes. A ‘!’ means the read attempt failed, and the program will retry until the read succeeds. When reading is complete, the firmware will be saved as ‘fw.bin’. I recommend you perform a second backup and then compare the two backups to make sure no errors occurred (for example, in my case, the Rx pin had come loose after some point, and I only found out when I performed two successive backups and compared them; the loose Rx pin was distorting the output, so each new backup differed from the previous one).

For your reference I have uploaded my backup to http://1drv.ms/1uYcBn9 .

If you followed the instructions above you should now have a backup of the Netfaster WLAN 3 firmware. In my next post I’ll show you how to restore the firmware to the modem.

If you have any questions or if you spotted any errors or omissions, please leave me a comment.