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++
12600 Discussions

U-Boot for Nios2 on DE2-115 Board with MMC/SPI support

Altera_Forum
Honored Contributor II
1,611 Views

Hello again, 

 

i am trying to compile U-Boot for my DE2-115 board. I was able to compile U-Boot and run it on the Board, but now I want to add MMC/SPI support. 

 

I added: 

# define CONFIG_CMD_MMC# define CONFIG_ALTERA_SPI  

 

I am getting Errors when typing make: 

common/built-in.o: In function `do_mmc': /home/jan/nios2-linux/nios2-linux/u-boot/common/cmd_mmc.c:33: undefined reference to `mmc_legacy_init' /home/jan/nios2-linux/nios2-linux/u-boot/common/cmd_mmc.c:33: relocation truncated to fit: R_NIOS2_CALL26 against `mmc_legacy_init'  

 

I also tried to follow the instructions on the Altera-Wiki (http://www.alterawiki.com/wiki/u-boot_and_cyclone_ii-de2_boards#sd_card_over_spi_protocol), but they are very old and theme not to work with U-Boot 2015.04-rc1. 

Not even after reading this Thread (http://www.alteraforum.com/forum/showthread.php?t=24872

 

Can anyone please tell me how to do this? 

 

With best regards, 

Jan
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
526 Views

I am trying to port U-boot to DE2-115 board. Am new to Altera. Can you tell how to start? please help

0 Kudos
Altera_Forum
Honored Contributor II
526 Views

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
0 Kudos
Altera_Forum
Honored Contributor II
526 Views

 

--- 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
0 Kudos
Reply