Altera_Forum
Honored Contributor
11 years agojtag-uart output incorrectly
hi everyone!
i am new to altra and nios II, recently i am trying to study altra fpga and nios II, i meet some problems and i need some help in my project, i want to use nios II and try to use jtag-uart. i insert a sdram-controller so i can download the code to it. and i make some Constraint to make the sdram work correctly. i just want to print "Hello from Nios II! %d\n", timer my C program is as follows: # include "alt_types.h"# include "altera_avalon_pio_regs.h"# include "sys/alt_irq.h"# include "system.h"# include <stdio.h># include <unistd.h> void delay(void); int main(void) { alt_u8 timer = 0; printf("Hello from Nios II! %d\n", timer); delay(); timer++; printf("Hello from Nios II! %d\n", timer); while(1) { printf("Hello NIOS II!\n"); delay(); timer++; } return 0; } void delay(void) { alt_u32 i=0; while(i < 4000000) { i++; } } but the result turn out to be very stange, the NIOS II Console shows: Hello from Nios II! (this is also wrong because the timer is missing) eell rrmmNNoo II eell IISSII!! HllooNNOO II! eell IISSII!! i want to upload my project, but it is too big, so i just upload the bsp setting file(i change it to txt) thanks!