Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12606 Discussions

Nios II IDE overwrites my hex file

Altera_Forum
Honored Contributor II
993 Views

Hello, 

 

I have a problem of memory initialization file with the Nios II IDE. I build a system using SOPC Builder, basically there are one Nios II processor, one onchip ram memory used for the Nios named onchip_processor_memory (this memory is connected to the instruction bus and the data bus of the Nios), and one onchip rom memory where I want to store predefined data named onchip_perso_memory (this memory is only connected to the data bus of the Nios). For the last memory I check "Enable non-default initialization file", and I created myself the file content. 

 

In my software I assign a table to the memory, and during the program I read the table : 

unsigned long myData __attribute__ ((section (".onchip_perso_memory")));The problem is that when I build my project under Nios II IDE, it overwrites all the time the file onchip_perso_memory.hex (it writes 0 inside). I don't understand why Nios IDE doesnot know that it's to me to generate this file since I tell it in the SOPC Builder. 

 

Remark : In the System Library Properties of my project, I leave the onchip_processor_memory for all type of memory (Program memory (.text), Read-only data memory (.rodata), Read/Write data memory (.rwdata), ...). That does not is in conflict with the fact that the other memory is used as read-only and do not appears here ? 

 

Anyone has an idea of why I have this problem, or how to solve it ? 

 

Thanks in advance 

 

Jérôme
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
281 Views

I think first you ought to verify that your memory is in fact getting overwritten with the hex file created by the NIOS II IDE. Check the RAM summary report in the compilation report for your Quartus project. Somewhere in there it tells you what file is being used to initialize the RAM.

0 Kudos
Reply