Forum Discussion

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

Error message while trying to deploy a simple hello_world application

I have DE2 board. I am trying to follow instructions from the file attached. Also is attached a screenshot of the error. Please let me know what could be the reason

Rohini

17 Replies

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

    hey

    I used the Altera debug client and the above worked. but When i used Nios II IDE i get this error

    /cygdrive/c/altera/90/nios2eds/components/altera_hal/HAL/inc/sys/alt_errno.h:81: Unable to reach errno (at 0x00001020) from the global pointer (at 0x0000a25c) because the offset (-37436) is out of the allowed range, -32678 to 32767.

    What could be the reason?

    Rohini

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

    Rohini,

    Okay, it's easy enough to figure out the error message...the global pointer is at $A25C and the errno is at $1020. Subtracting one from the other gives 37436 base 10 so it is out of the range for the offset which is +/- value for 16 bits using signed numbers. I don't know how to increase the offset but if you could change the location of the Global pointer somehow you'd eliminate this problem. Most likely you had nothing to do with it as these programs take off and compile themselves as the designer of the compiler saw fit. You might try making your overall program smaller by cutting out a feature. If you've run out of guesses; you could try mine. A lot of times at my present level of understanding...if it doesn't work, I try a few things then give up. Say, have you set the base addresses before you downloaded the SOPC?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    i am using

    #define Switches (volatile char *) 0x00003000

    #define LEDs (char *) 0x00003010

    int main(void)

    {

    while (1)

    {

    *LEDs = *Switches;

    }

    return(1);

    }

    which is same base addresses as assigned by the SOPC builder

    1. I ran this application program using Altera Debug client and it was successful. I mean i could use switches t manipulate the LED's I took this program from the tutorials which come with the CD(DE2 board)

    2. When i use NIOS II IDE i get

    Linking light.elf...

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

    /cygdrive/c/altera/90/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/bin/ld: region onchip_memory2_0 is full (light.elf section .rwdata). Region needs to be 664 bytes larger.

    /cygdrive/c/altera/90/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/bin/ld: section .rodata [00001020 -> 00001053] overlaps section .exceptions [00001020 -> 000011c7]

    /cygdrive/c/altera/90/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/bin/ld: section .rwdata [00001054 -> 00002297] overlaps section .exceptions [00001020 -> 000011c7]

    /cygdrive/c/altera/90/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/bin/ld: section .bss [00001020 -> 00001123] overlaps section .exceptions [00001020 -> 000011c7]

    /cygdrive/c/sopc_tutorial/software/light_syslib/Debug/liblight_syslib.a(alt_dev_llist_insert.o)(.text+0xdc): In function `alt_get_errno':

    /cygdrive/c/altera/90/nios2eds/components/altera_hal/HAL/inc/sys/alt_errno.h:81: Unable to reach errno (at 0x00001020) from the global pointer (at 0x0000a25c) because the offset (-37436) is out of the allowed range, -32678 to 32767.

    collect2: ld returned 1 exit status

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

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

    Rohini,

    What I'd do based on those error messages is go back to Quartus, open up the SOPC builder and increase my on-chip memory by 4K. That should work but I remember another program when I tried that where it created other errors. Thinking about that, I probably should have reset the base address before running it. Hey, you're helping me fix my designs...

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

    I increased the on chip memory ....i did auto assign base address.

    But i get this when i try to recompile in the quartus

    Critical Warning: Memory depth (2048) in the design file differs from memory depth (3072) in the Memory Initialization File "onchip_memory2_0.hex" -- truncated remaining initial content value to fit RAM
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    That error message makes it sound like you used the default memory size. The change is not recognized so I'd start an new microprocessor design and see what happens.