AVR32 Linux Development/Bootup and system configurations

From AVRFreaks Wiki

Jump to: navigation, search

The following documentation applies equally to NGW100 and STK1000. STK1000 will default boot from the SD-card while NGW100 has the Linux kernel and filesystem stored on on-board flash.


Contents

Boot sequence

When the AP7000 is powered on, or reset, it will start executing code from address 0x00000000. On STK1000 an, the onboard flash is mapped to this address. The beginning of flash contains the U-Boot bootloader, which in turn accesses the ext2 filesystem on the supplied SD card and loads the Linux kernel from the /uImage file.

The Linux kernel first initializes the system resources and drivers for USARTs, Ethernet, LCD controller, MMC (SD), USB etc. Then the first partition on the SD card is mounted as the root filesystem, and /sbin/init is executed. At this stage, the Linux kernel is properly booted and running, and the remaining bootup sequence is controlled by userspace programs.

Init is the first process that starts on a Linux system, and is the (grand)parent of all other processes. Init reads the file /etc/inittab to decide further actions. The default inittab file on the STK1000 Board Support Package executes the /etc/init.d/rcS<code> script on bootup, and umounts filesystems when shutting down.

The <code>/etc/init.d/rcS script will display the AVR32 logo on the LCD and finally run /etc/init.d/network to set up networking.


Network configuration

The network script will by default try to obtain an IP configuration from DHCP. If no IP was obtained, either because no DHCP server responds or the network cable is not attached, no network services will be available, and the only way to use the Linux environment is to connect to the console on UART_A (115200 bauds, 8N1).

The STK1000 Linux environment can be configured as a DHCP server, which is useful for standalone testing with a single PC. This can be done by editing the /etc/init.d/network script and commenting out (prepending a '#' on) the line that reads "DHCP=client". Note that this may cause problems if you connect your STK1000 to a network where other computers use DHCP for network configuration.

Once the network is properly set up, either via DHCP or in the standalone configuration, a telnet server will start, accepting connections from any network address. In addition, an FTP server will accept anonymous connections, allowing remote uploading or downloading of files to the SD card.

The default configuration of the STK1000 Linux environment is to allow any connection without authentication: the administrator user (root) does not even have a password. To avoid unauthorized access to the STK1000 and the files on the SD card, it is recommended that the STK1000 either be used in a protected environment, or that the root user be given a password with the passwd command.


Finding your IP address

To determine the IP address of the STK1000, you should first connect to the STK1000 serial console as described in the Quick Start guide.

Your IP address can be found by executing the ifconfig command:

~ # ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:6A:87:71:14:CD
          inet addr:10.191.252.106  Bcast:10.191.253.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:85284 errors:933 dropped:0 overruns:0 frame:913
          TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:21702904 (20.6 MiB)  TX bytes:7984 (7.7 KiB)
          Interrupt:25 Base address:0x1800

Network Gateway

The NGW100 configures by default a second network interface: eth1.

eth0 is the WAN side of the gateway configured as a dhcp client as described above. eth1 is the LAN side. The NGW100 has enabled DHCP, DNS and WEB services on the LAN port.

Static version created: 2007-03-07
Copyright (c) 2007 Atmel Corporation