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++
12748 ディスカッション

Problems with installing Nios2 Linux

Altera_Forum
名誉コントリビューター II
3,028件の閲覧回数

I am attempting to install the Nios2 Linux development tools on a Centos 6.3 based system. 

 

I am somewhat confused by the instructions (on alteras wiki: Install_Nios_II_Linux). They indicate that the test-nios2 branch is the current branch of the kernel, but the nios2-linux-20100621.tar doesn't come automatically configured for this branch. The instructions also indicate that the current kernel uses the Devicetree approach to configuring the kernel for hardware, though, if I build with the test-nios2 branch, I have to use the vendor_hwselect mechanism 

 

Can someone tell me what the current branch is (test-nios2 or nios2mmu under linux-2.6 and test-nios2 or trunk under uClinux-dist) and what the current hardware customization mechanism is (vendor_hwselect, devicetree or sopc generated header)? 

Also, assuming that the current hardware customization is something other than vendor_hwselect, how do I configure things to get it? 

 

Thanks in advance. I'm trying to get ready to use this in a college class that starts at the end of September. 

D.W. Lynn 

 

For reference, Here is what I did, working from the Install_Nios_II_Linux instructions on the wiki, specifically using nios2-linux-20100621.tar. 

The tool-chain build step first complained: 

 

/home/lynnd/nios2-linux/toolchain-build/u-boot.mk:11: Board not defined! Using EP1S10 as default. 

 

and later fails with the following: 

... 

home/lynnd/nios2-linux/uClibc' 

make[2]: `conf' is up to date. 

CC libpthread/linuxthreads.old/cancel.o 

In file included from ./include/sys/syscall.h:34, 

from libpthread/linuxthreads.old/restart.h:16, 

from libpthread/linuxthreads.old/cancel.c:23: 

./include/bits/syscalls.h:10:23: asm/traps.h: No such file or directory 

make[1]: *** [libpthread/linuxthreads.old/cancel.o] Error 1 

make[1]: Leaving directory `/home/lynnd/nios2-linux/uClibc' 

make: *** [/home/lynnd/nios2-linux/toolchain-build/../uClibc/lib/libc.a] Error 2 

 

So, I switched to the prebuild binary toolchain, which worked. Then I attempted to make the kernel per the instructions using the make menuconfig process. There were lots of undefaulted options. On the final kernel make, I had to do "make CROSS-COMPILE=nios2-linux- since the default CROSS_COMPILE was nios2-linux-gnu- 

and that's not how the binary toolchain installed and I couldn't find the CROSS_COMPILE option in make menuconfig kernel customization. 

 

However, I still got the following error: 

 

/home/lynnd/nios2-linux/linux-2.6/arch/nios2/kernel/entry.S: Assembler messages: 

/home/lynnd/nios2-linux/linux-2.6/arch/nios2/kernel/entry.S:542: Error: expecting control register 

/home/lynnd/nios2-linux/linux-2.6/arch/nios2/kernel/entry.S:542: Error: unknown register r6 

make[3]: *** [arch/nios2/kernel/entry.o] Error 1 

 

Following some hints elsewhere in the forum, I removed the nios2-linux/ directory completely and untarred nios2-linux-20100621.tar again (to start fresh). Then, 

before doing the ./checkout step, I did "git checkout test-nios2 -f" in both the uClinux and the linux-2.6 directories. 

 

Now the kernel make process succeeds even though it uses the vendor_hwselect mechanism. Note that the documentation for Devicetree (linux-2.6/Documentation/devicetree) does not exist in the test-nios2 branch and make menuconfig in this branch does not give options for using the Device tree approach (that I could find).
0 件の賞賛
32 返答(返信)
Altera_Forum
名誉コントリビューター II
580件の閲覧回数

 

--- Quote Start ---  

Hi, 

 

 

 

This is a long term bug which is caused by using the compiler optimization algorithm. ____ilog2_NaN is inserted to check the sanity of variable, and this function is eliminated during the optimization in normal situations, so the kernal will not call it actually. But it seems that they have finally given up this doubtful method. 

 

http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1340693.html 

 

So, please try to delete the function ____ilog2_NaN from the file 'include/linux/log2.h' according to the diff contents which is written in the last part of its mail. 

 

