Altera_Forum
Honored Contributor
20 years agomy code won't execute after a CPU reset
Hi,
I'm trying to do something very simple but since its failing, I think I'm not understanding something fundamental about the IDE's auto-placement of code into memory. I have two memories set up in SOPC builder: - 8K ROM on-chip - 128k RAM also on-chip. The reset address is set to the 8k ROM at zero offset, and the exception is set to 0x20 offset also on the 8k ROM. In the Nios IDE system library properties, I put everything into the RAM, (.text,.rwdata....) and there's plenty of room to spare.... I have no off-chip memory right now. The problem seems to be with the auto-generated linker script because when I open the 8kROM.hex file after I build the project, its all zeros from address 0x0-0x20, then at 0x20 (the exception address) it looks like theres some real code there. So it's linking in find the exception code properly, but it isn't linking in the reset code. So I loaded my program up with the debugger and pressed the CPU reset button. Sure enough the debugger stops the process and it's at the reset address like it should be but the instruction its pointing to is 'jump 0x0', when it should actually be trying to jump to '_start'. I looked a little through other posts on the board and no one else seems to be having this problem, though I didn't scour the board. I checked through the documentation and I couldn't find anything to help me figure out what I am doing wrong. Any ideas? Thanks, drippy