Forum Discussion
Altera_Forum
Honored Contributor
15 years agoQuestion on Git Branches to use [nios2mmu vs unstable-nios2mmu]
Hi everyone
I'm currenlty looking into using Linux on the NIOS for my company. Will be getting a DE4 from Terassic shortly but in the meantime I'm doing all the prepwork to understand as much as possible beforehand. I'm a complete newbie to this whole NIOS/Linux dev so please bear with me... I'll be using MMU support. I have been trying the build with MMU support using the following git branches: "unstable-nios2mmu" in linux-2.6 "trunk" in uClinux-dist after setting Vendor=>Altera, Product=>nios2 and then defaulting config settings, building the project has always failed. I have followed the alterawiki instructions as I understand them. Today after reading the info carefully on this page [alterawiki.com/wiki/Downloading_Linux_Distribution ], specifically the last paragraph, I realised that perphaps the "nios2mmu" branch should be checked out instead of "unstable-nios2mmu" as the shell segment on that page suggests. I then managed to complete a succesful build by again just using default config settings. The last paragraph on the index nios/linux webpage [alterawiki.com/wiki/Linux_for_the_Nios_II_Processor] however suggests that the "unstable-nios2mmu" is the branch be used (to get a current build). I appreciate that the "unstable-nios2mmu" branch is at kernel rev 2.6.39 and "nios2mmu" branch at 2.6.35. So, my questions are: 1: Should I be concerned about the "unstable-nios2mmu" branch not compiling 2: Assuming I can get "unstable-nios2mmu" to compile, which branch is the correct/better one to use Cheers Tones36 Replies
- Altera_Forum
Honored Contributor
nios2mmu uses the custom_fpga.h file to get your hardware configuration as described in http://alterawiki.com/wiki/creating_a_nios_ii_design_with_an_mmu
unstable-nios2mmu moved to using DeviceTree: http://alterawiki.com/wiki/devicetree which is probably why you are having trouble compiling it. - Altera_Forum
Honored Contributor
Yep, that got me sorted on the "unstable-nios2mmu" branch. Thanks alot
- Altera_Forum
Honored Contributor
Hello,
Have you succed to compile a uClinux with MMU ? I try with the nios2mmu branch for linux and trunk for uClinux but I have comiplations errors... Thank you for your help. Best regards. Pierre - Altera_Forum
Honored Contributor
Hi Pierre
I am currently compiling both the nios2mmu and unstable-nios2mmu branches. I must admit though, I did not invest a whole lot of effort into the nios2mmu branch though, it did compile but I want to be working with the latest developments which you'll find in the unstable-mmu branch. Please tell us a bit more about the issues you're facing - Altera_Forum
Honored Contributor
Hi,
I use the nios2mmu branch because it deals with the custom_fpga.h file instead of the device tree (I work with Windows XP and I don't know if the sopc2dts tool works with Windows). I created a board layer like said here in Altera Wiki (alterawiki.com/wiki/Creating_a_Nios_II_Design_with_an_MMU) I downloaded the toolchain nios2gcc-20080203.tar.bz2 Here is my problem: After having exported the PATH (export PATH=$PATH:~/path_to_toolchain/opt/nios2/bin), when I want to compile the kernel, the simple instruction make dosen't work. Here is the trace: ////////////////////////////////////////////////////////////////////////////////// pierre@ubuntu:~/nios_linux_2010/nios2-linux/uClinux-dist$ CROSS_COMPILE=/home/pierre/nios_compilo/opt/nios2/bin/nios2-linux- make make -f tools/autotools.mk autotools-cache make[1]: entrant dans le répertoire « /home/pierre/nios_linux_2010/nios2-linux/uClinux-dist » set -e; mkdir -p /home/pierre/nios_linux_2010/nios2-linux/uClinux-dist/tools/autotools-cache/build//$$; cd /home/pierre/nios_linux_2010/nios2-linux/uClinux-dist/tools/autotools-cache/build//$$; gt=`../../create-target-cache.sh nios2-linux-gnu`; cp $gt /home/pierre/nios_linux_2010/nios2-linux/uClinux-dist/vendors/config/$gt; touch /home/pierre/nios_linux_2010/nios2-linux/uClinux-dist/tools/autotools-cache/build/nios2-linux-gnu ../../create-target-cache.sh: 30: nios2-linux-gnu-gcc: not found ../../create-target-cache.sh: 31: nios2-linux-gnu-gcc: not found Using inc dir for nios2-linux-gnu (nios2-unknown-linux-gnu): ../../create-target-cache.sh: 65: nios2-linux-gnu-gcc: not found xargs: nios2-linux-gnu-readelf: Aucun fichier ou dossier de ce type make[1]: quittant le répertoire « /home/pierre/nios_linux_2010/nios2-linux/uClinux-dist » ln -sf staging-compiler tools/nios2-linux-gnu-gcc ln -sf staging-compiler tools/nios2-linux-gnu-g++ ln -sf staging-compiler tools/nios2-linux-gnu-cpp ln -sf staging-compiler tools/nios2-linux-gnu-ld ln -sf cross-pkg-config tools/nios2-linux-gnu-pkg-config chmod +x tools/romfs-inst.sh tools/modules-alias.sh tools/build-udev-perms.sh . linux-2.6.x/.config; if [ "$CONFIG_INITRAMFS_SOURCE" != "" ]; then mkdir -p `dirname $CONFIG_INITRAMFS_SOURCE`; touch $CONFIG_INITRAMFS_SOURCE || exit 1; fi rm -f linux-2.6.x/usr/initramfs_data.cpio make ARCH=nios2 CROSS_COMPILE=nios2-linux-gnu- O=/home/pierre/nios_linux_2010/nios2-linux/uClinux-dist/linux-2.6.x -j1 -C ../linux-2.6 || exit 1 make[1]: entrant dans le répertoire « /home/pierre/nios_linux_2010/nios2-linux/linux-2.6 » nios2-linux-gnu-gcc: command not found; perhaps you need to fix your PATH? Using /home/pierre/nios_linux_2010/nios2-linux/linux-2.6 as source for kernel GEN /home/pierre/nios_linux_2010/nios2-linux/uClinux-dist/linux-2.6.x/Makefile CHK include/linux/version.h CHK include/generated/utsrelease.h CC kernel/bounds.s nios2-linux-gnu-gcc: command not found; perhaps you need to fix your PATH? make[3]: *** [kernel/bounds.s] Erreur 127 make[2]: *** [prepare0] Erreur 2 make[1]: *** [sub-make] Erreur 2 make[1]: quittant le répertoire « /home/pierre/nios_linux_2010/nios2-linux/linux-2.6 » make: *** [linux] Erreur 1 pierre@ubuntu:~/nios_linux_2010/nios2-linux/uClinux-dist$ ////////////////////////////////////////////////////////////////////////////////// I have to add CONFIGURE_HOST=nios2-linux because, without this, the prefix needed is nios2-linux-gnu witch dosen't exists for me. But then, I have this error : ////////////////////////////////////////////////////////////////////////////////// pierre@ubuntu:~/nios_linux_2010/nios2-linux/uClinux-dist$ CROSS_COMPILE=/home/pierre/nios_compilo/opt/nios2/bin/nios2-linux- make CONFIGURE_HOST=/home/pierre/nios_compilo/opt/nios2/bin/nios2-linux- make -f tools/autotools.mk autotools-cache make[1]: entrant dans le répertoire « /home/pierre/nios_linux_2010/nios2-linux/uClinux-dist » set -e; mkdir -p /home/pierre/nios_linux_2010/nios2-linux/uClinux-dist/tools/autotools-cache/build//home/pierre/nios_compilo/opt/nios2/bin//$$; cd /home/pierre/nios_linux_2010/nios2-linux/uClinux-dist/tools/autotools-cache/build//home/pierre/nios_compilo/opt/nios2/bin//$$; gt=`../../create-target-cache.sh /home/pierre/nios_compilo/opt/nios2/bin/nios2-linux-`; cp $gt /home/pierre/nios_linux_2010/nios2-linux/uClinux-dist/vendors/config/$gt; touch /home/pierre/nios_linux_2010/nios2-linux/uClinux-dist/tools/autotools-cache/build//home/pierre/nios_compilo/opt/nios2/bin/nios2-linux- /bin/sh: ../../create-target-cache.sh: not found make[1]: *** [/home/pierre/nios_linux_2010/nios2-linux/uClinux-dist/tools/autotools-cache/build//home/pierre/nios_compilo/opt/nios2/bin/nios2-linux-] Erreur 127 make[1]: quittant le répertoire « /home/pierre/nios_linux_2010/nios2-linux/uClinux-dist » make: *** [autotools-cache] Erreur 2 pierre@ubuntu:~/nios_linux_2010/nios2-linux/uClinux-dist$ CROSS_COMPILE=/home/pierre/nios_compilo/opt/nios2/bin/nios2-linux- make CONFIGURE_HOST=nios2-linuxmake -f tools/autotools.mk autotools-cache make[1]: entrant dans le répertoire « /home/pierre/nios_linux_2010/nios2-linux/uClinux-dist » make[1]: Rien à faire pour « autotools-cache ». make[1]: quittant le répertoire « /home/pierre/nios_linux_2010/nios2-linux/uClinux-dist » chmod +x tools/romfs-inst.sh tools/modules-alias.sh tools/build-udev-perms.sh . linux-2.6.x/.config; if [ "$CONFIG_INITRAMFS_SOURCE" != "" ]; then mkdir -p `dirname $CONFIG_INITRAMFS_SOURCE`; touch $CONFIG_INITRAMFS_SOURCE || exit 1; fi rm -f linux-2.6.x/usr/initramfs_data.cpio make ARCH=nios2 CROSS_COMPILE=nios2-linux- O=/home/pierre/nios_linux_2010/nios2-linux/uClinux-dist/linux-2.6.x -j1 -C ../linux-2.6 || exit 1 make[1]: entrant dans le répertoire « /home/pierre/nios_linux_2010/nios2-linux/linux-2.6 » Using /home/pierre/nios_linux_2010/nios2-linux/linux-2.6 as source for kernel GEN /home/pierre/nios_linux_2010/nios2-linux/uClinux-dist/linux-2.6.x/Makefile CHK include/linux/version.h CHK include/generated/utsrelease.h CC kernel/bounds.s nios2-linux-gcc: /include: No such file or directory nios2-linux-gcc: /include: No such file or directory make[3]: *** [kernel/bounds.s] Erreur 1 make[2]: *** [prepare0] Erreur 2 make[1]: *** [sub-make] Erreur 2 make[1]: quittant le répertoire « /home/pierre/nios_linux_2010/nios2-linux/linux-2.6 » make: *** [linux] Erreur 1 ////////////////////////////////////////////////////////////////////////////////// Thank you for your help. Best regards. Pierre - Altera_Forum
Honored Contributor
Hi
i didn't read all of your posting, but as I see you used the false toolchain. The Toolchain you used is for noMMU. For the MMU-Version there is already a binary toolchain included. The directory is "toolchain-mmu". You should add "nios2-linux/toolchain-mmu/x86-linux2/bin" to the PATH variable. Urmel - Altera_Forum
Honored Contributor
Thank you for your prompt response.
I try to use the nios2-linux/toolchain-mmu/x86-linux2/bin path, but it the same. I have the same error. Thank you for your help. Pierre - Altera_Forum
Honored Contributor
If the right toolchain is in your PATH, you should not need CROSS_COMPILE or CONFIGURE_HOST.
- Altera_Forum
Honored Contributor
Make sure that only one of the toolchains is in the PATH variable.
As ykozlov wrote there is no need to use CROSS_COMPILE or something like that. So just type 'make' in the "uClinux-dist" directory. Urmel - Altera_Forum
Honored Contributor
Hi,
Thank you for your responses, it works with that. I have another question. I try to use the unstable_nios2mmu branch for linux2.6 and trunk for uClinuxdist in order to use the dts (device tree) support. I try to follow the Altera Wiki (alterawiki.com/wiki/Devicetree) but it's said : //////////////////////////////////////////////////////////////////////////////////// 5) enable device tree support in your uClinux-dist kernel config. enter the full path to your dts file in (), which will be dtc compiled and the dtb is linked into the kernel. important: You may still need to edit the file linux-2.6/arch/nios2/boards/generic-dts/include/asm/nios.h, to match your memory and cpu info. //////////////////////////////////////////////////////////////////////////////////// In the unstable_nios2mmu branch I find any linux-2.6/arch/nios2/boards/generic-dts/include/asm/nios.h path... The only boards are 3c120 or neek... I can select device tree support in kernel config but there are any fields "()" to specify the path to my dts file. Have I the right branch? Thank you very much for your help. Best regards. Pierre