Forum Discussion
Altera_Forum
Honored Contributor
20 years agokernal build error
dear hippo,
Thank you help me , now i bulild the kernal in my custom board (EP1C6,SDRAM(8MB),FLASH(8MB),uart *2,jtat uart ) ,when i run menuconfig ,i select the ALTERA JTAG UARTsupport,and the nios serial support, then compile : [wangzhiwunpu@localhost linux-2.6.x]$ make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- no emulation specific options. CHK include/nios2_system.h CHK include/linux/version.h SPLIT include/linux/autoconf.h -> include/config/* CC init/main.o CHK include/linux/compile.h CC init/do_mounts.o LD init/mounts.o LD init/built-in.o CHK usr/initramfs_list CC arch/nios2nommu/kernel/signal.o CC arch/nios2nommu/kernel/setup.o CC arch/nios2nommu/kernel/start.o arch/nios2nommu/kernel/start.c: In function `main': arch/nios2nommu/kernel/start.c:523: warning: label `badshiftci_label' defined but not used LD arch/nios2nommu/kernel/built-in.o CC kernel/printk.o CC kernel/exit.o CC kernel/signal.o CC kernel/sys.o CC kernel/power/console.o LD kernel/power/built-in.o CC kernel/acct.o LD kernel/built-in.o CC fs/open.o CC fs/dquot.o CC fs/devpts/inode.o LD fs/devpts/devpts.o LD fs/devpts/built-in.o CC fs/proc/array.o CC fs/proc/proc_tty.o CC fs/proc/proc_misc.o LD fs/proc/proc.o LD fs/proc/built-in.o LD fs/built-in.o CC drivers/char/mem.o drivers/char/mem.c: In function `mmap_kmem': drivers/char/mem.c:276: warning: cast to pointer from integer of different size CC drivers/char/tty_io.o In file included from include/linux/selection.h:11, from drivers/char/tty_io.c:104: include/linux/vt_buffer.h:19:21: asm/vga.h: No such file or directory make[2]: *** [drivers/char/tty_io.o] Error 1 make[1]: *** [drivers/char] Error 2 make: *** [drivers] Error 222 Replies
- Altera_Forum
Honored Contributor
You should not follow the old buildroot guide. Do not cd linux-2.6.x to make kernel.
DO NOT MIX UP. Follow the step in the new wiki, http://nioswiki.jot.com/wikihome/operating...nux/uclinuxdist (http://nioswiki.jot.com/wikihome/operatingsystems/%c2%b5clinux/uclinuxdist) - Altera_Forum
Honored Contributor
dear hippo, when i process the step according to this command:
------------------------------------------ Then <exit> <exit> <yes> . (see LinuxConfig for kernel config items) # compile kernel and apps make make romfs# rebuild kernel for initramfs make linux image ----------------------------------------- when execute the command : [wangzhiwunpu@localhost uClinux-dist-test]$ make sl -lcrypt -lutil -lc xloader.c:31:29: asm/uCbootstrap.h: No such file or directory xloader.c:61: error: syntax error before "m" xloader.c:61: warning: data definition has no type or storage class xloader.c:67: error: syntax error before "header" xloader.c:67: warning: data definition has no type or storage class xloader.c:98: error: syntax error before "program" xloader.c:99: error: syntax error before "program2" xloader.c:100: error: syntax error before "ramload" xloader.c:101: error: syntax error before "setbenv" xloader.c: In function `_bsc1': xloader.c:108: error: syntax error before '*' token xloader.c:114: error: syntax error before '{' token xloader.c:191: error: parameter `err' is initialized xloader.c:195: error: syntax error before "c" xloader.c:367: error: redefinition of parameter 'i' xloader.c:190: error: previous definition of 'i' was here xloader.c:368: error: parameter `bytes_read' is initialized xloader.c:375: error: syntax error before "if" xloader.c:629: error: syntax error before "for" xloader.c:647: error: redefinition of parameter 'statbuf' xloader.c:366: error: previous definition of 'statbuf' was here xloader.c:648: error: redefinition of parameter 'filesize' xloader.c:367: error: previous definition of 'filesize' was here xloader.c:648: error: redefinition of parameter 'i' xloader.c:367: error: previous definition of 'i' was here xloader.c:648: error: redefinition of parameter 'n' xloader.c:367: error: previous definition of 'n' was here xloader.c:649: error: redefinition of parameter 'percent' xloader.c:370: error: previous definition of 'percent' was here xloader.c:650: error: redefinition of parameter 'ferror_image' xloader.c:371: error: previous definition of 'ferror_image' was here xloader.c:653: error: syntax error before "if" make[2]: *** [xloader] Error 1 make[2]: Leaving directory `/home/wangzhiwunpu/uClinux-dist-test/user/boottools' make[1]: *** [all] Error 2 make[1]: Leaving directory `/home/wangzhiwunpu/uClinux-dist-test/user' make: *** [subdirs] Error 1 [wangzhiwunpu@localhost uClinux-dist-test]$ thanks!! - Altera_Forum
Honored Contributor
1. Did you apply the Nios2 patches to uClinux-dist-test?
2. when you run "make menuconfig" , check if you have the correct target? Vendor/Product Selection ---> --- Select the Vendor you wish to target (Altera) Vendor --- Select the Product you wish to target (nios2nommu) Altera Products then <exit> 3. still in "make menuconfig", try restore to default setting, Kernel/Library/Defaults Selection ---> (linux-2.6.x) Kernel Version (None) Libc Version [*] Default all settings (lose changes) [ ] Customize Kernel Settings [ ] Customize Vendor/User Settings [ ] Update Default Vendor Settings Then <exit> <exit> <yes> 4. "make" again.cd ~ tar jxf uClinux-dist-test-20060511.tar.bz2 cd uClinux-dist-test zcat uClinux-dist.diff.gz | patch -p0 - Altera_Forum
Honored Contributor
dear hippo,
Thank you, when I do according to you i could do next commands successfully, -------------------------------------# compile kernel and apps make make romfs# rebuild kernel for initramfs make linux image ---------------------------------sucessed then i do : http://nioswiki.jot.com/wikihome/operating...x/tryoutuclinux (http://nioswiki.jot.com/wikihome/operatingsystems/%c2%b5clinux/tryoutuclinux) ------------------- /cygdrive/c/altera [sopc builder]$ nios2-download -g zImage... Using cable "byteBlaster II [LPT1]",device1,instance 0x00 pausing target processor:OK downloaded 745KB in 17.9s<42.1KB/s> Verify failed Leaving target processor pauseed cygdrive/c/altera thanks - Altera_Forum
Honored Contributor
It may be
1. problem of sdram timing or hardware, you should run some sdram test or hello on IDE/HAL . 2. byteblaster is not stable, altera recommend usb blaster for nios2 download. Try add termination to jtag signal on your board. - Altera_Forum
Honored Contributor
If I were you, I wouldn't try to jump right into uCLinux on a new board. I would start small, with something like "Hello World" or "Count Binary". Be sure that all of your major interfaces (flash, RAM, etc.) function before moving on to anything more complex. There's even a provided example for testing the flash and SDRAM, though you'll have to modify it, slightly, to get it to fully test your system.
It's like building a wall. You wouldn't want to add another layer of bricks to something that isn't solid, would you? Best Regards, - slacker - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by hippo@May 31 2006, 11:15 AM it may be1. problem of sdram timing or hardware, you should run some sdram test or hello on ide/hal .
2. byteblaster is not stable, altera recommend usb blaster for nios2 download.
try add termination to jtag signal on your board.
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=15704)
--- quote end ---
--- Quote End --- You have 8MB sdram, you should set boot loader offset to 5M in kernel config. http://nioswiki.jot.com/wikihome/operating...nux/linuxconfig (http://nioswiki.jot.com/wikihome/operatingsystems/%c2%b5clinux/linuxconfig) cd ~/uClinux-dist-test make menuconfig Kernel/Library/Defaults Selection ---> (linux-2.6.x) Kernel Version (None) Libc Version [ ] Default all settings (lose changes) [*] Customize Kernel Settings [ ] Customize Vendor/User Settings [ ] Update Default Vendor Settings Then <exit> <exit> <yes> <div class='quotetop'>QUOTE </div> --- Quote Start --- If you use DEII with 8M sdram, change the link address of the uncompress loader, Processor type and features-->(0x00500000) Link address offset for booting. The zImage load address is ( your sdram base address + link address offset ) . The zImage boot loader does not relocate itself.[/b] --- Quote End --- Then "make" again.
- Altera_Forum
Honored Contributor
<div class='quotetop'>QUOTE </div>
--- Quote Start --- If you use DEII with 8M sdram, change the link address of the uncompress loader, Processor type and features-->(0x00500000) Link address offset for booting. The zImage load address is ( your sdram base address + link address offset ) . The zImage boot loader does not relocate itself.[/b] --- Quote End --- ==================================== Thanks,I am sure the FLASH and the SDRAM is no problem ,because i tested the hardware and can run UCOS/2 application and other programs. the flash(8MB) base address is 0x000000,the sdram(8MB) base address is 0x800000,so i set the zImage load address :0x500000+0x800000=0x0d00000, and then make ,still has the same problem. why set the link address offset 0x500000? thanks - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by nwpu_zhf2004@May 31 2006, 03:40 PM <div class='quotetop'>quote--- quote end ---
--- quote start ---
if you use deii with 8m sdram, change the link address of the uncompress loader,
processor type and features-->(0x00500000) link address offset for booting.
the zimage load address is ( your sdram base address + link address offset ) . the zimage boot loader does not relocate itself. --- Quote End --- ==================================== Thanks,I am sure the FLASH and the SDRAM is no problem ,because i tested the hardware and can run UCOS/2 application and other programs. the flash(8MB) base address is 0x000000,the sdram(8MB) base address is 0x800000,so i set the zImage load address :0x500000+0x800000=0x0d00000, and then make ,still has the same problem. why set the link address offset 0x500000? thanks <div align='right'><{post_snapback}> (index.php?act=findpost&pid=15713)</div> [/b] --- Quote End --- Did you "make linux image" ? You should set Link address offset for booting to 0x500000, not 0xd00000 . Kernel config will add up with sdram start. During nios2-download , what is the load address show up? try, nios2-linux-uclibc-objdump -h zImage it should display, .text start from VMA/LMA 0xd00000 .
- Altera_Forum
Honored Contributor
Thank you very much! you are so intelligent !
I have successed! thank you very much again!!!