Forum Discussion

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

Bemicro NIOS memory error

Hi All,

Just got my Bemicro, ran through the entire lab twice, cant figure out the issue. The SOPC and Quartus compilation seem fine. Then with the NIOS compiler, I get this:

**** Build of configuration Release for project bemicro_led_control ****

make -s all includes

Compiling main.c...

Compiling alarm_util.c...

Compiling delay_wait.c...

Compiling error_loop.c...

Compiling jtag_uart_util.c...

Compiling led_util.c...

Compiling system_validation.c...

Compiling uart_util.c...

Linking bemicro_led_control.elf...

/cygdrive/c/altera/91/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/bin/ld: region onchip_sram is full (bemicro_led_control.elf section .text). Region needs to be 28448 bytes larger.

/cygdrive/c/altera/91/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/bin/ld: address 0x111afc of bemicro_led_control.elf section .rwdata is not within region onchip_sram

/cygdrive/c/altera/91/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/bin/ld: section .bss [00100020 -> 001001a7] overlaps section .text [00100020 -> 0010ef1f]

obj/src/alarm_util.o(.text+0x34): In function `alarm_init':

: Unable to reach ALARM_250MS_CONTEXT (at 0x00100020) from the global pointer (at 0x00119a64) because the offset (-105028) is out of the allowed range, -32678 to 32767.

collect2: ld returned 1 exit status

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

Build completed in 23.103 seconds

I changed the debug to release, but that did not make a difference. Any ideas?

Thanks,

Eric O

2 Replies

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

    It's telling you your program is too large for your RAM. I think you missed a step. You need to modify your BSP (or system library) to place the ".text", ".rodata", and ".rwdata" into the bemicro_sram rather than onchip_sram.

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

    Hi Jake, and thanks.

    Missed the part on Page 41 of the Bemicro lab about putting read-only, read-write, and program memory to the external sram.

    bemicro_led_control_syslib

    system Library

    Linker Script options (on the right hand side of the screen.

    Eric O