Alyda ?

De domainnaam www.alyda.nl is actief sinds december 2004.

 
Home arrow Tutorials arrow Atmel NGW100
Atmel NGW100

AVR32 Network Gateway 100 development board for getting started with embedded Linux.

Latest update: 3-8-2011

The NGW100

Image


Programming 

Hello World

#include <stdio.h>
int main(int argc, char** argv)
{
       printf("Hello World!\n");
       return 0;
}

Save the file as Hello_World.c

Compile the Hello World code using:
/buildroot-avr32-v2.3.0/build_avr32/staging_dir/usr/bin/avr32-linux-gcc -pipe -O3 -g -Wall -mcpu=ap7000 -D_GNU_SOURCE  -c -o Hello_World.o Hello_World.c

Link using:
/buildroot-avr32-v2.3.0/build_avr32/staging_dir/usr/bin/avr32-linux-gcc -pipe -O3 -g -Wall -mcpu=ap7000 -o Hello_World Hello_World.o

Copy Hello_World to the NGW100. Make sure the Hello_World is executabe (if not use "chmod 755 Hello_World") and run.

Top 

Reading pin PB00 and...

This example defines pin PB00 (J5 pin 24) as input and then reads its status. The pin status is printed on screen and passed through to the onboard SYS A LED. If PB00 is low then the SYS A LED is switched off. If PB00 is high then the SYS A LED is switched on. Pin PB00 is polled every 0.5 sec. Press CTRL-C to abort the program. For pulling PB00 up or down I used a 1K resistor (less or higher value will do to).
Note: since the GPIO-DEV method of I/O is depriciated this example uses the gpio-sysfs method. Make sure to use kernels 2.6.27 or later.

Image   Image   Image    (click to enlarge)

Source codebinary of example program

Top

IO module

Users can not access hardware directly on the NGW100 board. All hardware is shielded by the kernel (kernel space) from users (user space). For a user to be able to control hardware a module can be written. This module is loaded in the kernel and hardware can be controlled in user space via this module.
This example shows a (kernel space) module that can control SYS LED A, reads all PORT A pins and contains a (user space) program that controls SYS LED A and displays the PORT A value. Download all source, make en kbuild files from here. The zip file contains the module source files IOctrl.c, IOctrl.h, IOdev.c, IOdev.h, IOmodule.c and the Makefile and Kbuild files for building the module. The zip file also contains the source of a (user space) program that controls the module. A little note, the Makefile assums that your development system is set up descripted as in chapter "The development environment". If not, adapt the path in the Makefile so that it reflects your environment.
Extract the files from the zip file and use make. This should compile the module IOtest.ko. Make together with the Kbuild file creates the module using:
  make ARCH=avr32 CROSS_COMPILE=avr32-linux- -C "/buildroot-avr32-v2.3.0/project_build_avr32/atngw100/linux-2.6.27.6" M=`pwd`

The Kbuild file contains the lines:
  obj-m := IOtest.o
  IOtest-y := IOmodule.o IOctrl.o IOdev.o

Make compiles and links IOmodule, IOctrl and IOdev and creates module IOtest.ko.
When the module is succesfully created then copy IOtest.ko to your NGW100 target and use:
  insmod IOtest.ko                         load the module
  mknod /dev/IOdev c 188 0         create a device file (use "cat /proc/devices" to see if the device is created)
  echo '1' > /dev/IOdev                 SYS LED A should turn on
  echo '0' > /dev/IOdev                 SYS LED A should turn off
  rmmod IOtest.ko                         unload the module

Also included in the zipfile is a source file that, when compiled, controls the above device /dev/IOdev when loaded and created. Use IOdev_test '1' to switch SYS LED A on and use IOdev_test '0' to switch SYS LED A off. IOdev_test also returns the pin states of PORT A.
Compile IOdev_test.c using:
   /buildroot-avr32-v2.3.0/build_avr32/staging_dir/usr/bin/avr32-linux-gcc -pipe -O3 -g -Wall -mcpu=ap7000 -D_GNU_SOURCE  -c -o IOdev_test.o IOdev_test.c

