Altera_Forum
Honored Contributor
11 years ago"Hello World!" keeps looping. Anyone know why?
Hi,
I have a system created in Qsys with a Nios , on-chip RAM, DDR3 controller, JTAG UART etc. I have specified the Reset vector and exception vector memory for the NIOS to be in the on-chip RAM only. The DDR3 controller Avalon mm base address is 0x0000_0000 and the end address is 0x3FFF_FFF, and I want to only use this memory for data so I would expect to be able to use it all. The strange this is , when I run my program below which tries to write and read to the DDR3 RAM, "Hello World!" just keeps printing out on the terminal forever and the program doesn't do anything else. If however, I change the ddr_base address in the code to 0xFFF, it runs fine. So what is being used in in the DDR3 memory from 0x0 ? Why should this happen if my code (.text etc) is being loaded only into the on-chip RAM. I appreciate if anyone knows the reason as to why or point out where i'm going wrong? Thanks# include <stdio.h>
int main()
{
printf("Hello World!\n");
long* ddr_base = 0x0;
int i;
for (i = 0; i <50; i++)
{
*ddr_base++ = i;
}
ddr_base = 0x0; // pointing back to base of DDR3
for (i = 0; i <50; i++)
{
printf("word %u = %lu\n", i, *ddr_base);
ddr_base++;
}
printf("done\n");
return 0;
}