AVR32 NGW100 Notes for a Kernel Build environment on SuSE 10.1

These are notes I'm keeping on my trail to try to create a kernel build environment for the AVR NGW100 on SuSE 10.1 Linux. Note that I do not know if any of this is correct right now because I'm gunning for a working environment. I'll be figuring it out as I go.

1) The first thing I did was copy the AVR32 NGW100 Board Support Package (BSP) contents to my SuSE 10.1 linux box.

2) Knowing that I will need a GNU AVR32 compilation environment, I went into devel/linux/opensuse/10.1 and installed all the RPMs in that directory. There is no information about what depends upon what and therefore there is also no information about what order these RPMs should be installed. So, I had to go for broke. I needed to be root and then issues this command:

devel/linux/opensuse/10.1 # find . -name "*.rpm" -exec rpm -i {} \;

That failed a whole bunch of dependencies, but mainly it failed the avr32ocd dependency which failed in turn to install because it lacked libelf.X.so.

Typical of this error was this message:
error: Failed dependencies:
libavr32ocd >= 2.0.0 is needed by avr32gdbproxy-2.0.0-1.suse101.i586
libavr32ocd.so.2 is needed by avr32gdbproxy-2.0.0-1.suse101.i586

or

warning: ./avr32program-2.0.0-1.suse101.i586.rpm: Header V3 DSA signature: NOKEY, key ID c01dd150
error: Failed dependencies:
libavr32ocd >= 2.0.0 is needed by avr32program-2.0.0-1.suse101.i586
libavr32ocd.so.2 is needed by avr32program-2.0.0-1.suse101.i586
libelf.so.0 is needed by avr32program-2.0.0-1.suse101.i586


I went through yast2 and installed the libelf package 0.8.5-45.i586.rpm.

After libelf was installed through yast2, I went back and tried the single RPM install of the libavr32ocd package:

rpm -i libavr32ocd-2.0.0-1.suse101.i586.rpm

That succeed with no errors. Next I singly installed libarv32ocd-devel-2.0.0-1.suse101.i586.rpm - that succeeded as well.

After knocking down the major dependency issues, went for the bulk install of the RPMs again.

find . -name "*.rpm" -exec rpm -i {} \;

This time there were no errors emitted, just warnings describing the DSA signatures of the RPMs. I ignored the warnings.

These RPMs obviated the need for me to follow the download sources stuff in the AVR32Linux.org Getting Started section as the RPMs seemed to cover the major list of packages (uboot, gpb, etc.)

3) Build Scripts do it all

look in the BSP scripts directory and you'll find what you need to do a full build of uboot, /root and /usr JFFS images

./build-linux-environment.sh ../software ../builds/ngw/ ../mybuilds

SuSE 10.1 was lacking e2fsimage for the end stage of the build. e2fsimage isn't available directly from SuSE DVD/yast2.

Need to install e2fsimage 0.2.2 but it has dependency on e2fsprogs headers.

Solution is to install e2fsprog (e2fsprogs-devel to be precise) from yast2 or consult this link: http://support.novell.com/techcenter/psdb/286c206d70f263c8fc3da1dc2fab3ce7.html

rpm -Fvh e2fsprogs.rpm

The home page for e2fsprogs is at:
http://e2fsprogs.sourceforge.net/ext2.html

After e2fsprogs is configured/installed with devel headers,

Then download e2fsimage-0.2.2 from http://sourceforge.net/projects/e2fsimage/

spanky:/tmp/e2fsimage-0.2.2 # ./configure
/usr /usr/local
Found: ext2fs/ext2fs.h at /usr/include
Found: e2p/e2p.h at /usr/include
Found: libext2fs.so at /usr/lib
Found: libcom_err.so at /usr/lib

The version of the e2fs library is: 1.38, 30-Jun-2005

LDFLAGS : -lext2fs -lcom_err
PREFIX :/usr/local
CPPFLAGS :
CFLAGS :-Wall
VERSION :0.2.2

GNU Make 3.80
GNU Make 3.80

A usable make executable was found in /usr/bin/make

---
Got much further into kernel build but then bombed on:

DirectFB - configure, make and make install OK
pong - make and make install FAILED
make failed, see make.out

