WWW.DUMAIS.IO

NGW100 - Getting startedLast edited on Feb 25, 2012

Installing the development environment

I wrote this howto because everywhere I was looking , people kept talking about the "buildroot". I didn't want that. I just wanted the basic stuff to get me going and do standalone development without installing all the linux kernel files and libc etc...

First, download these files:

  • AVR32_Header_Files.zip
  • binutils-2.18.atmel.1.0.1.tar.bz2
  • gcc-4.2.2.atmel.1.1.3.tar.bz2

1 - compile binutils

./configure  --prefix=/opt/avr32 --program-prefix=avr32- --target=avr32-linux
make
make install

Now add the /opt/avr32/bin path in your PATH. I installed that in /opt/avr32 and all the applications are prefixed with "avr32-" (avr32-ar, avr32-as etc)

2 - compile GCC

mkdir build
cd build
../configure --target=avr32-linux --prefix=/opt/avr32 --enable-languages=c --disable-threads --disable-libmudflap --disable-libssp --disable-libgomp --program-prefix="avr32-"
make
make install

3 - copy the header files

Now unzip the header files in /opt/avr32/avr32-linux/include (the "include" folder will need to be created first)

4 - Make a test application

I made this code as a test application that flashes a led on the board. Compile it using this Makefile and see if it works

5 - upload the test application on your device

The first thing to do is to connect the board using a serial port. By default communication is established at 115200 8N1. when booting the device, you have 1second to press "space" to get in the uboot prompt. I connected the "lan" port of the device to my switch and entered the following commands:

setenv tftpip 192.168.1.3
setenv serverip 192.168.1.36
setenv bootcmd 'set ipaddr 192.168.1.37;tftpboot 0x24004000 firmware.bin;go 0x24004000'
saveenv

the bootcmd variable tells uboot what to do at boot time. In this case, it will connect to the tftp server located at the address provided in 'tftpip' and download "firmware.bin" and store it at memory location 0x24004000. After that, it will jump to that address.

If you're trying to upload in flash memory, you need to unprotect a whole block, erase it and write to it. Blocks are 64k in size and alligned on 64k boundaries. So let's say we want to copy our firmware at 0x100000 (23rd sector in parallel flash chip) we would do the following. Assume that the firmware has been downloaded to 0x24004000 first and is 0x242 byte in size:

protect off 0x100000 0x10ffff
era 0x100000 0x10ffff
cp.b 0x24004000 0x100000 242
protect on all


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 0.0.0.0 0.0.0.0 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 10.0.0.0/24 network
VLAN 3 hosts the 10.0.3.0/24 network
VLAN 10 hosts the 10.0.10.0/24 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 10.0.0.1 255.255.255.0
 ip access-group 101 in
 no ip unreachables
 ip nat inside
 ip virtual-reassembly
!
interface FastEthernet0/0.3
 encapsulation dot1Q 3
 ip address 10.0.3.0 255.255.255.0
 ip access-group 103 in
 no ip unreachables
 ip nat inside
 ip virtual-reassembly
!
interface FastEthernet0/0.10
 encapsulation dot1Q 3
 ip address 10.0.10.0 255.255.255.0
 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 10.0.0.0 0.0.0.255 10.0.10.0 0.0.0.255
access-list 100 permit ip any any
access-list 100 permit udp any any

access-list 103 deny   ip 10.0.3.0 0.0.0.255 10.0.10.0 0.0.0.255
access-list 103 permit ip any any
access-list 103 permit udp any any

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

DHCP

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

! only hand out ip addresses from 10.0.0.100-10.0.0.149
ip dhcp excluded-address 10.0.0.1 10.0.0.99
ip dhcp excluded-address 10.0.0.150 10.0.0.255
! only hand out ip addresses from 10.0.3.100-10.0.3.149
ip dhcp excluded-address 10.0.3.1 10.0.3.99
ip dhcp excluded-address 10.0.3.150 10.0.3.255
! only hand out ip addresses from 10.0.10.100-10.0.10.149
ip dhcp excluded-address 10.0.10.1 10.0.10.99
ip dhcp excluded-address 10.0.10.150 10.0.10.255
ip dhcp pool pool_vlan1
   import all
   network 10.0.0.0 255.255.255.0
   default-router 10.0.0.1
   dns-server 10.0.0.1
ip dhcp pool pool_vlan3
   import all
   network 10.0.3.0 255.255.255.0
   default-router 10.0.3.1
   dns-server 10.0.3.1
ip dhcp pool pool_vlan10
   import all
   network 10.0.10.0 255.255.255.0
   default-router 10.0.10.1
   dns-server 10.0.10.1


DNS

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 10.0.0.4:80
ip nat inside source static tcp 10.0.0.4 80 interface Dialer1 80
! enable NAT on Dialer1 interface
ip nat inside source list 1 interface Dialer1 overload
access-list 1 permit 192.168.0.0 0.0.255.255


SpeedTouch 780 DocumentationLast edited on Feb 25, 2012



Pages:123456789101112