Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Rebuilding NIOS 2 uncertainty

Honored Contributor II



I am experiencing an issue where a delay I have written doesn't seem to have any affect. For example, with a 48MHz clock the following: 


int c; for(c=0;c<480000000;c++){ } 


Should be a _long_ delay. However, I'm getting no noticeable delay between strings on my Nios II Console. I suspect I am not updating my files correctly. My normal procedure is 


1. make adjustment in C in eclipse. 

2. Save the C file. 

3. Ctrl+B (rebuild all) 

4. Load Programmer from Quartus Prime Lite 

5. Find the .sof file for my project, upload. 

6. In eclipse I'll right lcik the project, Run As, Nios II Hardware. 

7. few seconds pass, my Nios II console appears but there is no delay as if the files have not changed. 

8. Goto 1 :P 


Can anyone offer some suggestion as to what I'm doing wrong? I am really frustrated by this. :mad: 


I can't see where there would be a problem in the code, even when i nest two for loops, both with unsigned int d and e, d counting to 480000000 inside e counting to 50 there is still no noticeable delay. 


Thanks in advance.
0 Kudos
2 Replies
Honored Contributor II



Hope this may help you. 


1. Have you loaded correct .sopcinfo file during eclipse project creation? 

2. Check Pin assignments of Clock? 

3. Can you delete the .elf file and build your project and check? 

4. Are you controlling LED or Simple Hello world program? 


Here’s an example from Altera App notes tutorial for NIOS-2 

Page 13 of that shows how to implement a delay in simple Hello World NIO-2 program 


Refer previous thread[/URL] 


Let me know if this has helped resolve the issue you are facing or if you need any further assistance. 


Best Regards, 

Anand Raj Shankar 

(This message was posted on behalf of Intel Corporation)
0 Kudos
Honored Contributor II

Hi Anand, 


May thanks for your suggestions, I really appreciated them. I've just discovered that the compiler was probably optimising the delay loops away - as soon as I wrote out a delay in asm I had no problems at all. Kind of frustrating but there we are. :) 


0 Kudos