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

Redboot will not build

Altera_Forum
Honored Contributor II
1,576 Views

Hi All, 

 

I'm trying to get eCos up and running on a Cyclone II development board, and thought it would be a good place to start to get Redboot built and installed. I have created a config using the nios2configtool with "Hardware" selected as "Nios II Development Board (Altera)", and the "Packages" selected as "redboot". When I attempt to build the library (without fiddling with the configuration) the build fails thus: 

 

nios2-elf-gcc -g -nostdlib -Wl,--gc-sections -Wl,-static -mhw-mul -mno-hw-mulx -mno-hw-div -L/cygdrive/c/Ws/CSW1/eCos/redboot_install/lib -Ttarget.ld -o /cygdrive/c/Ws/CSW1/eCos/redboot_install/bin/redboot.elf /cygdrive/c/Ws/CSW1/eCos/redboot_install/lib/version.o 

make[1]: Leaving directory `/cygdrive/c/Ws/CSW1/eCos/redboot_build/redboot/current' 

/cygdrive/c/Ws/CSW1/eCos/redboot_install/lib/libtarget.a(redboot_main.o)(.text.do_idle+0x14): In function `valid_address': 

make: Leaving directory `/cygdrive/c/Ws/CSW1/eCos/redboot_build' 

/cygdrive/c/altera/kits/nios2_51/components/ecos/ecos-current/packages/redboot/current/src/main.c:756: Unable to reach __RedBoot_IDLE_TAB_END__ (at 0x02011e40) from the global pointer (at 0x02019e58) because the offset (-32792) is out of the allowed range, -32678 to 32767. 

 

This looks like a fairly fundamental failure. Is it appropriate to run Redboot in this environment? Surely this will have been tested before the current version of eCos for Nios II was released, so any suggestions as to what I may have done wrong? Is there some config/setup I may have missed here? 

 

Thanks in anticipation of any and all assistance! 

 

Steve
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
363 Views

Steve: 

 

I had the same problem back in 5.0. I had hoped that this would have been fixed in 5.1...oh well. 

 

Add the -G0 option to the ECOS_GLOBAL_CLAGS = .... either in your makefile or in the Global Build Options within the configuration tool. 

 

Here is an explaination of the flag from the ld doc located at: 

 

C:\altera\kits\nios2_51\documents\gnu-tools\binutils 

 

-Gvalue 

--gpsize=value 

Set the maximum size of objects to be optimized using the GP register to size. This is only meaningful for object file formats such as MIPS ECOFF which supports putting large and small objects into different sections. This is ignored for other object file formats.  

 

Hope this work......by the way...any luck getting compact flash to work? 

 

Graham......
0 Kudos
Altera_Forum
Honored Contributor II
363 Views

Thanks for that. I figured there would be a compiler/linker option to overcome the problem, but with such a fundamental thing, before fiddling you always wonder if you've done something wrong. 

 

Regarding Compact FLASH, I've just tried including support for that and the build fails with an undefined reference to HAL_IDE_READ_UINT8. A quick scan of the source reveals that this symbol is not defined in the nios2 HAL. :-( Not promising. 

 

Steve
0 Kudos
Altera_Forum
Honored Contributor II
363 Views

 

--- Quote Start ---  

originally posted by steve evans@Jan 27 2006, 06:19 AM 

thanks for that. i figured there would be a compiler/linker option to overcome the problem, but with such a fundamental thing, before fiddling you always wonder if you've done something wrong. 

 

regarding compact flash, i've just tried including support for that and the build fails with an undefined reference to hal_ide_read_uint8. a quick scan of the source reveals that this symbol is not defined in the nios2 hal. :-( not promising. 

 

steve 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=12428) 

--- quote end ---  

 

--- Quote End ---  

 

 

 

Steve: 

 

Glad I could help. 

 

FYI....HAL_IDE_READ_UINT8 is contained in the following file 

 

<INSTALL_DIR>/cyg/hal/hal_io.h 

 

Simply# include <cyg/hal/hal_io.h> and you will be off to the races. 

 

I use the Codewright editor ( killed by Borland) and perform a "search multiple" and include subdirectories. I helps to find all occurrences of a particular string. 

 

Also, with the CF component. I have verified that the CF component provided by this forum works. However, recompile within 5.1 causes the component to fail. I am trying to work with our local Altera FAE, but have have no luck to date.
0 Kudos
Altera_Forum
Honored Contributor II
363 Views

Hello! 

 

I had the same problem as above when tryed to build redboot, but when I added the "-G0" Option to fix the problen, another error occured: 

 

make: Entering directory `/cygdrive/c/test_redboot/redboot4nios2_build/redboot/current&#39; nios2-elf-gcc -c  -I/cygdrive/c/test_redboot/redboot4nios2_install/include -I/cygdrive/c/altera/kits/nios2_51/components/ecos/ecos-current/packages/redboot/current -I/cygdrive/c/altera/kits/nios2_51/components/ecos/ecos-current/packages/redboot/current/src -I/cygdrive/c/altera/kits/nios2_51/components/ecos/ecos-current/packages/redboot/current/tests -I. -finline-limit=7000 -G0 -g -O3 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions  -DSYSTEM_BUS_WIDTH=32 -mhw-mul -mno-hw-mulx -mno-hw-div -o /cygdrive/c/test_redboot/redboot4nios2_install/lib/version.o /cygdrive/c/altera/kits/nios2_51/components/ecos/ecos-current/packages/redboot/current/src/version.c cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C nios2-elf-gcc -g -nostdlib -Wl,--gc-sections -Wl,-static -mhw-mul -mno-hw-mulx -mno-hw-div -L/cygdrive/c/test_redboot/redboot4nios2_install/lib -Ttarget.ld -o /cygdrive/c/test_redboot/redboot4nios2_install/bin/redboot.elf /cygdrive/c/test_redboot/redboot4nios2_install/lib/version.o make: Leaving directory `/cygdrive/c/test_redboot/redboot4nios2_build/redboot/current&#39; /cygdrive/c/test_redboot/redboot4nios2_install/lib/extras.o(.text.altera_avalon_lan91c111_get_esa_wrapper+0x88): In function `altera_avalon_lan91c111_get_esa_wrapper&#39;: make: Leaving directory `/cygdrive/c/test_redboot/redboot4nios2_build&#39; /cygdrive/c/test_redboot/redboot4nios2_install/include/cyg/sopc/altera_avalon_lan91c111.inl:137: undefined reference to `perror&#39; /cygdrive/c/test_redboot/redboot4nios2_install/lib/extras.o(.text.altera_avalon_lan91c111_get_esa_wrapper+0x94):/cygdrive/c/test_redboot/redboot4nios2_install/include/cyg/sopc/altera_avalon_lan91c111.inl:138: undefined reference to `perror&#39; /cygdrive/c/test_redboot/redboot4nios2_install/lib/extras.o(.text.altera_avalon_lan91c111_get_esa_wrapper+0xa0):/cygdrive/c/test_redboot/redboot4nios2_install/include/cyg/sopc/altera_avalon_lan91c111.inl:139: undefined reference to `perror&#39; collect2: ld returned 1 exit status make: *** Error 1 make: *** Error 2 

 

I do not understand following: 

collect2: ld returned 1 exit status 

 

Does anyone know what went wrong or what I did wrong? 

 

Being very thankful for any help! 

 

Note: I have installed NIOS2 5.1, SP1.
0 Kudos
Altera_Forum
Honored Contributor II
363 Views

Thank you, I&#39;ll try it. 

 

 

 

 

 

--- Quote Start ---  

originally posted by graham615@Jan 25 2006, 01:31 PM 

steve: 

 

i had the same problem back in 5.0.  i had hoped that this would have been fixed in 5.1...oh well. 

 

add the -g0 option to the ecos_global_clags = .... either in your makefile or in the global build options within the configuration tool. 

 

here is an explaination of the flag from the ld doc located at: 

 

c:\altera\kits\nios2_51\documents\gnu-tools\binutils 

 

-gvalue 

--gpsize=value 

    set the maximum size of objects to be optimized using the gp register to size. this is only meaningful for object file formats such as mips ecoff which supports putting large and small objects into different sections. this is ignored for other object file formats.  

 

hope this work......by the way...any luck getting compact flash to work? 

 

graham...... 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=12389) 

--- quote end ---  

 

--- Quote End ---  

0 Kudos
Reply