Kazu 

--- Quote End ---  

 

 

 

Thanks a lot, now I'm getting somewhere. I got a new compiler error that I think is something with the linker.  

 

nios2-linux-gnu-gcc: unrecognized option `-shared' /opt/nios2/lib/gcc/nios2-linux-uclibc/3.4.6/../../../../nios2-linux-uclibc/lib/crt1.o(.text+0x10): In function `_start': : undefined reference to `main' /opt/nios2/lib/gcc/nios2-linux-uclibc/3.4.6/../../../../nios2-linux-uclibc/lib/crt1.o(.text+0x14): In function `_start': : undefined reference to `main' collect2: ld returned 1 exit status make: *** Error 1 make: Leaving directory `/home/developer/altera/nios2-linux/uClinux-dist/lib/lzo/build-lzo-2.03/src' make: *** Error 1 make: Leaving directory `/home/developer/altera/nios2-linux/uClinux-dist/lib/lzo/build-lzo-2.03' make: *** Error 2 make: Leaving directory `/home/developer/altera/nios2-linux/uClinux-dist/lib/lzo' make: *** Error 2 make: Leaving directory `/home/developer/altera/nios2-linux/uClinux-dist/lib' make: *** Error 2 make: Leaving directory `/home/developer/altera/nios2-linux/uClinux-dist/lib' make: *** Error 1
Altera_Forum
名誉コントリビューター II
580件の閲覧回数

Hi, 

 

 

--- Quote Start ---  

Thanks a lot, now I'm getting somewhere. I got a new compiler error that I think is something with the linker.  

 

nios2-linux-gnu-gcc: unrecognized option `-shared' /opt/nios2/lib/gcc/nios2-linux-uclibc/3.4.6/../../../../nios2-linux-uclibc/lib/crt1.o(.text+0x10): In function `_start': : undefined reference to `main' /opt/nios2/lib/gcc/nios2-linux-uclibc/3.4.6/../../../../nios2-linux-uclibc/lib/crt1.o(.text+0x14): In function `_start': : undefined reference to `main' collect2: ld returned 1 exit status make: *** Error 1 make: Leaving directory `/home/developer/altera/nios2-linux/uClinux-dist/lib/lzo/build-lzo-2.03/src' make: *** Error 1 make: Leaving directory `/home/developer/altera/nios2-linux/uClinux-dist/lib/lzo/build-lzo-2.03' make: *** Error 2 make: Leaving directory `/home/developer/altera/nios2-linux/uClinux-dist/lib/lzo' make: *** Error 2 make: Leaving directory `/home/developer/altera/nios2-linux/uClinux-dist/lib' make: *** Error 2 make: Leaving directory `/home/developer/altera/nios2-linux/uClinux-dist/lib' make: *** Error 1 

--- Quote End ---  

 

 

If you are going to implement the 'no-mmu' version of Linux Kernel (=uClinux), it is impossible to use shared libraries because each task is loaded into each (different) address. 

So you must give up to compile the library 'lzo'. 

 

Kernel/Library/Defaluts Selection ---> Customize Application/Library Settings Exit Exit Library Configuration ---> Build liblzo <=== Do not select  

 

If you want to use shared libraries, please change the kernel to mmu version. But you must also change the build tool to 'toolchain-mmu'. 

 

Kazu
Altera_Forum
名誉コントリビューター II
580件の閲覧回数

 

--- Quote Start ---  

Hi, 

 

 

 

If you are going to implement the 'no-mmu' version of Linux Kernel (=uClinux), it is impossible to use shared libraries because each task is loaded into each (different) address. 

So you must give up to compile the library 'lzo'. 

 

Kernel/Library/Defaluts Selection ---> Customize Application/Library Settings Exit Exit Library Configuration ---> Build liblzo <=== Do not select  

 

 

If you want to use shared libraries, please change the kernel to mmu version. But you must also change the build tool to 'toolchain-mmu'. 

 

Kazu 

--- Quote End ---  

 

 

 

Thank you so much for making it clear. Now I changed the path to only the mmu toolchain. I can perform a build but when I load it to the FPGA nothing displays. What can it be? 

 

