Forum Discussion
Altera_Forum
Honored Contributor
15 years agoNIOS II C language about SDRAM IOWR & IORD function and fopen & fclose
Hi, I'm new about Quartus II & NIOS II. I made hardware part using sopc builder (nios II cpu, sdram, on-chip mem, jtag, sysid, and so on) and composed c source code for software part. I...
Altera_Forum
Honored Contributor
15 years agoHi Teddy,
Apart from the fopen issue, I'm concerned about the two R/W instructions:IOWR(SDRAM_0_BASE, 0, input_data);
output_data = IORD(SDRAM_0_BASE, input_data);Problem 1: You are writing to address 0 and reading from address 1 (content of input_data) which has not been initialized. Maybe, you meant this: output_data = IORD(SDRAM_0_BASE, 0);Problem 2: Are you sure this part of sdram is not already used for anything else? Otherwise your IOWR would corrupt code or other data. Cris