Forum Discussion
Altera_Forum
Honored Contributor
10 years ago --- Quote Start --- Jan I am trying to build Uboot for Nios2 also. No luck but I have learned a few things. Uboot configuration for nios2 has changed significantly. The Alter-Wiki is way out of date. It didn't work for me either. There is a special git repo for nios2 at git://git.denx.de/u-boot-nios.git. Uboot is moving to Kconfig and Make files - i.e. "boards.cfg" is deprecated. This explains why I did not find "boards.cfg" after git cloning. I tried the following on Linux bash. > git clone git://git.denx.de/u-boot-nios.git > cd u-boot-nios/ > make menuconfig These proceeding steps complete with no visible errors or warnings. Make menuconfig has a lot of configuration options - it may support what you are trying to do. You can also run > make config and you'll get many, many configuration choices. Then I run > make all This step fails for me with the following error LD arch/nios2/cpu/built-in.o /bin/sh: nios2-elf-ld.bfd: command not found scripts/Makefile.build:354: recipe for target 'arch/nios2/cpu/built-in.o' failed make[1]: *** [arch/nios2/cpu/built-in.o] Error 127 Makefile:1037: recipe for target 'arch/nios2/cpu' failed make: *** [arch/nios2/cpu] Error 2 I confirmed that both 'nios2-elf-gcc' and 'nios2-elf-ld' are in the path and are executable. And since I have been running Nios2 successfully on Linux this should indicate my 'nios2-elf-gcc' and 'nios2-elf-ld' should be OK. It appears the compile completed but the nios2 linker is not found. Just a heads-up that have been some big changes for the steps required for building Uboot for nios2. Sorry, but I have not found any up-to-date build instructions either. Dave --- Quote End --- To solve the problem of not finding the linker - I had to set the CROSS_COMPILE environment variable using these bash commands. > CROSS_COMPILE=nios2-elf- > export CROSS_COMPILE Then run make and the build completed with no errors. (Now, I need to try to load and test on my nios2 hardware). THIS WAS documented in the README file starting at line 4929. So I deserve a "RTFM idiot". BTW, the README file has 6515 lines. But no doubt - the Uboot build steps for nios2 (on Linux) after cloning the current git repo - have changed substantially. Just for starters, the Altera Wiki said you only need to set CROSS_COMPILE if NOT using the packaged nios2-elf-gcc compiler. So when I did not set this environment variable - I received the link error. So, technically speaking - the nios2-elf-gcc was found without setting CROSS_COMPILE, but the linker was NOT found. And the 'boards.cfg' file does NOT exist in the recent git repo. I was able to build successfully without this file. Dave