$ nios2-download -g newzImage Using cable "USB-Blaster ", device 1, instance 0x00 Pausing target processor: OK Initializing CPU cache (if present) OK Downloaded 5709KB in 29.2s (195.5KB/s) Verified OK Starting processor at address 0xC1000000 developer@1604:/opt/intelFPGA_lite/16.1/nios2eds$ nios2-terminal nios2-terminal: connected to hardware target using JTAG UART on cable nios2-terminal: "USB-Blaster ", device 1, instance 0 nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate 

 

I had to make these changes to make it build: 

 

To build this thing on 64-bit ubuntu I had to do the following: 

 

$ LIBRARY_PATH=/usr/lib/x86_64-linux-gnu 

 

append the toolchain-mmu to your path 

 

$ PATH=$PATH:/home/developer/altera/nios2-linux/toolchain-mmu/x86-linux2/bin 

 

edit line 373 in /home/developer/altera/nios2-linux/linux-2.6/kernel/timeconst.pl 

 

and remove the define so that the conditions looks like: 

 

if (!@val) 

 

comment out line 2 

 

//#define _POSIX_C_SOURCE 199309 

 

in the file /home/developer/altera/nios2-linux/uClinux-dist/user/mtd-utils/36d8de81049c9c908740b690c664b5bd3703ccd6/serve_image.c 

 

edit the file /home/developer/altera/nios2-linux/uClinux-dist/vendors/Altera/nios2/Makefile 

and remove the references to syslog.conf and sc.cfg on line 12 

 

Now the thing builds.
Altera_Forum
名誉コントリビューター II
580件の閲覧回数

Thank you so much for making it clear. Now I changed the path to only the mmu toolchain. I can perform a build but when I load it to the FPGA there is kernel panic. How can I resolve that? 

 

s$ cp /home/developer/altera/nios2-linux/uClinux-dist/linux-2.6.x/arch/nios2/boot/zImage myzImage developer@1604:/opt/intelFPGA_lite/16.1/nios2eds$ nios2-download -g myzImage Using cable "USB-Blaster ", device 1, instance 0x00 Pausing target processor: OK Initializing CPU cache (if present) OK Downloaded 5708KB in 29.4s (194.1KB/s) Verified OK Starting processor at address 0xC1000000 developer@1604:/opt/intelFPGA_lite/16.1/nios2eds$ nios2-terminal nios2-terminal: connected to hardware target using JTAG UART on cable nios2-terminal: "USB-Blaster ", device 1, instance 0 nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate) Linux version 3.5.0-rc4-01329-ga227997-dirty (developer@1604) (gcBUG: failure at /home/developer/altera/nios2-linux/linux-2.6/arch/nios2/kernel/time.c:112/nios2_late_time_init()! Kernel panic - not syncing: BUG!  

 

I had to make these changes to make it build: 

 

To build this thing on 64-bit ubuntu I had to do the following: 

 

$ LIBRARY_PATH=/usr/lib/x86_64-linux-gnu 

 

append the toolchain-mmu to your path 

 

$ PATH=$PATH:/home/developer/altera/nios2-linux/toolchain-mmu/x86-linux2/bin 

 

edit line 373 in /home/developer/altera/nios2-linux/linux-2.6/kernel/timeconst.pl 

 

and remove the define so that the conditions looks like: 

 

if (!@val) 

 

comment out line 2 

 

//#define _POSIX_C_SOURCE 199309 

 

in the file /home/developer/altera/nios2-linux/uClinux-dist/user/mtd-utils/36d8de81049c9c908740b690c664b5bd3703ccd6/serve_image.c 

 

edit the file /home/developer/altera/nios2-linux/uClinux-dist/vendors/Altera/nios2/Makefile 

and remove the references to syslog.conf and sc.cfg on line 12 

 

Now the thing builds. But there is kernel panic.
Altera_Forum
名誉コントリビューター II
580件の閲覧回数

 

--- Quote Start ---  

Hi, 

 

 

 

If you are going to implement the 'no-mmu' version of Linux Kernel (=uClinux), it is impossible to use shared libraries because each task is loaded into each (different) address. 

So you must give up to compile the library 'lzo'. 

 

Kernel/Library/Defaluts Selection ---> Customize Application/Library Settings Exit Exit Library Configuration ---> Build liblzo <=== Do not select  

 

If you want to use shared libraries, please change the kernel to mmu version. But you must also change the build tool to 'toolchain-mmu'. 

 

Kazu 

--- Quote End ---  

 

 

ok it appears to work now. i built it with 64-bit ubuntu 16.04 

 

$ nios2-download -g /home/developer/altera/nios2-linux/uClinux-dist/linux-2.6.x/arch/nios2/boot/zImage Using cable "USB-Blaster ", device 1, instance 0x00 Pausing target processor: OK Initializing CPU cache (if present) OK Downloaded 3606KB in 18.1s (199.2KB/s) Verified OK Starting processor at address 0xC1000000 developer@1604:/opt/intelFPGA_lite/16.1/nios2eds$ nios2-terminal nios2-terminal: connected to hardware target using JTAG UART on cable nios2-terminal: "USB-Blaster ", device 1, instance 0 nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate) Linux version 3.5.0-rc4-01329-ga227997-dirty (developer@1604) (gcc version 4.1.2)# 765 Thu Mar 30 10:37:36 CEST 2017 bootconsole enabled early_console initialized at 0xe8001440 On node 0 totalpages: 32768 free_area_init_node: node 0, pgdat c0486930, node_mem_map c0497960 DMA zone: 256 pages used for memmap DMA zone: 0 pages reserved DMA zone: 32512 pages, LIFO batch:7 &#65533;pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768 pcpu-alloc: 0 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512 Kernel command line: PID hash table entries: 512 (order: -1, 2048 bytes) Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) Memory available: 125212k/4693k RAM (1441k kernel code, 3251k data) NR_IRQS:64 Calibrating delay loop... 19.32 BogoMIPS (lpj=9664) pid_max: default: 32768 minimum: 301 &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;Mount-cache hash table entries: 512 bio: create slab <bio-0> at 0 Switching to clocksource timer jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc. msgmni has been set to 244 Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254) io scheduler noop registered io scheduler deadline registered io scheduler cfq registered (default) ttyAL0 at MMIO 0x8001400 (irq = 2) is a Altera UART console enabled, bootconsole disabled  

 

