Altera_Forum
Honored Contributor
8 years agoNIOS executes main() function repeatedly without use of any finite/ infinite loop
Have a very nice day everyone.
This is my ever first post and I am new to working on HDLs/ qsys/ and NIOS eclipse. I can not figure out why NIOS should execute the main() function repeatedly with even few simple statements like below: int main(){ printf("1 - - Hello world\n"); printf("2 - - Hello world\n"); printf("3 - - Hello world\n"); return 0; } The output for this is: 1 - - Hello world 2 - - Hello world 3 - - Hello world 1 - - Hello world 2 - - Hello world 3 - - Hello world 1 - - Hello world 2 - - Hello world 3 - - Hello world 1 - - Hello world 2 - - Hello world 3 - - Hello world continued ... without any stop. However you may see there is no any loop statement being used. Hardware details: My system is basically a video capture project using Stratix IV (DE-4 board). I am using onChipMemory for NIOS instruction and data, DDR3 for buffering of live captured video and works well. All the controllers used in qsys are connected with afi_clk output of DDR3, where memory clock frequency is 200MHz and achieved local clock frequency is 100MHz. All set of PIOs including buttons, switches and LEDs are connected to 10MHz received from PLL. Due to different clcok domains, I used Clock bridge also connecting Master with 10MHz (PLL) and Slave with 100MHz (afi_clk). DDR3 and PLL both receive external clock of 50MHz. Any further information may be asked. I cannot figure out why my NIOS is triggered repeatedly to execute above code. Thanks in advance