--- removed pong and commented out entire STK1000 section of the build ---

re-ran the build script and got images.

Setting up SuSE TFTP - selected the basic TFTP server from yast2

Pasted Graphic

setup a separate boot directory for ngwt boot images

For comparison purposes, here's the boot log of the stock image on the NGW100:

Uboot> boot
### JFFS2 loading 'uImage' to 0x10200000
### JFFS2 load complete: 905936 bytes loaded to 0x10200000
## Booting image at 10200000 ...
Image Name: Linux-2.6.18-at0
Image Type: AVR32 Linux Kernel Image (gzip compressed)
Data Size: 905872 Bytes = 884.6 kB
Load Address: 10000000
Entry Point: 90000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK

Starting kernel at 90000000 (params at 11fc0040)...

pdc pdc.0: Atmel Peripheral DMA Controller enabled
EIM: External Interrupt Module at 0xfff00000, IRQ 19
EIM: Handling 4 external IRQs, starting with IRQ 64
smc smc.0: Atmel Static Memory Controller at 0xfff03400
pio0: Atmel Port Multiplexer at 0xffe02800 (irq 13)
pio0: Handling 32 external IRQs, starting with IRQ 96
pio1: Atmel Port Multiplexer at 0xffe02c00 (irq 14)
pio1: Handling 32 external IRQs, starting with IRQ 128
pio2: Atmel Port Multiplexer at 0xffe03000 (irq 15)
pio2: Handling 32 external IRQs, starting with IRQ 160
pio3: Atmel Port Multiplexer at 0xffe03400 (irq 16)
pio3: Handling 32 external IRQs, starting with IRQ 192
pio4: Atmel Port Multiplexer at 0xffe03800 (irq 17)
pio4: Handling 32 external IRQs, starting with IRQ 224
dmac0: DesignWare DMA controller at 0xff200000 irq 2
NET: Registered protocol family 2
IP route cache hash table entries: 256 (order: -2, 1024 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 1024 bind 512)
TCP reno registered
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler cfq registered (default)
Serial: Atmel USART3 driver
usart.1: ttyS0 at MMIO 0xffe01000 (irq = 7) is a USART3
loop: loaded (max 8 devices)
eth0: Atmel MACB at 0xfff01800 irq 25 (00:04:25:1c:50:dc)
eth1: Atmel MACB at 0xfff01c00 irq 26 (00:04:25:1c:50:dd)
physmap platform flash device: 00800000 at 00000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
Amd/Fujitsu Extended Query Table at 0x0041
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
RedBoot partition parsing not available
Using physmap partition information
Creating 3 MTD partitions on "physmap-flash.0":
0x00000000-0x00020000 : "u-boot"
0x00020000-0x007f0000 : "root"
0x007f0000-0x00800000 : "env"
atmel_spi atmel_spi.0: Atmel SPI Controller at 0xffe00000 (irq 3)
mtd_dataflash spi0.0: AT45DB642x (8448 KBytes)
ip_conntrack version 2.4 (256 buckets, 2048 max) - 204 bytes per conntrack
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Time: avr32 clocksource has been installed.
VFS: Mounted root (jffs2 filesystem).
Freeing init memory: 56K (90000000 - 9000e000)
init started: BusyBox v1.2.2 (2006.12.13-14:13+0000) multi-call binary
* mounting virtual filesystems: /proc /sys /dev/pts /dev/shm /config /var/log /var/log/samba /var/log/ntpstats /tmp
* setting hostname ... 'ngw.example.net'
* network loopback ... [ OK ]
* starting syslogd ... [ OK ]
* log messages to syslog ... [ OK ]
* starting klogd ... [ OK ]
* set mdev hotplug ... [ OK ]
* mdev ... [ OK ]
* probing modules ... vfat loaded, mmc_block loaded, atmel-mci loaded, [ OK ]
* mounting filesystems: /usr
* setup eth0 ... [ OK ] (192.168.5.170)
* setup eth1 ... [ OK ]
* network ... [ OK ]
* starting telnetd ... [ OK ]
* enable ipv4 forwarding ... [ OK ]
* iptables postrouting ... [ OK ]
* iptables incoming trafic ... [ OK ]
* iptables outgoung trafic ... [ OK ]
* starting dnsmasq ... [ OK ]
* running ntpdate ... [ OK ]
* starting ntpd ... [ OK ]
* starting dropbear ... [ OK ]
* starting inted ... [ OK ]
* starting nmbd ... [ OK ]
* starting smbd ... [ OK ]
* starting winbindd ... [ OK ]
* starting httpd ... [ OK ]
* get board type for GPIO ... 'NGW'
* setup GPIO boot LED ... JFFS2 error: (183) check_node_data: short read at 0x41fbe0: 0 instead of 394.
JFFS2 error: (183) check_node: check_node_data() returned error: -5.
kernel BUG at fs/jffs2/readinode.c:700!
Kernel BUG in arch/avr32/kernel/traps.c::do_illegal_opcode, line 397[#1]:
Modules linked in: atmel_mci mmc_block mmc_core vfat fat
PC is at jffs2_do_read_inode_internal+0xb7e/0x1222
LR is at 0x10ff
pc : [<9008c970>] lr : [<000010ff>] Not tainted
sp : 91d1fe58 r12: fffffffb r11: 000010ff
r10: ffffffff r9 : 00000000 r8 : 9014c344
r7 : 91d1fea8 r6 : 00000000 r5 : 91e769e0 r4 : 00000000
r3 : fffffffb r2 : 91e703b8 r1 : 91e769e0 r0 : 91d1fecc
Flags: qvNzc
Mode bits: hrje....g
CPU Mode: Supervisor
Call trace:
[<9008d056>] jffs2_do_crccheck_inode+0x42/0x78
[<900905b2>] jffs2_garbage_collect_pass+0x11e/0x4e8
[<9009146e>] jffs2_garbage_collect_thread+0xb6/0xd8
[<90017ad8>] do_exit+0x0/0x598


Process jffs2_gcd_mtd3 (pid: 183, stack limit = 0x91d1e028)
Stack: (0x91d1fe58 to 0x91d20000)
fe40: 91ce0e00 902f5800
fe60: 00000000 91db0de8 902f5800 00000000 91ce0e10 00000060 00000271 91cb5c34
fe80: 003bec80 00000000 902fe000 00000000 00000060 00000060 00000000 902c5820
fea0: 902f5800 902c5820 9008d056 91d1ff10 91ce0e00 fffffff4 00000000 91cc8c50
fec0: 902f5800 902f5800 902f5800 1985e002 000000c1 393d5591 000000d5 00000866
fee0: 000081ed 00000003 90013688 91d1ff0c 00400025 902f582c 00000000 00000001
ff00: 90017ad8 902f5800 00000000 90089ef8 900905b2 91d1ff48 91cc8c50 902f582c
ff20: 00000000 00000001 90017ad8 902f5800 902f5800 91d1ff44 91d1e000 902f5800
ff40: 00000000 9001711c 9009146e 91d1ffec 91d1e000 902f5800 00000000 00000000
ff60: 90017ad8 900913b8 902f5800 00000000 00040000 00000000 00010000 00000000
ff80: 00001000 00000001 00000000 00002000 00002000 00000000 00002000 00000000
ffa0: 00000000 9000e166 91c39aa4 9011317e 90217640 ffffffe8 00400000 90011474
ffc0: 90011474 91d20000 00000000 00000000 00000000 00000000 00000000 00000000
ffe0: 00000000 00000000 00000000 90017ad8 00000000 00000000 00000000 00000000
<6>created gpio0 (pio0/0x00010000) as (254:0)
[ OK ]
* setup GPIO LED A ... created gpio1 (pio0/0x00080000) as (254:1)
[ OK ]
* setup GPIO LED B ... created gpio2 (pio4/0x00080000) as (254:2)
[ OK ]

Network Gateway ready



BusyBox v1.2.2 (2006.12.13-14:13+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

#


Stock environment is:
baudrate=115200
ethaddr=00:04:25:1C:50:DC
bootdelay=1
ethact=macb0
serverip=192.168.0.106
tftpip=192.168.0.106
eth1addr=00:04:25:1C:50:DD
bootargs=console=ttyS0 root=/dev/mtdblock1 rootfstype=jffs2
bootcmd=fsload;bootm
stdin=serial
stdout=serial
stderr=serial

Environment size: 260/65532 bytes

----
changed my uboot params to:

------------
Uboot> set bootcmd 'set bootfile avr32-linux-image-basic/uImage;dhcp;bootm'
Uboot> printenv
baudrate=115200
ethaddr=00:04:25:1C:50:DC
bootdelay=1
eth1addr=00:04:25:1C:50:DD
bootargs=console=ttyS0 root=/dev/mtdblock1 rootfstype=jffs2
tftpip=192.168.5.177
serverip=192.168.5.177
stdin=serial
stdout=serial
stderr=serial
bootfile=uImage
ethact=macb0
bootcmd=set bootfile avr32-linux-image-basic/uImage;dhcp;bootm

Environment size: 318/65532 bytes
Uboot> boot
macb0: Starting autonegotiation...
macb0: Autonegotiation complete
macb0: link up, 10Mbps half-duplex (lpa: 0x0021)
BOOTP broadcast 1
BOOTP broadcast 2
DHCP client bound to address 192.168.5.170
Using macb0 device
TFTP from server 192.168.5.177; our IP address is 192.168.5.170
Filename 'avr32-linux-image-basic/uImage'.
Load address: 0x10200000
Loading: T #################################################################
#################################################################
##########################################
done
Bytes transferred = 879312 (d6ad0 hex)
## Booting image at 10200000 ...
Image Name: Linux-2.6.18-at1
Image Type: AVR32 Linux Kernel Image (gzip compressed)
Data Size: 879248 Bytes = 858.6 kB
Load Address: 10000000
Entry Point: 90000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK

Starting kernel at 90000000 (params at 11fc0040)...

clk pixclk: new parent pll0 (was (null))
clk pixclk: new rate 130000000 (actual rate 130000000)
pdc pdc.0: Atmel Peripheral DMA Controller enabled
EIM: External Interrupt Module at 0xfff00000, IRQ 19
EIM: Handling 4 external IRQs, starting with IRQ 64
smc smc.0: Atmel Static Memory Controller at 0xfff03400
pio0: Atmel Port Multiplexer at 0xffe02800 (irq 13)
pio0: Handling 32 external IRQs, starting with IRQ 96
pio1: Atmel Port Multiplexer at 0xffe02c00 (irq 14)
pio1: Handling 32 external IRQs, starting with IRQ 128
pio2: Atmel Port Multiplexer at 0xffe03000 (irq 15)
pio2: Handling 32 external IRQs, starting with IRQ 160
pio3: Atmel Port Multiplexer at 0xffe03400 (irq 16)
pio3: Handling 32 external IRQs, starting with IRQ 192
dmac0: DesignWare DMA controller at 0xff200000 irq 2
NET: Registered protocol family 2
IP route cache hash table entries: 256 (order: -2, 1024 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 1024 bind 512)
TCP reno registered
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
io scheduler noop registered (default)
sidsafb: 76800B framebuffer too small for 320x240x24
sidsafb: 76800B framebuffer too small for 320x240x24
sidsafb: No suitable video mode found
Serial: Atmel USART3 driver
usart.1: ttyS0 at MMIO 0xffe01000 (irq = 7) is a USART3
usart.2: ttyS1 at MMIO 0xffe01400 (irq = 8) is a USART3
usart.3: ttyS2 at MMIO 0xffe01800 (irq = 9) is a USART3
eth0: Atmel MACB at 0xfff01800 irq 25 (00:04:25:1c:50:dc)
physmap platform flash device: 00800000 at 00000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
Amd/Fujitsu Extended Query Table at 0x0041
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
RedBoot partition parsing not available
Using physmap partition information
Creating 3 MTD partitions on "physmap-flash.0":
0x00000000-0x00020000 : "u-boot"
0x00020000-0x007f0000 : "root"
0x007f0000-0x00800000 : "env"
atmel_spi atmel_spi.0: Atmel SPI Controller at 0xffe00000 (irq 3)
mmc0: Atmel MCI controller at 0xfff02400 irq 28
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Time: avr32 clocksource has been installed.
VFS: Mounted root (jffs2 filesystem).
Freeing init memory: 52K (90000000 - 9000d000)
init started: BusyBox v1.2.2 (2006.12.13-14:13+0000) multi-call binary
* mounting virtual filesystems: /proc /sys /dev/pts /dev/shm /config /var/log /var/log/samba /var/log/ntpstats /tmp
* setting hostname ... 'ngw.example.net'
* network loopback ... [ OK ]
* starting syslogd ... [ OK ]
* log messages to syslog ... [ OK ]
* starting klogd ... [ OK ]
* set mdev hotplug ... [ OK ]
* mdev ... [ OK ]
* probing modules ... vfat failed, mmc_block failed, atmel-mci failed, [ OK ]
* mounting filesystems: [ FAILED ]
* setup eth0 ... /etc/init.d/S10networking: /etc/init.d/S10networking: 23: awk: not found
[ STATIC ] ()
* setup eth1 ... [ FAILED ]
* Network ... [ FAILED ]
* get board type for GPIO ... /etc/init.d/S99gpio: /etc/init.d/S99gpio: 8: cut: not found
[ FAILED ]

Network Gateway ready



BusyBox v1.2.2 (2006.12.13-14:13+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ #

----------
I was building up a new SuSE 10 build environment and happened to run across a different error, it blew up building ncurses, which I hadn't seen when I first started this thread. After pawing through the make.out of ncurses, this error manifested itself as:
[code]
./gen '' B K >Key_Definitions
./gen: error while loading shared libraries: /home/lcox/Documents/avr32/software/ncurses/ncurses-5.5/lib/libncurses.so.5: ELF file data encoding not little-endian

while building ncurses.

Context was Ada95 ncurses build:

make[1]: Leaving directory `/home/lcox/Documents/AVR32NGW100/software/ncurses/ncurses-5.5/c++'
cd Ada95 && make DESTDIR="" all
make[1]: Entering directory `/home/lcox/Documents/AVR32NGW100/software/ncurses/ncurses-5.5/Ada95'
for d in gen src samples; do \
(cd $d ; make all) ;\
done
make[2]: Entering directory `/home/lcox/Documents/AVR32NGW100/software/ncurses/ncurses-5.5/Ada95/gen'
gcc -I. -I../../include -DHAVE_CONFIG_H -I. -O2 -c -o gen.o ./gen.c
gcc -I. -I../../include -DHAVE_CONFIG_H -I. -O2 gen.o -Wl,-rpath,/home/lcox/Documents/avr32/software/ncurses/ncurses-5.5/lib -L../../lib -lncurses -o gen
/usr/lib/gcc/i586-suse-linux/4.1.0/../../../../i586-suse-linux/bin/ld: skipping incompatible ../../lib/libncurses.so when searching for -lncurses
./gen '' B K >Key_Definitions
./gen: error while loading shared libraries: /home/lcox/Documents/avr32/software/ncurses/ncurses-5.5/lib/libncurses.so.5: ELF file data encoding not little-endian
make[2]: *** [Key_Definitions] Error 127
make[2]: Leaving directory `/home/lcox/Documents/AVR32NGW100/software/ncurses/ncurses-5.5/Ada95/gen'
make[2]: Entering directory `/home/lcox/Documents/AVR32NGW100/software/ncurses/ncurses-5.5/Ada95/src'
gnatmake -O3 -gnatpn -I. -I. -c -o terminal_interface.o ./terminal_in
[/code]

Something in ncurses didn't seem to want to obey the correct CC or HOSTCC environment that was being used for everything else in the case when it was building Ada95 support. Naturally, I didn't care about Ada95, so found the configure flag to not build it, which was --without-ada.

So, in the build-linux-environment script, I had to add it to this line within the function build_ncurses() section:

[code]
./configure --host=avr32-linux --prefix=/usr --without-normal \
--without-debug --without-ada --with-shared --program-transform-name='' \
> configure.out 2>&1 || task_error "configure failed, see configure.out"
[/code]

Once I added that, I built ncurses with no problems and proceeded through the rest of the build-linux-environment script. So, not sure why I didn't come across this the first time I set up SuSE 10, but if you hit this issue, this is one solution I found.

Clicky Web Analytics