thanks for all the help!
Altera_Forum
名誉コントリビューター II
580件の閲覧回数

Hi, 

 

 

--- Quote Start ---  

Thank you so much for making it clear. Now I changed the path to only the mmu toolchain. I can perform a build but when I load it to the FPGA nothing displays. What can it be? 

 

$ nios2-download -g newzImage Using cable "USB-Blaster ", device 1, instance 0x00 Pausing target processor: OK Initializing CPU cache (if present) OK Downloaded 5709KB in 29.2s (195.5KB/s) Verified OK Starting processor at address 0xC1000000 developer@1604:/opt/intelFPGA_lite/16.1/nios2eds$ nios2-terminal nios2-terminal: connected to hardware target using JTAG UART on cable nios2-terminal: "USB-Blaster ", device 1, instance 0 nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate 

 

I had to make these changes to make it build: 

 

To build this thing on 64-bit ubuntu I had to do the following: 

 

$ LIBRARY_PATH=/usr/lib/x86_64-linux-gnu 

 

append the toolchain-mmu to your path 

 

$ PATH=$PATH:/home/developer/altera/nios2-linux/toolchain-mmu/x86-linux2/bin 

 

edit line 373 in /home/developer/altera/nios2-linux/linux-2.6/kernel/timeconst.pl 

 

and remove the define so that the conditions looks like: 

 

if (!@val) 

 

comment out line 2 

 

//#define _POSIX_C_SOURCE 199309 

 

in the file /home/developer/altera/nios2-linux/uClinux-dist/user/mtd-utils/36d8de81049c9c908740b690c664b5bd3703ccd6/serve_image.c 

 

edit the file /home/developer/altera/nios2-linux/uClinux-dist/vendors/Altera/nios2/Makefile 

and remove the references to syslog.conf and sc.cfg on line 12 

 

Now the thing builds. 

--- Quote End ---  

 

 

