AVR32 OS for NGW100Last edited on Feb 25, 2012

These pages are meant to describe the AVR32 architecture and how to do standalone development. This is basically a collection of notes that I am writting to help myself. Ususally I would do that in a text file on my computer but this time I said to myself "Why not share it with everyone?". It is hard to find information about this as everyone is talking about linux development everywhere. If you search on google, chances are that you will land on a forum where a guy asked the exact same question you were asking yourself and someone will have answered "Look on the internet" so you will be back to square one. So I decided to write my own web page as I learn to get my project going. Basically what I want to do is to build an OS for the NGW100 board.

Development is done in assembly language. It is easier to know what you are actually doing and it is more fun. You won't find a lot of resources on how to get you started with ASM for this CPU. Again, everyone is talking about Linux and C/C++, which is fine, but not usefull for what I am doing.

So I hope this information can be usefull to someone else. And if you see something wrong with what I am doing please tell me. I want this information to be accurate, and I want my OS to work.

That article does not exist

cisco router configurationLast edited on Feb 25, 2012

My private network is built around a cisco 2620xm router and a cisco catalyst 3448-XL My router's image is c2600-adventerprisek9-mz.124-25c.bin, and for the switch: c3500xl-c3h2s-mz.120-5.WC17.bin.

DSL connection

My router has a WIC-1ADSL card. Using this, I can connect with my ISP. Note that these settings might only work for my ISP (Teksavvy, in ottawa)

vpdn enable
no ip cef
interface ATM0/0
 no ip address
 atm restart timer 300
 no atm ilmi-keepalive
 bundle enable
 dsl operating-mode auto
 hold-queue 224 in
 pvc 0/35
  pppoe-client dial-pool-number 1
interface Dialer1
 ip address negotiated
 ip access-group 120 in
 ip mtu 1492
 ip nat outside
 ip nat enable
 ip virtual-reassembly
 encapsulation ppp
 ip tcp adjust-mss 1452
 dialer pool 1
 dialer-group 1
 no cdp enable
 ppp authentication pap callin
 ppp pap sent-username your_username password 0 your_password
 ppp ipcp dns request accept
 ppp ipcp address accept
ip forward-protocol nd
! set default route to go through Dialer1 interface
ip route Dialer1

! deny telenet access from outside.
access-list 120 deny   tcp any any eq telnet
access-list 120 permit tcp any any
access-list 120 permit ip any any
dialer-list 1 protocol ip permit

With these settings, your DSL connection should come up. Any host from the outside of your network will be able to access TCP ports (except 23) on your network. More details on NAT will follow.

VLAN trunking

Consider the following configuration:
VLAN 1 hosts the network
VLAN 3 hosts the network
VLAN 10 hosts the network
VLAN 1 and VLAN3 can talk to each other and to the WAN
VLAN 10 can only talk to the WAN

interface FastEthernet0/0.1
 encapsulation dot1Q 1 native
 ip address
 ip access-group 101 in
 no ip unreachables
 ip nat inside
 ip virtual-reassembly
interface FastEthernet0/0.3
 encapsulation dot1Q 3
 ip address
 ip access-group 103 in
 no ip unreachables
 ip nat inside
 ip virtual-reassembly
interface FastEthernet0/0.10
 encapsulation dot1Q 3
 ip address
 ip access-group 110 in
 no ip unreachables
 ip nat inside
 ip virtual-reassembly

A subinterface (ie: 0.10) defines a vlan. In this setup, interface 0 is configured to handle VLANs 1,3 and 10 by separating it in 3 different sub-interface. Note that with this configuration, nothing more needs to be done for inter-vlan routing. By assigning an IP paddress to subinterfaces, you tell the router how to route between vlans.

With this configuration, all 3 networks will be able to talk to each other. To prevent VLAN10 to talk to VLAN 1 and 3, you could do the following:

access-list 100 deny   ip
access-list 100 permit ip any any
access-list 100 permit udp any any

access-list 103 deny   ip
access-list 103 permit ip any any
access-list 103 permit udp any any

access-list 110 deny   ip
access-list 110 deny   ip
! deny telneting in gateway from guest network
access-list 110 deny   tcp host eq telnet
access-list 110 permit ip any any
access-list 110 permit udp any any


The following configuration will setup a DHCP server on the router with a different pool for each networks.

! only hand out ip addresses from
ip dhcp excluded-address
ip dhcp excluded-address
! only hand out ip addresses from
ip dhcp excluded-address
ip dhcp excluded-address
! only hand out ip addresses from
ip dhcp excluded-address
ip dhcp excluded-address
ip dhcp pool pool_vlan1
   import all
ip dhcp pool pool_vlan3
   import all
ip dhcp pool pool_vlan10
   import all


To use the cisco router as a DNS forwarder, the following simple configuration can be usd

ip dns server

NAT / Port forwarding

I never got port range forwarding to work on my router. I ended up writing 100 lines for a range of 100 ports. But this is not shown here for for sake of simplicity

ip nat translation timeout 3600
ip nat translation tcp-timeout 1200
ip nat translation finrst-timeout 15
ip nat translation syn-timeout 45
! forward port 80 to
ip nat inside source static tcp 80 interface Dialer1 80
! enable NAT on Dialer1 interface
ip nat inside source list 1 interface Dialer1 overload
access-list 1 permit

SpeedTouch 780 DocumentationLast edited on Feb 25, 2012

SPA941 PhoneBookLast edited on Feb 25, 2012

Personal Directory

An annoying thing with that phone is that it is impossible to provision the phone directory automatically. The good thing is, you can fill the list from the web page of the phone. So then, with wireshark I looked at how this information is posted. All you need is the following script that will simulate a browser submitting the list of numbers. You might wanna check the list of input fields ID, I am not sure if they will be the same on each devices depending on firmware version.

$fields = Array("43311","43503","43439","44655","44591","44783","44719","44911","44847","45039",

$conn = mysql_connect("localhost","username","password");
$query = "SELECT * FROM phonebook ORDER BY name;";
$result = mysql_query($query);

$n = mysql_num_rows($result);
while ($record = mysql_fetch_assoc($result)) {
        $name = $record['name'];
        $phone = $record['phone'];
        $name = urlencode($name);
        $field = $fields[$i];
        $list .= "$field=n%3D$name%3Bp%3D$phone";

        if ($i<$n) $list .= "&";

system("wget --post-data '$list' -t 1");

Executing that script will fetch all entries in the mysql server and post them on the phone located at