Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

error in building a project in software eclipse

I wrote the code to perform read and write operation of a register in nios-ii SBT Eclipse.While building a project,one error occuring for me.I didn't know to correct the error.I want to know about the error and how to correct it.

my code is:# include "sys/alt_stdio.h"# include "system.h"# include "io.h"# define OFFSET 1# define DATA 0x000010# define BASE 0X00005000

void init()

{

while(1)

{

IOWR_8DIRECT(BASE,OFFSET,DATA);

alt_printf("iregport=%x\n",IORD_8DIRECT(BASE,OFFSET));

}

}

alt_main()

{

alt_putstr("hello from nios-ii!\n");

init();

while(1);

return 0;

}

error is:

make all

Info: Building E:/maheswari/software/reg5_test_bsp/

make --no-print-directory -C E:/maheswari/software/reg5_test_bsp/

[BSP build complete]

Info: Compiling ma3.c to obj/ma3.o

nios2-elf-gcc -xc -MP -MMD -c -IE:/maheswari/software/reg5_test_bsp//HAL/inc -IE:/maheswari/software/reg5_test_bsp/ -IE:/maheswari/software/reg5_test_bsp//drivers/inc -DSYSTEM_BUS_WIDTH=32 -D__hal__ -pipe -DALT_NO_INSTRUCTION_EMULATION -DALT_SINGLE_THREADED -O0 -g -Wall -EL -mno-hw-div -mno-hw-mul -mno-hw-mulx -o obj/ma3.o ma3.c

ma3.c:23: warning: return type defaults to 'int'

Info: Linking reg5_test.elf

nios2-elf-g++ -T'E:/maheswari/software/reg5_test_bsp//linker.x' -msys-crt0='E:/maheswari/software/reg5_test_bsp//obj/HAL/src/crt0.o' -msys-lib=hal_bsp -LE:/maheswari/software/reg5_test_bsp/ -Wl,-Map=reg5_test.map -O0 -g -Wall -EL -mno-hw-div -mno-hw-mul -mno-hw-mulx -o reg5_test.elf obj/ma3.o -lm

c:/altera/10.0/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: region onchip_memory2 is full (reg5_test.elf section .text)

c:/altera/10.0/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: region onchip_memory2 is full (reg5_test.elf section .text)

c:/altera/10.0/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: section .text [00002020 -> 00005b4b] overlaps section .rodata [00002020 -> 00002057]

c:/altera/10.0/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: section .rwdata [00002a34 -> 0000340f] overlaps section .text [00002020 -> 00005b4b]

c:/altera/10.0/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: reg5_test.elf: section .text lma 0x2020 overlaps previous sections

collect2: ld returned 1 exit status

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

help me.Thanks in advance

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi, you don't have enough memory on your board.

    You seem to use only "onchip memory".
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Hi, you don't have enough memory on your board.

    You seem to use only "onchip memory".

    --- Quote End ---

    thank you for your help