Did you setup your hardware correctly? You need the system at least with Nios2 f-core, MMU, on-chip memory for the TLB exceptions, main memory, timer and jtag-uart. And also you must inform those base addresses and irq No. to your kernel for its configuration. Please refer to the next video for example. 

 

https://www.youtube.com/watch?v=rxlyezof0rs 

 

Kazu
Altera_Forum
名誉コントリビューター II
580件の閲覧回数

 

--- Quote Start ---  

Hi, 

 

 

 

Did you setup your hardware correctly? You need the system at least with Nios2 f-core, MMU, on-chip memory for the TLB exceptions, main memory, timer and jtag-uart. And also you must inform those base addresses and irq No. to your kernel for its configuration. Please refer to the next video for example. 

 

https://www.youtube.com/watch?v=rxlyezof0rs 

 

Kazu 

--- Quote End ---  

 

 

Yes, I believe I have done that but I'm using Ubuntu 64-bit 16.04 to build the kernel.  

 

i'm very happy that it starts now but I wonder about " 

cp: can't stat '/etc/sc.cfg': No such file or directory". This is how it looks 

Linux version 3.5.0-rc4-01329-ga227997-dirty (developer@1604) (gcc version 4.1.7 bootconsole enabled early_console initialized at 0xe8001400 On node 0 totalpages: 32768 free_area_init_node: node 0, pgdat c0578104, node_mem_map c058d960 DMA zone: 256 pages used for memmap DMA zone: 0 pages reserved DMA zone: 32512 pages, LIFO batch:7 pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768 pcpu-alloc: 0 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512 Kernel command line: PID hash table entries: 512 (order: -1, 2048 bytes) Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) Memory available: 124228k/5678k RAM (2256k kernel code, 3421k data) NR_IRQS:64 Calibrating delay loop... 19.32 BogoMIPS (lpj=9664) pid_max: default: 32768 minimum: 301 Mount-cache hash table entries: 512 NET: Registered protocol family 16 bio: create slab <bio-0> at 0 Switching to clocksource timer NET: Registered protocol family 2 IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 4096 (order: 3, 32768 bytes) TCP bind hash table entries: 4096 (order: 2, 16384 bytes) TCP: Hash tables configured (established 4096 bind 4096) TCP: reno registered UDP hash table entries: 256 (order: 0, 4096 bytes) UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) NET: Registered protocol family 1 RPC: Registered named UNIX socket transport module. RPC: Registered udp transport module. RPC: Registered tcp transport module. RPC: Registered tcp NFSv4.1 backchannel transport module. jffs2: version 2.2. (NAND) &#65533;© 2001-2006 Red Hat, Inc. msgmni has been set to 242 Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254) io scheduler noop registered io scheduler deadline registered io scheduler cfq registered (default) ttyAL0 at MMIO 0x8001400 (irq = 2) is a Altera UART console enabled, bootconsole disabled console enabled, bootconsole disabled ttyJ0 at MMIO 0x8001440 (irq = 1) is a Altera JTAG UART mousedev: PS/2 mouse device common for all mice TCP: cubic registered NET: Registered protocol family 17 Freeing unused kernel memory: 2824k freed (0xc0235000 - 0xc04f7000) ifconfig: SIOCSIFADDR: No such device ifconfig: SIOCSIFADDR: No such device Welcome to ____ _ _ / __| ||_| _ _| | | | _ ____ _ _ _ _ | | | | | | || | _ \| | | |\ \/ / | |_| | |__| || | | | | |_| |/ \ | ___\____|_||_|_| |_|\____|\_/\_/ | | |_| Symmetricom Demo cp: can't stat '/etc/sc.cfg': No such file or directory insmod: can't insert '/usr/sbin/fpga.ko': No such file or directory BusyBox v1.18.4 (2017-03-30 15:19:20 CEST) multi-call binary. Usage: mknod NAME TYPE MAJOR MINOR sh: can't execute 'rsyslogd': No such file or directory BusyBox v1.18.4 (2017-03-30 15:19:20 CEST) hush - the humble shell Enter 'help' for a list of built-in commands. root:~>
Altera_Forum
名誉コントリビューター II
580件の閲覧回数

Hi, 

 

 

