The serial port is J10, on the left of the switch chip, [[#Picture with highlighted Serial and Jtag|see]]

-

Flash info:

+

| 6 | GND | RX | 5 |

-

device_id : ............227E

+

| 4 | GND | Vcc (3.3V) | 3 |

-

meminfo.nsect:​..........128

+

| 2 | GND | TX | ​1 |

-

totalSize:​..............1000000

+

-

num_erase_blocks:​...... ​1

+

-

device_size:​............1000000

+

-

Parallel flash device: name MX29L128DT, id 0x227e, size 16384KB

+

Settings are 115200 8N1

-

CPU type 0x2A010: 300MHz, Bus: 133MHz, Ref: 64MHz

+

-

CPU running TP0

+

-

Total memory: 33554432 bytes (32MB)

+

-

Total memory used by CFE: ​0x80401000 - 0x80528CB0 (1211568)

+

**NB:** a short circuit between pins ''​RX''​ and ''​TX''​ at power up puts the device in a recovery mode with IP ''​192.168.1.1''​ from where a new firmware can be uploaded. ​OpenWrt binaries are refused, though, because of invalid CRC.

-

Initialized Data: 0x8041E8A0 - 0x804204C0 (7200)

+

-

BSS Area: 0x804204C0 - 0x80426CB0 (26608)

+

You can use a CP210x USB to UART Bridge adapter. The advantage of the usb version is that you don't need to use battery like the old "​com"​ version.

-

Local Heap: 0x80426CB0 - 0x80526CB0 ​(1048576)

+

-

Stack Area: 0x80526CB0 ​- 0x80528CB0 ​(8192)

+

If you use Windows you can use HyperTerminal to connect with the router. You have to use the emulated com port, set the speed of 115200 ​(try other speeds if you see strange caracters).

-

Text (code) segment: 0x80401000 - 0x8041E894 ​(120980)

+

-

Boot area (physical): ​ 0x00529000 - 0x00569000

+

==== JTAG ====

-

Relocation Factor: ​ I:00000000 - D:00000000

+

Jtag port is J9 near the SoC and the minipci socket, [[#Picture with highlighted Serial and Jtag|see]]

+

+

It seems to be a mips e-jtag 14 pin connector with columns swapped ​(used from the other side?).

+

+

| 14 | DINT | VREF | 13 |

+

| 12 | SRST_N | GND | 11 |

+

| 10 | TCK | GND | 9 |

+

| 8 | TMS | GND | 7 |

+

| 6 | TDO | GND | 5 |

+

| 4 | TDI | GND | 3 |

+

| 2 | TRST_N | GND | 1 |

+

+

CPU Chip ID: 00000110001101011000000101111111 ​(0635817F)

+

+

I used the JTAG port with [[http://​urjtag.org|urjtag]],​ just use the svn version. Useful info on [[http://​www.neufbox4.org/​wiki/​index.php?​title=Interface_JTAG|"​Neuf Box 4 JTAG" ]]

+

+

You should probably try the [[http://​openocd.berlios.de/​web/​|Open On-Chip Debugger]]

-

Board IP address ​ : 192.168.1.1:​ffffff00

-

Host IP address ​ : 192.168.1.100

-

Gateway IP address ​ :

-

Run from flash/host (f/h) : f

-

Default host run file name : vmlinux

-

Default host flash file name : openrg.img

-

Boot delay (0-9 seconds) ​ : 1

-

Board Id (0-3) : AGPF-S0

-

Number of MAC Addresses (1-32) ​ : 13

-

Base MAC Address ​ : 02:​10:​18:​01:​00:​01

-

PSI Size (1-64) KBytes ​ : 24

-

Main Thread Number [0|1] : 0

-

</​code>​

-

Note that while the tag on the image say this is an AGPF-S0 board, the web interface tell you this is an AGPF-S1.

===== FLASH =====

===== FLASH =====

Line 97:

Line 106:

Note, when you flash from jtag the BASE ADDRESS is 0x1E000000

Note, when you flash from jtag the BASE ADDRESS is 0x1E000000

-

===== Serial Console =====

-

The serial port is J10, on the left of the switch chip, [[#Picture with highlighted Serial and Jtag|see]]

-

| 6 | GND | RX | 5 |

-

| 4 | GND | Vcc (3.3V) | 3 |

-

| 2 | GND | TX | 1 |

-

-

Settings are 115200 8N1

-

-

**NB:** a short circuit between pins ''​RX''​ and ''​TX''​ at power up puts the device in a recovery mode with IP ''​192.168.1.1''​ from where a new firmware can be uploaded. ​ OpenWrt binaries are refused, though, because of invalid CRC.

-

-

===== JTAG =====

-

Jtag port is J9 near the SoC and the minipci socket, [[#Picture with highlighted Serial and Jtag|see]]

-

-

It seems to be a mips e-jtag 14 pin connector with columns swapped (used from the other side?).

-

-

| 14 | DINT | VREF | 13 |

-

| 12 | SRST_N | GND | 11 |

-

| 10 | TCK | GND | 9 |

-

| 8 | TMS | GND | 7 |

-

| 6 | TDO | GND | 5 |

-

| 4 | TDI | GND | 3 |

-

| 2 | TRST_N | GND | 1 |

-

-

CPU Chip ID: 00000110001101011000000101111111 (0635817F)

-

-

I used the JTAG port with [[http://​urjtag.org|urjtag]],​ just use the svn version. Useful info on [[http://​www.neufbox4.org/​wiki/​index.php?​title=Interface_JTAG|"​Neuf Box 4 JTAG" ]]

-

-

You should probably try the [[http://​openocd.berlios.de/​web/​|Open On-Chip Debugger]]

===== OpenWrt on the machine :-) =====

===== OpenWrt on the machine :-) =====

Line 133:

Line 114:

==== Backup of the original firmware ====

==== Backup of the original firmware ====

-

Connect the serial adapter and let the device complete the boot procedure.

+

Connect the serial adapter and let the device complete the boot procedure. You have only to wait and don't have to short-circuit RX and TX pin.

At the login prompt use //admin// as username and password to get to the openrg //Discus// prompt.

At the login prompt use //admin// as username and password to get to the openrg //Discus// prompt.

From the //Discus// prompt you can do a lot of useful things, but i've not explored it due to some lack of interest. To obtain the shell just digit //system shell//.

From the //Discus// prompt you can do a lot of useful things, but i've not explored it due to some lack of interest. To obtain the shell just digit //system shell//.

+

note: the first time you will not see Username, but if you write admin, router will request you the password.

<​code>​

<​code>​

-

Password: *****

+

Username: admin

+

Password: *****

Discus> system shell

Discus> system shell

Line 189:

Line 172:

==== Restore original firmware ====

==== Restore original firmware ====

+

FIXME

==== Installing OpenWrt ====

==== Installing OpenWrt ====

You need to setup a tftp server on some host (I can suggest to use dnsmasq for this) to serve the firmware image to the router.

You need to setup a tftp server on some host (I can suggest to use dnsmasq for this) to serve the firmware image to the router.

+

If you use Windows you can use tftpd32 to configure the tftpd server and the directory shared (you must connect also by lan your router and your pc).

Now just download the image for //AGV2+W// from [[http://​downloads.openwrt.org/​snapshots/​trunk/​brcm63xx]],​ skip the jffs2 with 64k erase block as the flash use 128k block, anyway using 64k should not give much problem, just some wasted space and some errors messages. Put the choose image in the right place (see your tftp server configuration),​ and go to the CFE prompt.

Now just download the image for //AGV2+W// from [[http://​downloads.openwrt.org/​snapshots/​trunk/​brcm63xx]],​ skip the jffs2 with 64k erase block as the flash use 128k block, anyway using 64k should not give much problem, just some wasted space and some errors messages. Put the choose image in the right place (see your tftp server configuration),​ and go to the CFE prompt.

Now you have to use the //​flashimage//​ command to load the openwrt image, please don't use the //f// command. If you configure (with command //c//) the host ip address you can avoid it in the //​flashimage//​ argument.

Now you have to use the //​flashimage//​ command to load the openwrt image, please don't use the //f// command. If you configure (with command //c//) the host ip address you can avoid it in the //​flashimage//​ argument.

+

To get the CFE prompt you must turn on you router and when you see a countdown and you must press '​enter'​.

<​code>​

<​code>​

CFE> flashimage

CFE> flashimage

eg. flashimage [hostip:​]compressed_image_file_name

eg. flashimage [hostip:​]compressed_image_file_name

+

</​code>​

</​code>​

Line 222:

Line 208:

</​code>​

</​code>​

-

===== Picture with highlighted Serial and Jtag =====

-

{{:​inbox:​alice-agpf.jpg}}

+

===== Specific OpenWrt configuration =====

+

==== Working as Access Point Router ====

+

+

=== Network config (lan 4 = wan)===

-

===== Specific OpenWrt configuration example =====

-

====== Network/Led configuration as Access Point======

I can suggest you to use Alice gate with the following network configuration using serial console:

I can suggest you to use Alice gate with the following network configuration using serial console:

For more info read [[doc/​uci/​network/​switch]] config.

For more info read [[doc/​uci/​network/​switch]] config.

+

+

You have to use the "​vi"​ editor to edit the file ect/​config/​network . To save what you write you must press Esc, then write :w and then press enter to save (CTRL + Z to exit without save).

+

<​code>​

<​code>​

config interface loopback ​

config interface loopback ​

Line 266:

Line 256:

</​code>​

</​code>​

-

===== Leds config =====

+

With the configuration above: ​

+

* The LAN 4 port became a WAN port.

+

* LAN port 1, 2, 3 and Wireless are swithed togheter.

+

* You can connect with your router at the address 192.168.5.1 using telnet protocol or your browser (note: OpenWrt Attitude Adjustment 12.09 is builded with the web interface '​luci'​).

+

+

+

=== Leds config ===

+

+

+

Inside /​etc/​config/​system add:

Inside /​etc/​config/​system add:

<​code>​

<​code>​

Line 288:

Line 287:

</​code>​

</​code>​

-

====== Network/Led configuration ​as Client Device ======

+

+

+

==== Working ​as Client Device ====

+

+

=== Wireless config ​===

<​code>​

<​code>​

Line 311:

Line 315:

</​code>​

</​code>​

+

+

=== Network config ===

+

Follow the network config with dhcp enabled on eth interfaces

Follow the network config with dhcp enabled on eth interfaces

Line 353:

Line 360:

option _orig_bridge '​false'​

option _orig_bridge '​false'​

option proto '​dhcp'​

option proto '​dhcp'​

+

</​code>​

+

+

+

=== Led config ===

+

+

Follow the same configuration of access point router.

+

+

==== Working as 3G/4G Router ====

+

+

To use you usb modem you have to:

+

+

- install luci (if not installed)

+

- install some packages to manage usb modem and other device ​

+

- configure your connection using luci

+

+

+

=== Necessary packages ===

+

+

you have to install tfollowing packages:

+

+

kmod-usb-acm

+

kmod-usb-net

+

kmod-usb-net-sierrawireless

+

kmod-usb-ohci

+

kmod-usb-serial

+

kmod-usb-serial-option

+

kmod-usb-serial-qualcomm

+

kmod-usb-serial-sierrawireless

+

kmod-usb-uhci

+

kmod-usb2

+

luci-proto-3g

+

ppp

+

ppp-mod-pppoe

+

wpad-mini

+

usb-modeswitch

+

usb-modeswitch-data

+

procps ​

+

wireless-tools

+

+

=== Luci configuration ===

+

+

You have to go to Network | Interface | Wan. Then swith to 3G Protocol (select UMTS/​GPRS/​EV-DO). Select the port of you modem (try all available port), your service, insert you APN, Pin, Username and Password. Finally save you configuration.

+

+

=== Net config example ===

+

+

This is the extracted network configuration for a ZTE MF680 modem:

+

<​code>​

<​code>​

+

config interface '​loopback' ​

+

option ifname '​lo' ​ ​

+

option proto '​static' ​

+

option ipaddr '​127.0.0.1' ​

+

option netmask '​255.0.0.0'​

+

+

config switch '​eth1' ​

+

option enable '​1' ​ ​

+

option enable_vlan '​1' ​

+

option reset '​1' ​

+

+

config switch_vlan '​vlan0' ​

+

option vlan '​0' ​ ​

+

option device '​eth1' ​ ​

+

option ports '0 1 2 5*' ​

+

​

+

config switch_vlan '​vlan1' ​ ​

+

option vlan '​1' ​

+

option device '​eth1' ​ ​

+

option ports '3 5t' ​

+

config interface '​lan' ​

+

option ifname '​eth1.0' ​

+

option type '​bridge' ​

+

option proto '​static' ​

+

option ipaddr '​192.168.5.1'​

+

option netmask '​255.255.255.0'​

+

option nat '​1' ​ ​

+

​

+

config interface '​wan' ​ ​

+

option _orig_ifname '​eth1.1' ​

+

option _orig_bridge '​false' ​

+

option proto '​3g' ​

+

option device '/​dev/​ttyUSB2' ​ #MAYBE YOU HAVE TO CHANGE THIS

+

option service '​umts' ​

+

option apn 'YOUR APN'

+

option username 'YOUR USERNAME'​

+

option password 'YOUR PASSWORD' ​

+

</​code>​

+

+

=== Led config ===

+

You have to add the following code to etc/​config/​system:​

+

+

<​code>​

+

+

config led ​

+

option sysfs '​AGPF-S0:​green:​power' ​

+

option name '​on' ​ ​

+

option default '​1' ​ ​

+

option trigger '​default-on' ​

+

​

+

config led ​

+

option name '​lan' ​

+

option sysfs '​AGPF-S0:​green:​wifi' ​

+

option trigger '​netdev' ​

+

option default '​0' ​ ​

+

option dev '​wlan0' ​

+

option mode 'tx rx' ​ ​

+

+

config led

+

option name '​wan' ​ ​

+

option trigger '​netdev' ​ ​

+

option sysfs '​AGPF-S0:​green:​internet'​

+

option default '​0' ​

+

option dev '​3g-wan' ​ ​

+

option mode '​link' ​

+

+

</​code>​

+

+

=== Other suggestions ===

+

+

Usb modem are not builded to stay turned on 24h/7d, so you could have problem like loss of connection or burned usb modems :-( . The problem is not your router, but in the original (normal) use of 3g modems. ​

+

A good solution is to buy an extention flat usb cable (A-male to B-female) and put your modem in your refrigerator (it maybe strange but 100% works).