Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20642 Discussions

make: *** [my_hello_world.elf] Error 1

Altera_Forum
Honored Contributor II
11,689 Views

Hello Altera Guys; 

 

I am having problem building my software in NIOS II SBT 15.0 (eclipse) and I really need your great help. 

 

I have this message on my console and I do not know how to solve this problem. 

 

make all  

Info: Building ../my_hello_world_bsp/ 

C:/altera/15.0/nios2eds/bin/gnu/H-x86_64-mingw32/bin/make --no-print-directory -C ../my_hello_world_bsp/ 

[BSP build complete] 

Info: Linking my_hello_world.elf 

nios2-elf-g++ -T'../my_hello_world_bsp//linker.x' -msys-crt0='../my_hello_world_bsp//obj/HAL/src/crt0.o' -msys-lib=hal_bsp -L../my_hello_world_bsp/ -Wl,-Map=my_hello_world.map -O0 -g -Wall -mno-hw-div -mno-hw-mul -mno-hw-mulx -o my_hello_world.elf obj/default/hello_world.o -lm -msys-lib=m 

c:/altera/15.0/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/4.9.1/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: my_hello_world.elf section `.text' will not fit in region `onchip_memory2_0' 

c:/altera/15.0/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/4.9.1/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: address 0x6ee8 of my_hello_world.elf section `.rwdata' is not within region `onchip_memory2_0' 

c:/altera/15.0/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/4.9.1/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: address 0x8aa4 of my_hello_world.elf section `.bss' is not within region `onchip_memory2_0' 

c:/altera/15.0/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/4.9.1/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: address 0x6ee8 of my_hello_world.elf section `.rwdata' is not within region `onchip_memory2_0' 

c:/altera/15.0/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/4.9.1/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: address 0x8aa4 of my_hello_world.elf section `.bss' is not within region `onchip_memory2_0' 

c:/altera/15.0/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/4.9.1/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: region `onchip_memory2_0' overflowed by 31396 bytes 

collect2.exe: error: ld returned 1 exit status 

make: *** [my_hello_world.elf] Error 1 

 

09:08:05 Build Finished (took 927ms) 

 

I followed what was instructed in building NIOS II software in the Altera documents https://www.altera.com/en_us/pdfs/literature/.../tt_my_first_nios_sw.pdf. 

 

Any information you may share is greatly appreciated. 

 

 

Kind regards 

Ryan
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
8,217 Views

The message means that your code is too large to fit into memory. The default size for on chip memory is very small. Most of the tutorials have you use a larger on chip memory size. Look at the on chip memory module in QSYS. I should have a size large enough to fit your program. If it doesn't, pick a larger size (8K or 16K for example). Don't forget to re-generate the code in QSYS and re-compile in Quartus.

0 Kudos
Altera_Forum
Honored Contributor II
8,217 Views

Hello Galfonz; 

 

I tried also the procedure stated in the Altera document "Introduction to the Altera 

Qsys System Integration Tool" 

 

The problem still the same. But I can implement my software in Nios II when I using Altera Monitor Program. 

 

 

Kind regards 

Ryan
0 Kudos
Altera_Forum
Honored Contributor II
8,217 Views

Hey, try clicking on auto assign base address in Qsys tool before generating the component. The .rwdata and .bss might not be within the memory space. 

Auto assign option is available in the system tab in Qsys tool.
0 Kudos
Altera_Forum
Honored Contributor II
8,217 Views

 

--- Quote Start ---  

Hey, try clicking on auto assign base address in Qsys tool before generating the component. The .rwdata and .bss might not be within the memory space. 

Auto assign option is available in the system tab in Qsys tool. 

--- Quote End ---  

 

 

 

Hi expert,  

I have the same problem. Can any boby help me. How can i fix it. I tried to make auto assign but still the same thing. 

i got this error.  

i need your help !!!  

 

 

[BSP build complete] 

Info: Compiling hello_world.c to obj/default/hello_world.o 

nios2-elf-gcc -xc -MP -MMD -c -I../SDC_Top_Test_bsp//HAL/inc -I../SDC_Top_Test_bsp/ -I../SDC_Top_Test_bsp//drivers/inc -pipe -D__hal__ -DALT_NO_INSTRUCTION_EMULATION -DALT_SINGLE_THREADED -O0 -g -Wall -mno-hw-div -mno-hw-mul -mno-hw-mulx -mgpopt=global -o obj/default/hello_world.o hello_world.c 

Info: Linking SDC_Top_Test.elf 

nios2-elf-g++ -T'../SDC_Top_Test_bsp//linker.x' -msys-crt0='../SDC_Top_Test_bsp//obj/HAL/src/crt0.o' -msys-lib=hal_bsp -L../SDC_Top_Test_bsp/ -Wl,-Map=SDC_Top_Test.map -O0 -g -Wall -mno-hw-div -mno-hw-mul -mno-hw-mulx -mgpopt=global -o SDC_Top_Test.elf obj/default/hello_world.o -lm -msys-lib=m 

c:/intelfpga/17.1/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/5.3.0/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: SDC_Top_Test.elf section `.text' will not fit in region `onchip_memory2_0' 

c:/intelfpga/17.1/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/5.3.0/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: address 0x16e84 of SDC_Top_Test.elf section `.rwdata' is not within region `onchip_memory2_0' 

c:/intelfpga/17.1/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/5.3.0/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: address 0x1929c of SDC_Top_Test.elf section `.bss' is not within region `onchip_memory2_0' 

c:/intelfpga/17.1/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/5.3.0/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: address 0x16e84 of SDC_Top_Test.elf section `.rwdata' is not within region `onchip_memory2_0' 

c:/intelfpga/17.1/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/5.3.0/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: address 0x1929c of SDC_Top_Test.elf section `.bss' is not within region `onchip_memory2_0' 

c:/intelfpga/17.1/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/5.3.0/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: region `onchip_memory2_0' overflowed by 94876 bytes 

collect2.exe: error: ld returned 1 exit status 

make: *** [SDC_Top_Test.elf] Error 1 

 

13:00:31 Build Finished (took 6s.580ms)
0 Kudos
Altera_Forum
Honored Contributor II
8,217 Views

The problem is solved i have to add 94876 bytes to my memory size and auto assign base adresse.

0 Kudos
Reply