and use:
  /buildroot-avr32-v2.3.0/build_avr32/staging_dir/usr/bin/avr32-linux-gcc -pipe -O3 -g -Wall -mcpu=ap7000 -o IOdev_test IOdev_test.o

This should create the program IOdev_test. Upload the program to your NGW100 target, load the module and create a device as descripted above and run IOdev_test.

Image

Some links:
The Linux Kernel Module Programming Guide    http://www.tldp.org/LDP/lkmpg/2.6/html/index.html
LINUX Device Drivers 3rd edition (O'Reilly)        http://oreilly.com/catalog/9780596005900
The 'Free Bird' project                                        http://avr32linux.org/twiki/bin/view/Main/PramodeCE

 Top

LCD module

On the AVR32 Linux Wiki there's an artical from Carlos Becker "Building a Linux module - Interfacing a character LCD display". I've used his artical as a start for the LCD module. I wired a Seiko L2014 20x4 LCD to the NGW100 as Carlos Becker describes in his article and made alterations to his code. Included there's a test program that shows how to communicate with the LCD module. If you want to compile the code I assume that your development system is set up descripted as in chapter "The development environment". If not, adapt the path in the Makefile so that it reflects your environment. What to do? Download all source codes, make and Kbuild files from here and extract in a folder. Connect the LCD to your NGW100 using Carlos instructions:

Image

Please note that VCC = + 5V.

Run make and if all goes well a module named lcddev.ko is created. Copy lcddev.ko to your NGW100 board and use 'insmod lcddev.ko'. On the LCD should appear "LCD module loaded". If your LCD has other dimensions then alter in lcd.h, LCD_LINES and LCD-CHARPERLINE and recompile the module.

 Image    (click to enlarge)

If you want to echo a string to the display use:
  insmod lcddev.ko                          load the module
  mknod /dev/lcddev c 101 0           create a device file (use "cat /proc/devices" to see if the device is created)
  echo 'Hello world' > /dev/lcddev   Helo world should appear on the LCD
  rmmod IOtest.ko                            unload the module

I've changed the code from Carlos here and there. In the original article a two line LCD was connected where I use a four line display. Using a four lines display means that some code needs to be added to make sure that you're on the correct line. Newline ('\n') is recognized and additional control characters are include. Control characters are:
   \n : jump to next line
   \c : clear LCD
   \ln : clear line n
Note that the control characters need to be the first characters of the string with the exception of the \n control string. \n can be used on user specified positions.

Last a test.c is included. This test.c shows you how to open the LCD device and write characters to it. When you want to use the test program make sure you create a device (mknod /dev/lcddev c 101 0), see also above.

If you don't want to compile you can download the lcddev.ko module and test program also.

Image

Top


NGW100 internals

Change default IP address

The default IP-address of the NGW100 is 10.0.0.1. Changing this IP-address to another address involves changing severals files. In this example we change the default IP-address 10.0.0.0 into IP-address 192.168.1.92.
The WAN port (eth0) will receive IP-addresses from a DHCP server. The LAN port (eth1) not.
Connect with the NGW100 board via a telnet session. Connect to 10.0.0.1. If your network is not in the 10.0.x.x range connect the NGW100 via an ethernet cable directly to your computer. Make sure the computer can change it's IP-address dynamically.
Open the /etc/init.d/S10networking file and scroll down to the location where LAN-port eth1 is about to be configured. Change the 10.0.0.1 address in 192.168.1.92.
Change the default gateway route address. Add the line "route add default gw 192.168.1.1" in the file /etc/init.d/rcS after the S10networking check.
Go to directory /etc/network and copy the original interfaces file to interfaces.org for save keeping. Open the interfaces file with the vi-editor.
  cd /etc/network
  cp interfaces to interfaces.org
  vi interfaces

Change the eth1 parameters to match your network. I.e.:
  address 192.168.1.92
  netmask 255.255.255.0
  network 192.168.1.0
  broadcast 192.168.1.255
  gateway 192.168.1.1

To be able to access the NGW100 via a webbrowser, change the IP-address in the file /etc/httpd.conf from 10.0.0.1 into 192.168.1.0.
Change in the file /www/index.html the Samba web address from 10.0.0.1 to 192.168.1.92.
Change in the file /etc/samba/smb.conf the line hosts allow = 10.0.0. 127 into hosts allow = 192.168.1. 127

Top

Booting from SD-card

For booting from a SD-card you need a small capacity SD-card, a compiled development environment as discripted in The development environment, a serial connection between a computer and the NGW100. Download from http://www.atmel.no/buildroot/buildroot-bin.html under Binary images for NGW100 the tar-ball (rootfs.avr32.tar.bz2, version 2.3.0, updated 20081218).
Format, in Ubuntu, the SD-card with an ext2 file system (see Format SD-card). In Ubuntu enter the following commands:

  mkdir /sd
  mount /dev/sdb1 /sd  (if automount doesn't mount the sd-card)
  cd /sd

  tar xjvf <location tar-ball>/rootfs.avr32.tar.bz2 

Place in the file /sd/etc/fstab a comment (#) sign before the line:
  mtd3   /usr   jffs2   defaults   0   0

  cd /
  umount /sd

Place the SD-card into the NGW100, connect the serial cable to the NGW100 and boot the board.
Press space bar within one second to abort booting kernel and enter the following commands:

Uboot> set bootargs 'console=ttyS0 root=/dev/mmcblk0p1 rootwait'
Uboot> set bootcmd 'mmcinit; ext2load mmc 0:1 0x10300000 /boot/uImage; bootm'
Uboot> saveenv

NOTE: when using "saveenv" the boot arguments are stored in flash, meaning Uboot boots from SD-card from now on.

Using Uboot's printenv the Uboot environment variables are displayed.

To restore the orginal Uboot environment variables at the Uboot prompt use:

Uboot> set bootargs 'root=/dev/mtdblock1 rootfstype=jffs2 rootwait'
Uboot> set bootcmd 'fsload uImage;bootm' 
Uboot> saveenv

Note: If booting fails on error:

find_inode failed for name=uImage
load: Failed to find inode
### JFFS2 LOAD ERROR<0> for uImage!
Wrong Image Format for bootm command
ERROR: can't get kernel image!

Then try:

Uboot> set bootcmd 'fsload /boot/uImage;bootm'
Uboot> saveenv

What do the commands mean:

 mmcinit Initialize the MMC/SD-card 
 ext2load mmc 0:1 0x10300000 /boot/uImage Load uImage file from the MMC/SD-card to memory location 0x10300000
 bootm boot from memory

Top

Upgrading U-boot firmware

IMPORTANT: if the following process fails your stuck with a brick.... The only things that helps is a JTAG programmer to restore Uboot.

For upgrading your NGW100 firmware from a SD-card you need a small capacity SD-card and serial connection between a computer and the NGW100.
Copy from http://www.atmel.no/buildroot/buildroot-u-boot.html the "flash-upgrade image" for the ATNGW100. You have downloaded a file called "flash-upgrade-atngw100-v2008.10.uimg" (downloaded 07-02-2010).
Format, in Ubuntu, the SD-card with an ext2 file system (see Format SD-card). After formatting the SD-card copy the "flash-upgrade-atngw100-v2008.10.uimg" file to the SD-card. After umounting the SD-card insert the SD-card into the NGW100, connect the serial cable to the NGW100 and boot the board.
Press space bar within one second and use the following commands:

mmcinit
ext2load mmc 0:1 0x10400000 /flash-upgrade-atngw100-v2008.10.uimg
bootm 0x10400000

See also: http://avr32linux.org/twiki/bin/view/Main/FlashUpgradeUsage
 

Top

Upgrading NGW100

We will perform a upgrade of the NGW100 from SD-card. First make a bootable SD-card as descripted in "Booting form SD-card". Download from http://www.atmel.no/buildroot/buildroot-bin.html the JFFS2 root image and JFFS2 usr image file. Copy both images files to the SD-card.
Place the SD-card into the NGW100, connect the serial cable to the NGW100 and boot the board.
Press space bar within one second to abort booting kernel and enter the following commands:

Uboot> set bootargs 'console=ttyS0 root=/dev/mmcblk0p1 rootwait'
Uboot> set bootcmd 'mmcinit; ext2load mmc 0:1 0x10300000 /boot/uImage; bootm'
Uboot> saveenv
Uboot> boot

The NGW100 will now boot from your SD-card.

To flash and upload the new kernel and usr environment use:

~# flash_eraseall /dev/mtd3
~# flash_eraseall /dev/mtd1
~# dd if=/rootfs.avr32.jffs2-root of=/dev/mtd1 bs=1024
~# dd if=/rootfs.avr32.jffs2-usr of=/dev/mtd3 bs=1056
~# reboot

Press space bar within one second to abort booting kernel and enter the following commands:

Uboot> set bootargs 'root=/dev/mtdblock1 rootfstype=jffs2 rootwait'
Uboot> set bootcmd 'fsload uImage;bootm' 
Uboot> saveenv

Note: If booting fails on error:

find_inode failed for name=uImage
load: Failed to find inode
### JFFS2 LOAD ERROR<0> for uImage!
Wrong Image Format for bootm command
ERROR: can't get kernel image!

Then try:

Uboot> set bootcmd 'fsload /boot/uImage;bootm'
Uboot> saveenv

You need to change the Uboot bootcmd environment setting because uImage is moved to directory /boot.

Top

Time and Date

By default, the ngw100 is configured to display UTC time only. Setting the proper timezone is different in busy box linux compared to full blown distros. To have the ngw100 display the time for your location, you just create a /etc/TZ file with the proper string in it. Here are a few examples:

echo EST5EDT > /etc/TZ
echo CST6CDT > /etc/TZ
echo CET-1CEST-2 > /etc/TZ

The first example sets the timezone for the Eastern US timezone. The second example is for the Central US timezone.

Source: http://www.avrfreaks.net/wiki/index.php/Documentation:NGW/FirstSteps#Time_and_Date

Top


Webserver

httpd is started from file /etc/init.d/S42httpd
httpd configuration file /etc/httpd.conf

Protecting the NGW100 website with username and password
Add in /etc/httpd.conf a line containing /path:user:password

 Top


Samba

Samba config file /etc/samba/smb.conf
Samba logging files /var/log/samba/log.smbd or log.nmbd

Start, stop, restart Samba: /etc/init.d/S91smb [start|stop|restart]

Creating a new Samba user:

First create a Linux user using:

adduser -h /media -s /bin/sh -G users -H <username>

-h: Home directory; /media
-s: Login shell; /bin/sh
-G: Group,add user to group; users (see /etc/group for available groups)
-H: do not create home directory

Password is asked when using adduser command. Password is placed in /etc/passwd file.

Next make a Samba entry using:  smbpasswd -a <username>

Password is asked when using smbpasswd command. Password is placed in /etc/samba/smbpasswd

Other smbpasswd options:

 Remove a user   smbpasswd -x <username>
 Disable a user smbpasswd -d <username>
 Enable a user  smbpasswd -e <username>
 Help smbpasswd -h
  

Swat
With Swat you can configure Samba via a web interface. Swat can be reached using: http://{IP-address NGW100}:901
Note: when using Swat for configuration of Samba the /etc/samba/smb.conf file is changed. This means all comments you have added in the smb.conf file will be removed.
Swat is started in the /etc/inet.d. Inetd, called also the super server, will load a network program based upon a request from the network. The inetd.conf file tells inetd which ports to listen to and what server to start for each port.

More Samba info: The official Samba HOWTO and reference guide

Top



Things you might want to need to know

- use a DC-power supply that can deliver about 150mA. The NGW100 uses about average approx.120mA/9V. Polarity is not (!) important. A onboard rectifier will correct the polarity (at least with my board....).

- Booting takes about 50 sec. When the booting of the out of the box NGW100 is finished, a red LED will be switched on.

- the out of the box ethernet address on the LAN ethernet connector is 10.0.0.1. Use an ethernet cable to connect the NGW100 to your computer. Make sure the IP-address of your computer is not fixed. The NGW100 will supply an address to your computer.

- the development board I received on december 2009 had (see /var/log/messages)
    U-Boot 1.1.4-at0 (Jan  3 2007 - 10:30:09)
    Linux-2.6.18-atngw   (/dev/mtdblock1, root fstype=jffs2)
    jffs2 version 2.2
    BusyBox v1.4.2
    gcc version 4.1.2-atmel.0.0.90

- Out-of-the-box username: root, password: roota

- How to mount your SD-card on the NGW100: mount /dev/mmcblk0p1 /media/mmcblk0p1 

- How to mount the NGW100 from Ubuntu? Make sure the NGW100 exports /netdisk using Samba. We will mount the directory /NGW100 in Ubuntu using command   mount -t cifs -o username=root,password=roota //<IP-address NGW100>/netdisk /NGW100

- Use 'poweroff' to shutdown the NGW100 gracefully.

Top 

 


FAQ

General
- mapping NGW100 from Windows
  net use [drive letters] \\<IP-address NGW100>\netdisk   Username: root, password: roota
  The directory mounted is /media (check /etc/samba/smb.conf).

- baudrate console port is 115200 baud

AVR32 Studio
- How do I remove a set Workspace directory.
  Window -> Preferences -> expand General -> expand Startup and Shutdown and select Workspaces

- How do I restore the Welcome page in AVR32 Studio
  Help -> Welcome

- I want to reset the complete AVR32 IDE (the hard way).
  Remove the .metadata directory from your Workspace directory

Top


Links


- Avrfreaks, Avrfreaks home page
- AVRfreaks Wiki, AVR32 Wiki page
- Buildroot, Buildroot info
- Atmel Buildroot for AVR32, Atmels binaries for the NGW100
- Uboot command reference

- CGI tutorial
- Getting Started with CGI Programming in C
- Graphical CGI-script GRAPH

- The official Samba HOWTO and reference guide

Top


The development environment

Progress goes fast. And that's always the problem when making these type of tutorial sites. When you sorted out how things work new software is available that renders previous work obsolete. I figured out how to create applications for the NGW100 with certain software versions and it works. However this means you will not have the latest version and updates of certain parts could disable the complete procedure. 
For developing applications, Atmel has a nice free Windows based Integrated Development Environment (IDE) available, called AVR Studio. Unfortunately AVR Studio is not capable generating code for applications that run on the NGW100 Linux OS. What you need is a Linux environment for developing applications. Before you click away, this tutorial gives a step by step description what to do. Even if you have never used Linux (altough I presume you have a little bit of Linux/Unix knowledge). This description will install a Virtual Machine, running Ubuntu, on your Windows computer. Shows you how to install the Atmel developing software. Create, compile and deploy a Hello World applications on your NGW100. Simply follow the instructions.
Setting up your development environment is split up into two parts. Part one describes the step-by-step approach. Basically showing how things are done. The second part is an automated configuration. For this I've created two packages and a install script file. The two packages contain all things needed for doing an off-line installation. Please don't shoot me for creating these two packages. I've no intention to earn money and/or I certainly don't want to infringe any law by distributing these package. I simply want to make live easy. Last you need of course the NGW100 development board.

I've set up the development enviroment using the following components and settings:
- Windows XP (Intel based). No idea what happens on an AMD based platform......
- install Ubuntu 9.0.4 (other vesions will give errors when creating the developing environment ) on a Virtual Machine
  using VMWare (see Installing Ubuntu)
- enable root on the Ubuntu OS (how to read become root)
- some basic Linux (Unix) knowledge
- an online internet connection for the first installation approach
- downloaded packages which I created for the second installation approach

For more information about files and directory structure of Buildroot look here or download the pdf.

Top

General setup

Download, the free, VMware Player form http://www.vmware.com. There are all kinds of VMware products available (Server, Workstation, etc.), the Player will do. I've used version 3.0. Later versions can be used, I hope, without any problem. Install the VMware Player on your Windows computer.
Next find somewhere on the net the iso image of Ubuntu 9.0.4 desktop (ubuntu-9.04-desktop-i386.iso, aprox. 720Mb). Start VMware player and install Ubuntu 9.0.4. If you don't know how, follow the steps descripted in Installing Ubuntu. During installatin of Ubuntu I didn't upgrade to the latest available version. You could try this when you have a working development environment.
Once Ubuntu is installed, login as root and start a terminal (Applications -> Accessories -> Terminal). If you can't login as root see become root.

Setting up a development environment, approach one

Setting up the AVR32 GNU Toolchain
First avr32-gnu-toolchain needs to be installed. Open the file /etc/apt/sources.list. Append to the end of the file:
  deb http://www.atmel.no/avr32/ubuntu/jaunty binary/
Note: jaunty refers to the Ubuntu development code name (hardy = version 8.04; jaunty = version 9.04; karmic = version 9.10).

Next use:
  apt-get update 
  apt-get install avr32program avr32gdbproxy avr32trace avrfwupgrade libavr32ocd libavrtools libelfdwarfparser
      (note: install packages without verification)

Install the Toolchain package. 
Use:
  apt-get install avr32-gnu-toolchain       (note: install packages without verification)


Installing buildroot
Download buildroot-avr32-v2.3.0.tar.bz2 from http://www.atmel.no/buildroot/buildroot-src.html and place the bz2 file into the root directory. Use:
  bunzip2 buildroot-avr32-v2.3.0.tar.bz2 
  tar xvf buildroot-avr32-v2.3.0.tar
The buildroot distribution will be extracted in the directory /buildroot-avr32-v2.3.0.

Check http://buildroot.uclibc.org/buildroot.html, http://www.atmel.no/buildroot/buildroot-doc.html or
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=625825 for addition information.

Change to directory /buildroot-avr32-v2.3.0 and use:
  make ARCH=avr32 CROSS_COMPILE=avr32-linux- atngw100_defconfig  (atngw100_defconfig uses default setings)
  make                                                                                                             (setting are stored in /buildroot-avr32-v2.3.0/.config )
  export PATH=$PATH:/buildroot-avr32-v2.3.0/build_avr32/staging_dir/usr/bin

When done you can find:
- avr32-linux-gcc  in /buildroot-avr32-v2.3.0/build_avr32/staging_dir/usr/bin
- /buildroot-avr32-v2.3.0/binaries/atngw100/rootfs.avr32.tar
- /buildroot-avr32-v2.3.0/binaries/atngw100/rootfs.avr32.jffs2-root
- /buildroot-avr32-v2.3.0/binaries/atngw100/rootfs.avr32.jffs2-usr

You can check or alter the buildroot configuration using:
  cd /buildroot-avr32-v2.3.0
  make ARCH=avr32 CROSS_COMPILE=avr32-linux- menuconfig    (this will open the Buildroot configuration screen).
  make                                                                                                (setting are stored in /buildroot-avr32-v2.3.0/.config )

Image

Setting up a development environment, approach two

For installation approach two I've created two packages and an install script. I'm not a Linux expert, I'm not even a novice so if thing fail don't shoot but let me know. Perhaps I can help.
Download Alyda_br_avr32_230.tgz (230Mb), Alyda_tc.tgz (47Mb) and Install.sh.  Make sure that the extension of the tgz files really is tgz. Place all three files into the root directory (/) of your Ubuntu OS. Make the Install.sh script executable (chmod 755 /Install.sh). Use /Install.sh, sit back, compilation will take a while...
When all parts are installed logout and login again.
The builroot is installed in /buildroot-avr32-v2.3.0 and the binaries path is included in your shell PATH, meaning you can use now avr32-liunx-gcc in every directory.
Go to the Hello World example and see if it also works for you.

When done you can find:
- avr32-linux-gcc  in /buildroot-avr32-v2.3.0/build_avr32/staging_dir/usr/bin
- /buildroot-avr32-v2.3.0/binaries/atngw100/rootfs.avr32.tar
- /buildroot-avr32-v2.3.0/binaries/atngw100/rootfs.avr32.jffs2-root
- /buildroot-avr32-v2.3.0/binaries/atngw100/rootfs.avr32.jffs2-usr

You can check or alter the buildroot configuration using:
  cd /buildroot-avr32-v2.3.0
  make ARCH=avr32 CROSS_COMPILE=avr32-linux- menuconfig    (this will open the Buildroot configuration screen).
  make                                                                                                (setting are stored in /buildroot-avr32-v2.3.0/.config )

Top


Installing Ubuntu

When installing Ubuntu as Virtual Machine I assume you have installed VMware Player on your Windows computer, have about 10Gb of hard disk space available and downloaded Ubuntu 9.0.4 Desktop iso image (ubuntu-9.04-desktop-i386.iso, aprox. 720Mb).
Click on the images to enlarge.

Start VMware player and create a new Virtual Machine.

Image

Select where the Ubuntu disc image is located.

Image

Enter your full name, user name and password. These enteries will be used as values for your Ubuntu login account.

Image

Enter a Vitual Machine name and the location where VMware Player virtual hard disk used by Ubuntu should be located .

Image

Specify your disk capacity.

Image

Overview of your settings.

Image

If you see this, wait your almost there.

Image

Now you can login using the credentials you have entered a few pictures back. After a few seconds the Ubuntu desktop wil appear.

Image

Note: do not install patches or upgrade to the latest Ubuntu version. Remember we first want to have a working development environment. 

These are the files used by VMware Player and representing the Virtual Ubuntu machine.

Image

Become root

Since you logged on as a simple user you don't have much install priviledges. You can use the sudo command in order to execute each commando as being root but we still need to do a lot of work. Becoming root is discouraged for many good reasons however this is not a production server but a development system. To enable the root account (i.e. set a password) use: "sudo passwd root" and enter a root password. Next enable root to login in the GUI by using opening gdmsetup as root in a terminal. Type "sudo gdmsetup",  go to Security and choose "Allow local system administrator login". Then close. Logoff and login as root.

 Windows 7

I've installed VMware-player together with the above Ubuntu OS on a Windows 7 64-bit OS. All seems to be ok but I've noticed access delays when accessing CIFS mounted drives. Problem was solved when disabling VMware NAT and enabling Bridge mode.

TopBack

Format SD-card

Format SD-card and create an ext2 file system on the SD-card. I presume that Ubunu sees the SD-card as /dev/sdb1. If not check which device is used and replace sdb1 accordingly.
Use the following commands:

umount /dev/sdb1
/sbin/mke2fs /dev/sdb1
 /sbin/e2fsck /dev/sdb1

mkdir /sd
mount /dev/sdb1 /sd  (if automount doesn't mount the sd-card)
cd /sd

cd /
umount /sd

Top


Errors and warnings

  • A build of buildroot stops with a Error 1:
    The build ends with an Error 1 however the avr32-linux -gcc is created (see ./buildroot-avr32-v2.3.0/build_avr32/staging_dir/usr/bin).
    In order to resolve this error:
      cd /buildroot-avr32-v2.3.0/build_avr32/staging_dir
      ln -s usr/sbin/ sbin
      cd ./buildroot-avr32-v2.3.0
      make

  • Segmentation fault
    I've created, compiled and uploaded an application to the NGW100 using FileZilla. When I run the application the app doesn't work and a Segmentation Fault error appears.
    Solution: make sure Filezilla is set to binary transfers.

  • Booting fails on error:

    find_inode failed for name=uImage
    load: Failed to find inode
    ### JFFS2 LOAD ERROR<0> for uImage!
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!

    Uimage can't be found. In the latest releases of the NGW100 binaries uImage is moved to the /boot directory. Try:

    Uboot> set bootcmd 'fsload /boot/uImage;bootm'
    Uboot> saveenv

 And boot again.

  • When uploading a new kernel into flash the follwing error appers:

dd if=/rootfs.avr32.jffs2-root of=/dev/mtd1 bs=1056
dd: writing '/dev/mtd1': Input/output error
408+0 records in
407+0 records out

Most likely the flash memery wasn't erased properly (You didn't erase flash will running the OS from the same flash, did you..?).
Boot from SD-card and erase flash again.

  • Error warnings ...ngw user.notice kernel: jffs2_scan_eraseblock(): Magic bitmask 0.. appear in /var/log/messages:
    this could indicate problems in flash memory.

Top

 
© 2020 www.alyda.nl
Joomla! is Free Software released under the GNU/GPL License.