Altera_Forum
Honored Contributor
12 years agoStrange behavior of NIOS II IDE
Hello, I can't get my c code working on NIOS II processor, implemented on DE1. I'm using 9.1 sp2 ver. of NIOSII IDE. The same code with the same hardware sometimes works, sometimes not and the terminal writes: nios2-terminal: connected to hardware target using JTAG UART on cable nios2-terminal: "USB-Blaster [USB-0]", device 1, instance 0 nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate) and nothing more happens. I'm using SRAM. I tried using a PLL to have a clean clock signal, I don't know what to do to get things working... Do you have any suggestion? Thank you PS: the code i'm talking about is this
<code># include "sys/alt_stdio.h"# include "system.h"# include "altera_up_avalon_rs232.h"# include "altera_avalon_pio_regs.h" # define CLOCK_MHz 27 static void delay_us(int us); static void delay_clk(int clk); int i; int times; static void delay_us(int us) { times=CLOCK_MHz*us; for(i=0;i<times;i++){;} } static void delay_clk(int clk) { times=clk; for(i=0;i<times;i++){;} } static void initial_message() { alt_putstr("*****************************\n"); alt_putstr("**** Hello from Nios II! ****\n"); alt_putstr("*** AWGN channel emulator ***\n"); alt_putstr("*****************************\n"); } int main() { initial_message(); delay_us(50); alt_putstr("Hello from Nios II!\n"); alt_up_rs232_dev *serialPort = alt_up_rs232_open_dev(RS232_NAME); if(serialPort == NULL )alt_putstr ("Error: could not open rs232 \n"); } <\code>