--- Quote Start ---  

 

i'm very happy that it starts now but I wonder about " 

cp: can't stat '/etc/sc.cfg': No such file or directory". This is how it looks 

 

--- Quote End ---  

 

 

Of course, you did 

 

 

--- Quote Start ---  

 

edit the file /home/developer/altera/nios2-linux/uClinux-dist/vendors/Altera/nios2/Makefile 

and remove the references to syslog.conf and sc.cfg on line 12 

 

--- Quote End ---  

 

Copying 'sc.cfg' file is written in the 'rc' script file or somewhere ? 

 

Kazu
Altera_Forum
名誉コントリビューター II
580件の閲覧回数

 

--- Quote Start ---  

Hi, 

 

 

 

Of course, you did 

 

 

Copying 'sc.cfg' file is written in the 'rc' script file or somewhere ? 

 

Kazu 

--- Quote End ---  

 

 

It's the Makefile that assumes the sc.cfg and syslog.conf 

 

I don't know what do to about it. If I remove those two variables then it builds, but they should be somewhere shouldn't they? The other changes was because of deprecation in Perl about define statement and a header in serve_image.c that I had to comment out but I don't know what I'm doing.  

 

## Makefile -- Build instructions for Altera/nios2# .EXPORT_ALL_VARIABLES: include $(LINUX_CONFIG) include $(CONFIG_CONFIG) ROMFS_DIRS-y = bin etc etc/dhcpc home lib mnt proc sys usr var root home tmp etc/config var/run var/lib/misc usr/sbin ETC_FILES-y = filesystems group issue mdev.conf mime.types modprobe.conf motd passwd profile rc TZ nsswitch.conf syslog.conf sc.cfg WEB_FILES-y = ETC_FILES-$(CONFIG_NET) += hosts host.conf protocols services ETC_FILES-$(CONFIG_USER_INETD_INETD) += inetd.conf ETC_FILES-$(CONFIG_USER_BUSYBOX_INETD) += inetd.conf ROMFS_DIRS-$(CONFIG_USER_BUSYBOX_FTPD) += home/ftpd ROMFS_DIRS-$(CONFIG_USER_BUSYBOX_TFTPD) += home/tftpboot ROMFS_DIRS-$(CONFIG_USER_BUSYBOX_HTTPD) += home/httpd home/httpd/cgi-bin WEB_FILES-$(CONFIG_USER_BUSYBOX_HTTPD) += index.html favicon.ico ROMFS_DIRS-$(CONFIG_USER_BOA_SRC_BOA) += home/httpd home/httpd/cgi-bin etc/boa var/log/boa ETC_FILES-$(CONFIG_USER_BOA_SRC_BOA) += boa.conf WEB_FILES-$(CONFIG_USER_BOA_SRC_BOA) += boa.conf index.html favicon.ico MKFS_JFFS2_FLAGS = -l -p -e 128 all:: romfs.post:: romfs.shared.libs romfs:: mkdir -p $(ROMFSDIR) cd $(ROMFSDIR) && mkdir -p $(ROMFS_DIRS-y) chmod 1777 $(ROMFSDIR)/tmp $(ROMFSINST) -s bin /sbin $(ROMFSINST) /etc/inittab set -e ; for f in $(ETC_FILES-y) ; do $(ROMFSINST) ../common/$$f /etc/$$f ; done ; for f in $(WEB_FILES-y) ; do $(ROMFSINST) ../common/$$f /home/httpd/$$f ; done $(ROMFSINST) -e CONFIG_USER_BUSYBOX_FTPD -a "21 stream tcp nowait root ftpd ftpd -w /home/ftpd" /etc/inetd.conf $(ROMFSINST) -e CONFIG_USER_BUSYBOX_TELNETD -a "23 stream tcp nowait root telnetd telnetd -i" /etc/inetd.conf $(ROMFSINST) -e CONFIG_USER_BUSYBOX_TFTPD -a "69 dgram udp nowait root tftpd tftpd -c /home/tftpboot" /etc/inetd.conf $(ROMFSINST) -e CONFIG_USER_BUSYBOX_HTTPD -a "80 stream tcp nowait root httpd httpd -i -h /home/httpd" /etc/inetd.conf echo "$(VERSIONSTR) -- `date`" > $(ROMFSDIR)/etc/version ifeq ($(CONFIG_BLACKFIN_INSTALL_UCLINUX_CONFIG),y) gzip -9c $(ROOTDIR)/config/.config > $(ROMFSDIR)/root/uclinux-config.gz gzip -9c $(ROOTDIR)/.config > $(ROMFSDIR)/root/vendor-board-config.gz endif ifeq ($(CONFIG_USER_DEV_DYNAMIC),y) DEVICE_TABLE = device_table-min.txt else ifeq ($(CONFIG_USER_BUSYBOX_MDEV),y) $(warning ) $(warning You have busybox's mdev enabled. The static device tree will be) $(warning overridden during boot by a tmpfs in /dev.) $(warning ) endif DEVICE_TABLE = device_table.txt endif # these targets can be found in Altera/vendor.mak image:: mkdir -p $(IMAGEDIR) rm -rf $(IMAGEDIR)/* $(MAKE) image.rootfs.all $(MAKE) image.kernel.all $(MAKE) image.uimage.all $(MAKE) image.zimage.all clean:: .PHONY: all clean image romfs include ../../$(CONFIG_VENDOR)/vendor.mak
Altera_Forum
名誉コントリビューター II
580件の閲覧回数

