Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

update to buildroot guide

Altera_Forum
Honored Contributor II
1,725 Views

Dear all, 

I have updated the buildroot guide with gcc3.4.6, kernel 2.6.15.6 and new elf2flt.ld, please check out,  

http://forum.niosforum.com/forum/index.php?showtopic=3174 (http://forum.niosforum.com/forum/index.php?showtopic=3174)
0 Kudos
27 Replies
Altera_Forum
Honored Contributor II
725 Views

update again. it is kernel 2.6.16 now.

0 Kudos
Altera_Forum
Honored Contributor II
725 Views

Awesome. Will try it soon.

0 Kudos
Altera_Forum
Honored Contributor II
725 Views

update again. provide two new kernels, 2.6.15.6 is more stable, while 2.6.16 is under testing for nios2.

0 Kudos
Altera_Forum
Honored Contributor II
725 Views

I have verified the altera pci host bridge driver, it is working well with kernel 2.6.16 .

0 Kudos
Altera_Forum
Honored Contributor II
725 Views

I have tested kernel 2.6.16 on a altera 2C35 Nios2 dev board. The jtag uart, epcs mtd, cfi mtd , and smc91111 are working well.

0 Kudos
Altera_Forum
Honored Contributor II
725 Views

the build script in build0322.zip has a bug at line# 18, it should be "patch -p1 ~/download/mx140apps.diff" . thanks to hootsmon, who pointed out this issue. 

the new build0327.zip only to fix this. 

 

CF drive tested with kernel 2.6.16 .
0 Kudos
Altera_Forum
Honored Contributor II
725 Views

I have verified 2.6.16 with a modified opencores MAC driver and the usual others. Good stuff!

0 Kudos
Altera_Forum
Honored Contributor II
725 Views

I got these 2 errors when compiling the new buildroot... 

Problem 1: 

/~/buildroot/toolchain_build_nios2/gcc-3.4.6-final/nios2-linux-uclibc/libstdc++-v3/include/ext/rope:939:18: macro "index" requires 2 arguments, but only 1 given 

Problem 2: 

In file included from /~/buildroot/toolchain_build_nios2/elf2flt/elf2flt.c:52: /~/buildroot/toolchain_build_nios2/binutils-2.15-build/bfd/bfd.h:38:22: ansidecl.h: No such file or directory 

 

I was able to workaround both problems, using this patch.... 

--- toolchain_build_nios2/gcc-3.4.6/libstdc++-v3/include/ext/rope       2006-03-29 10:06:26.000000000 +1000 +++ toolchain_build_nios2/gcc-3.4.6/libstdc++-v3/include/ext/rope       2006-03-29 10:06:26.000000000 +1000 68,72d67 < /* Fix potential name clash */ <# ifdef index <#   undef index <# endif < --- toolchain_build_nios2/elf2flt/Makefile      2006-03-29 10:06:26.000000000 +1000 +++ toolchain_build_nios2/elf2flt/Makefile      2006-03-29 10:03:59.000000000 +1000 @@ -11,7 +11,7 @@ CPU = nios2 TARGET = nios2-linux-uclibc CFLAGS = -g -O2 -INCLUDES = -I/home/andrew/buildroot/toolchain_build_nios2/binutils-2.15-build/bfd/ +INCLUDES = -I/home/andrew/buildroot/toolchain_build_nios2/binutils-2.15-build/bfd/ -I/home/andrew/buildroot/toolchain_build_nios2/binutils-2.15/include CPPFLAGS = LDFLAGS = LIBS = /home/andrew/buildroot/toolchain_build_nios2/binutils-2.15-build/bfd/libbfd.a /home/andrew/buildroot/toolchain_build_nios2/binutils-2.15-build/libiberty/libiberty.a 

 

question: Does anybody else get these errors, or are they due to some quirk of my (Debian) platform?  

 

Thx in advance 

hootsmon
0 Kudos
Altera_Forum
Honored Contributor II
725 Views

Ah, I wonder if my problem could be related to using GCC-3.4.6 to build the toolchain?

0 Kudos
Altera_Forum
Honored Contributor II
725 Views

I am checking the build again. I wonder there are some updates in buildroot snapshot which break nios2 again.

0 Kudos
Altera_Forum
Honored Contributor II
725 Views

Thx hippo. Here&#39;s another wrinkle (probably unrelated).... 

$ nios2-linux-uclibc-flthdr ~/rootfs/bin/busybox ~/rootfs/bin/busybox bash: nios2-linux-uclibc-flthdr: command not found 

 

BTW, I do have a binary called &#39;flthdr&#39; but it reports problems... 

~/buildroot/toolchain_build_nios2/elf2flt$ ./flthdr ~/linux-2.6.16/vmlinux Cannot read header of /home/andrew/linux-2.6.16/vmlinux 

Also, I am getting BAD MAGIC errors when busybox tries to start. 

