Forum Discussion
Altera_Forum
Honored Contributor
20 years agobuildroot to build toolchain on Linux
TO_BE_DONE
107 Replies
- Altera_Forum
Honored Contributor
Hi Alex,
I think you are using the latest buildroot/uClibc which have problems. Please use the new build0207 script attached in post#1, remove line 1-34, which prepares source for kernel/uClinux-dist. Remove old ~/buildroot, and run ./build0207 - Altera_Forum
Honored Contributor
Attached is the zip containing the kernel's usr/initramfs_list. You should have the similar file AFTER the kernel build. If you can't boot kernel, attach the zip containing your file in the post.
You should check the .config of your kernel. Compare it with the file kernel.config in build.zip, the only diff should be atlera jtag console. It must have correct initramfs setup. - Altera_Forum
Honored Contributor
hi hippo:
I uesed exec ./build commaand,but i got a erro. The erro informathion follow: /home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5/libiberty/strerror.c: In function `strerror':/home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5/libiberty/strerror.c:663: warning: return discards qualifiers from pointer target type if [ x"" != x ]; then /home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5-final/gcc/xgcc -B/home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5-final/gcc/ -B/home/alex/buildroot/build_nios2/staging_dir/nios2-linux-uclibc/bin/ -B/home/alex/buildroot/build_nios2/staging_dir/nios2-linux-uclibc/lib/ -isystem /home/alex/buildroot/build_nios2/staging_dir/nios2-linux-uclibc/include -isystem /home/alex/buildroot/build_nios2/staging_dir/nios2-linux-uclibc/sys-include-c -DHAVE_CONFIG_H -g -Os -I. -I/home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5/libiberty/../include -W -Wall -Wtraditional -pedantic /home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5/libiberty/strsignal.c -o pic/strsignal.o; else true; fi /home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5-final/gcc/xgcc -B/home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5-final/gcc/ -B/home/alex/buildroot/build_nios2/staging_dir/nios2-linux-uclibc/bin/ -B/home/alex/buildroot/build_nios2/staging_dir/nios2-linux-uclibc/lib/ -isystem /home/alex/buildroot/build_nios2/staging_dir/nios2-linux-uclibc/include -isystem /home/alex/buildroot/build_nios2/staging_dir/nios2-linux-uclibc/sys-include -c -DHAVE_CONFIG_H -g -Os -I. -I/home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5/libiberty/../include -W -Wall -Wtraditional -pedantic /home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5/libiberty/strsignal.c -o strsignal.o /home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5/libiberty/strsignal.c:414: error: conflicting types for 's trsignal' /home/alex/buildroot/build_nios2/staging_dir/nios2-linux-uclibc/sys-include/string.h:374: error: previous declaration of 'strsignal' was here /home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5/libiberty/strsignal.c:414: error: conflicting types for 's trsignal' /home/alex/buildroot/build_nios2/staging_dir/nios2-linux-uclibc/sys-include/string.h:374: error: previous declaration of 'strsignal' was here /home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5/libiberty/strsignal.c: In function `psignal':/home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5/libiberty/strsignal.c:563: error: argument "signo" doesn't match prototype /home/alex/buildroot/build_nios2/staging_dir/nios2-linux-uclibc/sys-include/signal.h:141: error: prototype declaration /home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5/libiberty/strsignal.c:563: error: argument "message" doesn 't match prototype /home/alex/buildroot/build_nios2/staging_dir/nios2-linux-uclibc/sys-include/signal.h:141: error: prototype declaration /home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5/libiberty/strsignal.c:568: warning: comparison between sig ned and unsigned make[2]: *** [strsignal.o] 错误 1 make[2]: Leaving directory `/home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5-final/nios2-linux-uclibc/libiberty' make[1]: *** [all-target-libiberty] 错误 2 make[1]: Leaving directory `/home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5-final'make: *** [/home/alex/buildroot/toolchain_build_nios2/gcc-3.4.5-final/.compiled] 错误 2[alex@localhost download]$ What can I do? Thank you! - Altera_Forum
Honored Contributor
You should do the "touch" command after "./build" finished.
- Altera_Forum
Honored Contributor
hi hippo:
I have a question aboot follow reference: ************************************************************************* NOTE : the inittab was missing when patching the uClinuc-dist-test, add it with CODEtouch ~/uClinux-dist-test/vendors/Altera/nios2nommu/inittab ************************************************************************* I have already download uClinux-dist-20051110.But I didn't find the uClinux-dist-test. Where is the uClinux-dist-test I can download? Thanks - Altera_Forum
Honored Contributor
You should find them on the nios2 doc and the forum.
You should download to ram first, and after you have a lot of tests, then download to flash. check, http://www.altera.com/literature/ug/ug_nio..._programmer.pdf (http://www.altera.com/literature/ug/ug_nios2_flash_programmer.pdf) Sorry, I can not help you. I don't use CFI flash. - Altera_Forum
Honored Contributor
Thank you very much! I get the toolchain ,then kernel!
But how do upload the kernel file to flash ? Who can teach me ? Who can write a doc ? Thank you ! Sorry ,my english so poor! - Altera_Forum
Honored Contributor
Hi nvs,
The .config is not related to ptf. The ptf is used to create a header file for hardware address. When you run,
it will ask you some questions, like these. And you should make selections. <div class='quotetop'>QUOTE </div> --- Quote Start --- no emulation specific options. RUNNING hwselect --- Please select which CPU you wish to build the kernel against: (1) cpu_0 - Class: altera_nios2 Type: f Version: 5.1 Selection: 1 --- Please select a device to upload the kernel to: (1) cfi_flash_0 Class: altera_avalon_cfi_flash Size: 8388608 bytes Selection: 1 --- Please select a device to execute kernel from: (1) ddr_sdram_0 Class: ddr_sdram_component Size: 67108864 bytes (2) onchip_memory_0 Class: altera_avalon_onchip_memory2 Size: 8192 bytes Selection: 1 --- Summary using PTF: /home/jack/prog/v1.ptf CPU: cpu_0 Device to upload to: cfi_flash_0 Program memory to execute from: ddr_sdram_0 --- Settings written to /home/jack/linux-2.6.15.3/arch/nios2nommu/hardware.mk[/b] --- Quote End --- You will always need a cfi memory for the hwselect perl script, even when you use EPCS. Just add a dummy cfi flash to a copy of your real ptf and make the hwselect happy. It is for hwselect only. You dont need it for hardware. That's what required for hwselect, <div class='quotetop'>QUOTE </div> --- Quote Start --- You should start with a mininal system with only nios2 cpu core,dram,timer,jtag/serial console and a cfi flash, (which can be dummy and removed later). Note, the interrupt vector (ie, execption vector) should be in uClinux program memory.[/b] --- Quote End --- You need a full featured timer.make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- hwselect SYSPTF=your_system.ptf - Altera_Forum
Honored Contributor
Hi Sam,
Your Linux env may be too old. Please try install a fedora core 4. Please select "development" pakages when you install the Linux. And include compat gcc. Hippo - Altera_Forum
Honored Contributor
Hi hippo,
My environment is gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-53). I try your new build shell script but still encounter the same problem which don't include bin folder in ~/buildroot/build_nios2/staging_dir. Do i need to change my environment or need to modify something? Thanks a lot.