Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

NIOS error message

Altera_Forum
Honored Contributor II
1,461 Views

Hi people, 

 

I'm compiling the code in the NIOS IDE, and have some errors. 

Does anybody know what these errors are, and how to fix it? 

Thanks in advance. 

 

/cygdrive/c/altera/91/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/lib/libc.a(closer.o) In function `_close_r': 

 

/cygdrive/c/altera/91/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/lib/libc.a(lseekr.o) In function `_lseek_r': 

 

/cygdrive/c/altera/91/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/lib/libc.a(openr.o) In function `_open_r':
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
159 Views

You posted a partial error message. Please post again, in a CODE blocks or QUOTES (forum features). 

 

Cheers, 

 

--slacker
Altera_Forum
Honored Contributor II
159 Views

Thanks Slacker, 

 

This is the code i compiled: 

 

#include "sys/alt_stdio.h"# include "stdio.h"# include "string.h"# include "system.h" int main() { char* msg = "Detected character\n"; FILE* fp; char prompt = 0; printf("Testing begin\n"); fp = fopen ("/dev/uart_0","r+"); if (fp) { while (prompt!=0) { prompt = getc(fp); if (prompt=='t') { fwrite (msg,strlen(msg),1,fp); } } fprintf(fp,"closing\n"); fclose(fp); }*/ return 0; }In the system library, if the "small C library" is unchecked, the errors are: 

 

/cygdrive/c/altera/91/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/lib/libc.a(closer.o) In function `_close_r': /cygdrive/c/altera/91/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/lib/libc.a(lseekr.o) In function `_lseek_r': /cygdrive/c/altera/91/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/lib/libc.a(openr.o) In function `_open_r':If the "small C library" is checked, the errors are: 

 

undefined reference to `fopen' undefined reference to `fopen' undefined reference to `fopen'Is there any mistakes in my code, or my project configuration? 

Thanks in advanced!
Altera_Forum
Honored Contributor II
159 Views

This line looks suspect: 

#include "sys/alt_stdio.h" 

You only need this if you're using the alternative stdio functions provided by Altera...alt_putstr(), alt_printf(), etc. 

 

You also could have some sort of transient issue with the SysLib. I assume you've tried cleaning/rebuilding it or just re-creating it, right? 

 

Also, those error messages still look rather short? Are you sure you're including all of what the compiler is choking on? 

 

Cheers, 

 

--slacker
Altera_Forum
Honored Contributor II
159 Views

That's right slacker, i've tried to clean and rebuild it, but the errors still remain.  

 

Can you tell me more about the SysLib transient, and the compiler issues. Which mistakes i probably made?
Altera_Forum
Honored Contributor II
159 Views

When i am trying to built simple hello world programme but it is giving below error....!! can you please clarify the problem.... 

 

 

 

d:/alte/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: RUN_ON_HDL_SIMULATOR_ONLY_hello.elf section `.text' will not fit in region `onchip_memory2_0' 

d:/alte/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x5c40 of RUN_ON_HDL_SIMULATOR_ONLY_hello.elf section `.rwdata' is not within region `onchip_memory2_0' 

d:/alte/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x630c of RUN_ON_HDL_SIMULATOR_ONLY_hello.elf section `.bss' is not within region `onchip_memory2_0' 

d:/alte/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x630c of RUN_ON_HDL_SIMULATOR_ONLY_hello.elf section `.onchip_memory2_0' is not within region `onchip_memory2_0' 

d:/alte/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x5c40 of RUN_ON_HDL_SIMULATOR_ONLY_hello.elf section `.rwdata' is not within region `onchip_memory2_0' 

d:/alte/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x630c of RUN_ON_HDL_SIMULATOR_ONLY_hello.elf section `.bss' is not within region `onchip_memory2_0' 

d:/alte/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x630c of RUN_ON_HDL_SIMULATOR_ONLY_hello.elf section `.onchip_memory2_0' is not within region `onchip_memory2_0' 

d:/alte/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: region `onchip_memory2_0' overflowed by 13068 bytes 

collect2: ld returned 1 exit status 

make: *** [RUN_ON_HDL_SIMULATOR_ONLY_hello.elf] Error 1
Altera_Forum
Honored Contributor II
159 Views

either your application is too big, or the memory you defined is too small. Try to increase the size of your on-chip memory or reduce the size of your application (by enabling optimisations and/or using the reduced drivers).

Reply