Altera_Forum
Honored Contributor
11 years agoNios and tcl script writing to RAM
Hi,
I have an image loaded with a Nios , Jtag master and jtag UART. I have wrote C code to write to the on-chip RAM. I have also a tcl script that can read and write to the RAM. When I write and read to/ from a location with C code as follows :
unsigned int* mem_ptr = (unsigned int*) 0x40000060;
*mem_ptr = 0xff00;
printf("Value is 0x%x\n", *mem_ptr);
the correct value is read back fine with printf() but when I source a tcl script to read from the same location using "ram_read 0", I am getting different values :
proc ram_read {offset} {
global jtag
if {!} {
jtag_open
}
set addr
return
}
When I tried this yesterday however, the correct values were being read back. I don't understand why now the printf() prints the correct value but the tcl script does not. Should the values be the same? Can anyone see where I am going wrong here or if I am going wrong at all? Thanks in advance.