Hi, 

 

 

--- Quote Start ---  

It's the Makefile that assumes the sc.cfg and syslog.conf 

 

I don't know what do to about it. If I remove those two variables then it builds, but they should be somewhere shouldn't they? The other changes was because of deprecation in Perl about define statement and a header in serve_image.c that I had to comment out but I don't know what I'm doing.  

 

--- Quote End ---  

 

 

The files which are indicated by the tag ETC_FILES-y 

 

# ETC_FILES-y = filesystems group issue mdev.conf mime.types modprobe.conf motd passwd profile rc TZ nsswitch.conf syslog.conf sc.cfg  

 

are copied from your /nios2-linux/uClinux-dist/vendors/Altera/common directory ro /etc.  

 

# for f in $(ETC_FILES-y) ; do $(ROMFSINST) ../common/$$f /etc/$$f ; done ;  

 

So you must create the 'syslog.conf' file (which is used for rsyslogd) and 'sc.cfg' (I don't know what's this). 

 

And you have 4 errors which are caused by your 'rc' script file.  

 

1) ifconfig: SIOCSIFADDR: No such device  

ifconfig: SIOCSIFADDR: No such device 

 

are caused by the lines 86 and 87. 

 

# Set up eth1 IP address ifconfig eth0 192.168.11.4 up ifconfig eth1 192.168.1.4 up  

 

2) cp: can't stat '/etc/sc.cfg': No such file or directory 

 

is caused by the line 93. 

 

# Move SoftClock config file to where it is accessed by application, location is hardcoded in application cp /etc/sc.cfg /var/log  

 

3) insmod: can't insert '/usr/sbin/fpga.ko': No such file or directory 

Usage: mknod [-m MODE] NAME TYPE MAJOR MINOR 

 

are caused by the lines 96 and 101.  

 

# Set up device driver, insert kernel module insmod /usr/sbin/fpga.ko# create device node using major number /proc/devices table CURRWD=`pwd` cd /dev MAJOR_NUM=$(awk 'BEGIN {FS=" "}; {if ($2 == "fpgasymm") print $1;}' /proc/devices) mknod -m=777 fpgasymm c $MAJOR_NUM 0 cd $CURRWD 

 

4) sh: can't execute 'rsyslogd': No such file or directory 

 

is caused by the line 105. 

 

# start rsyslogd daemon rsyslogd -n -m0 -f /etc/syslog.conf &  

 

If you don't require these, please delete or comment out those lines and recompile the kernel. 

 

Kazu
Altera_Forum
名誉コントリビューター II
580件の閲覧回数

 

--- Quote Start ---  

Hi, 

 

 

 

The files which are indicated by the tag ETC_FILES-y 

 

# ETC_FILES-y = filesystems group issue mdev.conf mime.types modprobe.conf motd passwd profile rc TZ nsswitch.conf syslog.conf sc.cfg  

 

