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

Error message while trying to deploy a simple hello_world application

Altera_Forum
Honored Contributor II
1,947 Views

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
0 Kudos
17 Replies
Altera_Forum
Honored Contributor II
1,100 Views

That document is for Altera development kits. The DE2 is specific to the University program and you should look for documentation there (and on Terasic's website)...first. 

 

Cheers, 

 

- Ura
0 Kudos
Altera_Forum
Honored Contributor II
1,100 Views

The terasic site points me to the Altera site. Can you send me the exact link you are talking about

0 Kudos
Altera_Forum
Honored Contributor II
1,100 Views

Ummm... Look at the breakdown of the DE2 CD (which you should probably download if you haven't already) on this (http://www.altera.com/education/univ/materials/boards/unv-de2-board.html) page. 

 

Plus, there's a _lot_ of stuff already on Terasic's DE2 page...right? 

 

Keep in mind that I don't know _exactly_ what you're looking for so I'm not sure which of these links will satisfy you. 

 

Cheers, 

 

- Ura
0 Kudos
Altera_Forum
Honored Contributor II
1,100 Views

First, try running a demonstration in de-2 CD (http://www.terasic.com/downloads/cd-rom/de2/de2_system_v1.6.zip). 

 

After, build a simple Nios-II based system in SOPC Builder using on-chip memory.
0 Kudos
Altera_Forum
Honored Contributor II
1,100 Views

as per your suggestions i am following a tutorial in the de2 cd (attached) . everything runs fine until the last step mentioned in the tutorial but my leds dont respond to the switches. what could be the problem?

0 Kudos
Altera_Forum
Honored Contributor II
1,100 Views

If your program is downloaded without error from Nios -II IDE, check your pin assignments. Doe's a simple "printf" work?.

0 Kudos
Altera_Forum
Honored Contributor II
1,100 Views

1.the c program i am using is very simple pasted below. I am using Altera monitor program: 

# define Switches (volatile char *) 0x0001800# define LEDs (char *) 0x0001810 

int main() 

{  

while (1) 

*LEDs = *Switches; 

return(1); 

 

2. About the pin assignments i imported the assignments (the .csv file which comes with the cd) 

 

3. I am a student at Boston university and downloaded the web edition of Quartus(9.0) which means it is not a licensed version)
0 Kudos
Altera_Forum
Honored Contributor II
1,100 Views

Check your base addresses, use the ones included in "system.h" for the leds and switches PIOS.

0 Kudos
Altera_Forum
Honored Contributor II
1,100 Views

Thanks....that worked...

0 Kudos
Altera_Forum
Honored Contributor II
1,100 Views

Oh, When you download the microprocessor to the DE2 board from Quartus II 9.0 web-version, a screen appears that says OpenCore Plus Status. It has a cancel button in the middle of it, DO NOT click CANCEL. This is Altera's way of controlling the licensing of their product. Your computer dials into Altera and as long as that screen is open, the DE2 board will work with the IP cores you are using. I'm having a bit of a time myself with the same problem when I work thru some of the example problems found in the nios2eds folder. They have you downloading *.sop files and sure enough the OpenCore Plus Status window doesn't open and I can't get the Nios examples to run...doing a workaround on this problem right now.

0 Kudos
Altera_Forum
Honored Contributor II
1,100 Views

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 

 

 

0 Kudos
Altera_Forum
Honored Contributor II
1,100 Views

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?
0 Kudos
Altera_Forum
Honored Contributor II
1,100 Views

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 

 

0 Kudos
Altera_Forum
Honored Contributor II
1,100 Views

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,
0 Kudos
Altera_Forum
Honored Contributor II
1,100 Views

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
0 Kudos
Altera_Forum
Honored Contributor II
1,100 Views

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.

0 Kudos
Altera_Forum
Honored Contributor II
1,100 Views

no...that didnt work.....altera debug client works but IDE doesnt

0 Kudos
Reply