Forum Discussion
Compiling Nios II Linux Distribution v1.1
After upgrading to Quartus II 4.0 + SP1, the NIOS II core (eval version), and the NIOS II Linux distribution v1.1, I am struggling to compile the kernel for my Cyclone EP1C20. I’ve followed the quick start guide to the letter but no joy at all.
The NIOS II IDE briefly opens a command line window (e:\quartus\bin\cywin\bash.exe) but it never goes to the menuconfig. I’ve installed cygwin and added e:\cygwin\bin to my path, but when in the NIOS II SDK shell the gcc command is still not recognized. This led me to believe that SOPC Builder 4.0 cannot compile or make anything on its own. ( linux wise, nios2-build works fine ) What am I missing? How do I integrate a compiler? Is there a way to compile the kernel from the NIOS II SDK, I’m still getting used to the IDE - but I think it works cool though. The configure.bat file: @start E:/quartus/bin/cygwin/bin/bash.exe -c "source $QUARTUS_ROOTDIR/sopc_builder/bin/nios_sh; source $SOPC_KIT_NIOS2/user.bashrc; KERNEL_PROJECT=c:/altera/kits/nios2/bin/eclipse/workspace/kernel_1c20; make -C `cygpath -u C:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x` O=`cygpath -u c:/altera/kits/nios2/bin/eclipse/workspace/kernel_1c20/build` menuconfig; " Any help would be cool I’m sure I\m just missing something but for the life of me I don’t know what. It may even be a complete software package but I don’t have a clue at this stage. Thanks to all.8 Replies
- Altera_Forum
Honored Contributor
Two things to try:
(1) Start a Nios II SDK shell, you should see the following text:
If not, then v1.1 may not have installed properly. (2) edit the configure.bat file and remove the @start command from the beginning of the line. Open a Windows Command Prompt shell and try running configure.bat from there. It might shed some more light on the problem. Let me know how it goes...------------------------------------------------ Microtronix Linux Extensions Version 1.1, Built Wed Jul 7 12:46pm EST 2004 ------------------------------------------------ - Altera_Forum
Honored Contributor
Hi Ken
I edited the configure.bat file as you suggested and then executed it from the windows command line and the NIOS SDK Shell both gave the following output: C:\altera\kits\nios2\bin\eclipse\WORKSP~1\KERNEL~1>E:/quartus/bin/cygwin/bin/bash.exe -c "source $QUARTUS_ROOTDIR/sopc_builder/bin/nios_sh; source $SOPC_KIT_NIOS2/user.bashrc; KERNEL_PROJECT=c:/altera/kits/nios2/bin/eclipse/workspace/kernel_1c20; make -C `cygpath -u C:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x` O=`cygpath -u c:/altera/kits/nios2/bin/eclipse/workspace/kernel_1c20/build` menuconfig; "
The gcc: not found tells me that gcc must be working but I dont know what not found means,- and google doesnt know either http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/huh.gif If I just type gcc from the command line it displays gcc: no input files, gcc -v says it is version 3.3.1 (cygming special). hope the info helps. Thanks.------------------------------------------------ Microtronix Linux Extensions Version 1.1, Built Wed Jul 7 12:46pm EST 2004 ------------------------------------------------ make: Entering directory `/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x' HOSTCC scripts/basic/fixdep gcc: not found make: *** Error 127 make: *** Error 2 make: *** Error 2 make: Leaving directory `/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x' - Altera_Forum
Honored Contributor
After applying the Windows NT patch the menuconfig worked, I changed the processor platform to the Cyclone, saved and exited.
Next problem, Build fails with the following errors <div class='quotetop'>QUOTE </div> --- Quote Start --- ------------------------------------------------ Microtronix Linux Extensions Version 1.1, Built Wed Jul 7 12:46pm EST 2004 ------------------------------------------------ make: Entering directory . //Some entries here// . /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/arch/nios2nommu/kernel/pio.c: In function `pio_init': /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/arch/nios2nommu/kernel/pio.c:114: warning: passing arg 2 of `__request_region' makes integer from pointer without a cast /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/arch/nios2nommu/kernel/pio.c:119: warning: passing arg 2 of `__request_region' makes integer from pointer without a cast /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/arch/nios2nommu/kernel/pio.c: In function `pio_exit': /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/arch/nios2nommu/kernel/pio.c:139: warning: passing arg 2 of `__release_region' makes integer from pointer without a cast /cygdrive/c/altera/kits/nios2/bin/ecli LD arch/nios2nommu/kernel/built-in.o AS arch/nios2nommu/kernel/head.o CC arch/nios2nommu/kernel/init_task.o pse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/arch/nios2nommu/kernel/pio.c:144: warning: passing arg 2 of `__release_region' makes integer from pointer without a cast arch/nios2nommu/kernel/.pio.o.d: done. arch/nios2nommu/kernel/.head.o.d: done. arch/nios2nommu/kernel/.init_task.o.d: done. make[2]: *** No rule to make target `arch/nios2nommu/kernel/vmlinux.lds.s', needed by `__build'. Stop. make[1]: *** [arch/nios2nommu/kernel] Error 2 make: *** [all] Error 2 make: Leaving directory `/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x'[/b] --- Quote End --- Any help, does anyone have the makefile entry or rule to make arch/nios2nommu/kernel/vmlinux.lds. Thanks again. Jan Hendrik - Altera_Forum
Honored Contributor
For the time being, the fix to the vmlinux.lds.s problem can be solved by opening a Nios SDK Shell and typing in:
This is a work around to a problem with Cygwin not being able to deal with filenames that have the same name but different case. This problem has been addressed and will not occur in the next release.$ touch $KERNEL_PLUGIN/linux-2.6.x/arch/nios2nommu/kernel/vmlinux.lds.S - Altera_Forum
Honored Contributor
I have a question. I tried to execute gcc command in the Nios 2 SDK Shell and noo gcc command found.
bash: gcc: command not found I verified in D:\quartus\bin\cygwin\bin directory and gcc is effectively not present. How can I do to add it? - Altera_Forum
Honored Contributor
I found the problem.. just install Windows NT patch and I can now compile the kernel... I have now the vmlinux.bin and filesystem binary files
Christian - Altera_Forum
Honored Contributor
TO_BE_DONE
- Altera_Forum
Honored Contributor
SOLVED - I loaded the wrong .sof file, altera_nios_dev_board_cyclone_1c20.sof does NOT work, but when I Loaded C:\altera\kits\nios2\examples\verilog\niosII_cyclone_1c20\standard\standard.sof it worked beautifully
Thanks again guys.