are copied from your /nios2-linux/uClinux-dist/vendors/Altera/common directory ro /etc.  

 

# for f in $(ETC_FILES-y) ; do $(ROMFSINST) ../common/$$f /etc/$$f ; done ;  

 

So you must create the 'syslog.conf' file (which is used for rsyslogd) and 'sc.cfg' (I don't know what's this). 

 

And you have 4 errors which are caused by your 'rc' script file.  

 

1) ifconfig: SIOCSIFADDR: No such device  

ifconfig: SIOCSIFADDR: No such device 

 

are caused by the lines 86 and 87. 

 

# Set up eth1 IP address ifconfig eth0 192.168.11.4 up ifconfig eth1 192.168.1.4 up  

 

2) cp: can't stat '/etc/sc.cfg': No such file or directory 

 

is caused by the line 93. 

 

# Move SoftClock config file to where it is accessed by application, location is hardcoded in application cp /etc/sc.cfg /var/log  

 

3) insmod: can't insert '/usr/sbin/fpga.ko': No such file or directory 

Usage: mknod [-m MODE] NAME TYPE MAJOR MINOR 

 

are caused by the lines 96 and 101.  

 

# Set up device driver, insert kernel module insmod /usr/sbin/fpga.ko# create device node using major number /proc/devices table CURRWD=`pwd` cd /dev MAJOR_NUM=$(awk 'BEGIN {FS=" "}; {if ($2 == "fpgasymm") print $1;}' /proc/devices) mknod -m=777 fpgasymm c $MAJOR_NUM 0 cd $CURRWD 

 

4) sh: can't execute 'rsyslogd': No such file or directory 

 

is caused by the line 105. 

 

# start rsyslogd daemon rsyslogd -n -m0 -f /etc/syslog.conf &  

 

If you don't require these, please delete or comment out those lines and recompile the kernel. 

 

Kazu 

--- Quote End ---  

 

 

Now I understsand better. I updated my design in Qsys and added a second timer. Picture https://i.stack.imgur.com/2jywn.png 

If I try and use that design I get this error msg 

Linux version 3.5.0-rc4-01329-ga227997-dirty (developer@1604) (gcLinux version 3.5.0-rc4-01329-ga227997-dirty (developer@1604) (gcc version 4.1.2)# 810 Sat Apr 1 14:23:20 CEST 2017 bootconsole enabled early_console initialized at 0xe8001440 ERROR: Nios II MUL different for kernel and DTS Unable to handle kernel NULL pointer dereference at virtual address 00000000 ea = c0238094, ra = c0238078, cause = 15 Kernel panic - not syncing: Oops  

 

What does it mean?
Altera_Forum
名誉コントリビューター II
580件の閲覧回数

Hi, 

 

 

--- Quote Start ---  

Now I understsand better. I updated my design in Qsys and added a second timer. Picture https://i.stack.imgur.com/2jywn.png 

If I try and use that design I get this error msg 

Linux version 3.5.0-rc4-01329-ga227997-dirty (developer@1604) (gcLinux version 3.5.0-rc4-01329-ga227997-dirty (developer@1604) (gcc version 4.1.2)# 810 Sat Apr 1 14:23:20 CEST 2017 bootconsole enabled early_console initialized at 0xe8001440 ERROR: Nios II MUL different for kernel and DTS Unable to handle kernel NULL pointer dereference at virtual address 00000000 ea = c0238094, ra = c0238078, cause = 15 Kernel panic - not syncing: Oops  

 

What does it mean? 

--- Quote End ---  

 

 

Maybe, you have the file '/arch/nios2/hernel/cpuinfo.c'. 

 

http://lxr.free-electrons.com/source/arch/nios2/kernel/cpuinfo.c 

 

32# define err_cpu(x) 33 pr_err("ERROR: Nios II " x " different for kernel and DTS\n") ....... 75 if (IS_ENABLED(CONFIG_NIOS2_HW_MUL_SUPPORT) && !cpuinfo.has_mul) 76 err_cpu("MUL");  

 

Did you setup 'CONFIG_NIOS2_HW_MUL_SUPPORT'? And also please check the contents of your dst file. 

 

Kazu
返信