The ADAM2 FTP server is part of the bootloader resident in mtd2.Opens a FTP server for 5 seconds before booting the linux kernel.
Reboot your modem and immediately open a ftp connection to 192.168.1.1. (The IP address 192.168.1.1, is the default address obtained from the my_ipaddress environment variable. )
C:\>ftp 192.168.1.1
Connected to 192.168.1.1.
220 ADAM2 FTP Server ready.
User (192.168.1.1:(none)): adam2
331 Password required for adam2.
Password:
230 User adam2 successfully logged in.
As there is a small window of time when the ADAM2 FTP server listens after a reboot, you may need to make several attempts before a successful connection is made.
Once successfully logged in using the username and password of adam2, the following standard FTP command are available to reload new firmware and modify environment variables :
USER PASS RETR TYPE STOR P@SW PASV SYST PORT QUIT ABOR GET PUT RECV
The ADAM2 FTP server also introduces the following non-standard commands :
REBOOT Reboots Modem
UNSETENV Deletes Environment Variable Entries
SETENV Set Environment Variables
GETENV Gets Environment Variables
MEDIA Selects FLSH or SDRAM
Uploading kernel and fileSystem firmware
Before new firmware can be uploaded, the FTP client must be set to binary mode and the bootloader set to store images in FLASH. Prefix non-standard FTP commands with quote, if your client doesn't understand them.
ftp> bin
200 Type set to I
ftp> quote MEDIA FLSH
200 Media set to FLSH.
Now begin to upload the images. First we upload the filesystem.
ftp> put nsp.annexA.img "fs mtd0"
200 Port command successful.
150 Opening BINARY mode data connection for file transfer.
226 Transfer complete.
ftp: 1433600 bytes sent in 10.88Seconds 131.83Kbytes/sec.
then the Linux Kernel,
ftp> put ram_zimage_pad.ar7rd.nsp.squashfs.bin "kernel mtd1"
200 Port command successful.
150 Opening BINARY mode data connection for file transfer.
226 Transfer complete.
ftp: 524288 bytes sent in 4.25Seconds 123.36Kbytes/sec.
and last, the configuration file.
ftp> put config.xml "cfg mtd3"
200 Port command successful.
150 Opening BINARY mode data connection for file transfer.
226 Transfer complete.
ftp: 29592 bytes sent in 0.22Seconds 132.46Kbytes/sec.
Once done, issue the REBOOT command to reset the router and load your new firmware.
ftp> quote REBOOT
221-Thank you for using the FTP service on ADAM2.
221 Goodbye.
Connection closed by remote host.
Environment Variables
If the 550 environment variable not set. error appears when an attempt is made to upload the firmware, it is possible the environment variables are corrupt or missing. The ADAM2 ftp server includes GETENV, SETENV, and UNSETENV commands to work with the variables. First, check for the existence of mtd0, mtd1, mtd2 & mtd3 variables. They should appear as :
ftp> quote GETENV mtd0
mtd0 0x90090000,0x901f0000
ftp> quote GETENV mtd1
mtd1 0x90010000,0x90090000
ftp> quote GETENV mtd2
mtd2 0x90000000,0x90010000
ftp> quote GETENV mtd3
mtd3 0x901f0000,0x90200000
If they are missing or different, you will need to re-initialise them using the following commands :
ftp> quote SETENV mtd0,0x90090000,0x901f0000
200 SETENV command successful
ftp> quote SETENV mtd1,0x90010000,0x90090000
200 SETENV command successful
ftp> quote SETENV mtd2,0x90000000,0x90010000
200 SETENV command successful
ftp> quote SETENV mtd3,0x901f0000,0x90200000
200 SETENV command successful
and attempt to upload the firmware again.
If your new filesystem/kernel doesn’t work and you don’t know why, or you are unable to resuscitate your patient using the ADAM2 FTP server it may be time to pop inside and do some debugging. Without the console port, you have very little idea of what is going on between the bootloader passing control to the kernel and the web configuration utility loading. The kernel could be corrupt, environment variables incorrect, or the file system not mounting.
Console Connector
The NB5 has a four pin connector (J4) which provides a console debug port. Pin 1 of J4 is shown of the left of the above photo (black wire). Using this asynchronous serial port, you can gain access to the bootloader and watch the kernel/userland apps load. This port is a 3V3 volt CMOS asynchronous port running at 38,400bps 8N1.
Pin No
Function
1 GND 2 RXD (In) 3 TX D (Out) 4 -
ADAM2 Bootloader Commands
The ADAM2 Bootloader provides the following commands. The printenv command is an advantage over the ADAM2 FTP server allowing the dumping of all variables.
ADAM2 Revision 0.22.02
(C) Copyright 1996-2003 Texas Instruments Inc. All Rights Reserved.
(C) Copyright 2003 Telogy Networks, Inc.
Usage: setmfreq [-d] [-s sys_freq, in MHz] [cpu_freq, in MHz]
Memory optimization Complete!
Adam2_AR7RD >
Press any key to abort OS load, or wait 5 seconds for OS to boot...
Adam2_AR7RD > help
Commands Description
-------- -----------
h/help Displays the commands supported
info Displays board information
memop Memory Optimization
setmfreq configures/dumps the system and cpu frequencies
erase Erase Flash except Adam2 Kernel and Env space
printenv Displays Env. Variables
setenv Sets Env. variable with a value
unsetenv Unsets the Env. variable
fixenv Defragment for Env. space
go Loads the image starting at address
Adam2_AR7RD > printenv
memsize 0x00800000
flashsize 0x00200000
modetty0 38400,n,8,1,hw
modetty1 38400,n,8,1,hw
bootserport tty0
cpufrequency 150000000
sysfrequency 125000000
bootloaderVersion 0.22.02
ProductID AR7RD
HWRevision Unknown
SerialNumber none
my_ipaddress 192.168.0.100
prompt Adam2_AR7RD
firstfreeaddress 0x9401d328
req_fullrate_freq 125000000
maca 00:e0:a0:a6:66:70
mtd0 0x90090000,0x901f0000
mtd1 0x90010000,0x90090000
mtd2 0x90000000,0x90010000
mtd3 0x901f0000,0x90200000
autoload 1
usb_rndis_mac 00:30:0A:1D:BE:80
usb_board_mac 00:30:0A:1D:BE:80
macc 00:30:0A:1D:BE:81
usb_pid 0x0005
usb_vid 0x06EA
connection0 0
Adam2_AR7RD >