Any ideas? How do I build nios2-linux-uclibc-flthdr ?
0 Kudos
Altera_Forum
Honored Contributor II
725 Views

Please check build0329.zip,  

the latest snapshot have some problems, but I don&#39;t have time to check them. 

we shall freeze the snapshot to 20060320, the last known good snapshot.
0 Kudos
Altera_Forum
Honored Contributor II
725 Views

Thanks hippo, I am trying it now.

0 Kudos
Altera_Forum
Honored Contributor II
725 Views

updated to kernel 2.6.16.1

0 Kudos
Altera_Forum
Honored Contributor II
725 Views

Just checked build0329, and buildroot compiled smoothly for me. 

 

I noticed that nios2linux-1.4.zip was missing (ie. not in build0329.zip), however it is available in previous zipfiles. 

 

Here&#39;s what happens when I try to boot 2.6.16 kernel. I *think* busybox has ELF header not flat. 

 

Uncompressing Linux... Ok, booting the kernel. Linux version 2.6.16 (andrew@ce00205) (gcc version 3.4.6)# 2 PREEMPT Wed Mar 29 16:57:28 EST 2006 uClinux/Nios II Altera Nios II support (C) 2004 Microtronix Datacom Ltd. Built 1 zonelists Kernel command line: PID hash table entries: 128 (order: 7, 2048 bytes) Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) Memory available: 14988k/16384k RAM, 0k/0k ROM (742k kernel code, 482k data) Mount-cache hash table entries: 512 io scheduler noop registered io scheduler deadline registered (default) Serial: JTAG UART driver $Revision: 1.4 $ ttyJ0 at MMIO 0x821208b0 (irq = 1) is a jtag_uart Freeing unused kernel memory: 408k freed (0x10c2000 - 0x1127000) BINFMT_FLAT: bad header magic BINFMT_FLAT: bad header magic Failed to execute /init BINFMT_FLAT: bad header magic BINFMT_FLAT: bad header magic BINFMT_FLAT: bad header magic BINFMT_FLAT: bad header magic Kernel panic - not syncing: No init found.  Try passing init= option to kernel. 

 

Any ideas?
0 Kudos
Altera_Forum
Honored Contributor II
725 Views

Yes, check it with "nios2-linux-uclibc-flthdr ~/rootfs/bin/busybox" . 

 

rebuild busybox with, 

cd ~/buildroot make -C build_nios2/busybox clean make# prepare root fs rm -rf ~/rootfs cp -a ~/buildroot/build_nios2/root/* ~/rootfs cd ~/rootfs# remove include and lib to save space# the dev nodes are generated via ~/download/rootfs_list rm -rf dev usr/include usr/lib# you may use this instead of the one from buildroot cp ~/download/inittab etc 

 

nios2linux-1.4.zip was not in previous build.zip, it was too big. 

Please find it here, 

http://forum.niosforum.com/downloads/1_4/nios2linux-1.4.zip (http://forum.niosforum.com/downloads/1_4/nios2linux-1.4.zip)
0 Kudos
Altera_Forum
Honored Contributor II
725 Views

I have verified 2.6.16 (build0329) on EP2S60 board with SMC91111 driver. 

Good job hippo http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif
0 Kudos
Altera_Forum
Honored Contributor II
725 Views

 

--- Quote Start ---  

originally posted by hootsmon@Mar 29 2006, 12:50 PM 

thx hippo.  here&#39;s another wrinkle (probably unrelated).... 

$ nios2-linux-uclibc-flthdr ~/rootfs/bin/busybox ~/rootfs/bin/busybox bash: nios2-linux-uclibc-flthdr: command not found 

btw, i do have a binary called &#39;flthdr&#39; but it reports problems... 

~/buildroot/toolchain_build_nios2/elf2flt$ ./flthdr ~/linux-2.6.16/vmlinux cannot read header of /home/andrew/linux-2.6.16/vmlinux 

also, i am getting bad magic errors when busybox tries to start. 

any ideas?  how do i build  nios2-linux-uclibc-flthdr ? 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=13880)</div> 

--- Quote End ---  

 

In answer to my own question, I rebuilt nios2-linux-uclibc-flthdr as follows: 

cd ~/buildroot/toolchain_build_nios2/elf2flt make clean make make install 

Having installed flthdr utility, kernel boots and busybox runs properly now.
0 Kudos
Altera_Forum
Honored Contributor II
725 Views

great. 

 

The vmlinux and zImage are ELF. 

While the busybox , boa and other apps to run on uClinux are FLT. 

 

As for flthdr, you may try 

cd ~/buildroot rm -rf toochain_build_nios2/elf2flt make 

 

You can safely remove stuff in toolchain_build_nios2 and build_nios2 . 

a top level make will rebuild them.
0 Kudos
Altera_Forum
Honored Contributor II
676 Views

Thx hippo, this is good info

0 Kudos
Reply