AnsweredAssumed Answered

Bad Code Loading at Startup -- even JTAG doesn't load code?

Question asked by AlexKates on Sep 8, 2010
Latest reply on Jan 4, 2011 by tmiller

I'm having what seems to be a very strange problem.


In certain situations, a custom board is loading what looks to be garbage code instead of code from FLASH.


Most strangely, this seems to occur even when I am using the USB-ICE JTAG -- that is, I have a project open, rebuild the project and load it, either automatically or manually. I get the error[Failed to set automatic breakpoint at "main"] and then the garbage code is inserted -- I can see it in the assembly window.


Here is an example:


In my IVT, I have:


    rti; nop; nop; nop;


    idle;                           // Used by loader during final init.
    jump main;   


In the Disassembly window I see:

[090000]     rti;

[090001]     nop;

[090002]     nop;

[090003]     r0=dm(0xb3e0000);


[090004]     rti;                          
[090005]     nop;   
[090006]     nop;
[090007]     r0=dm(0xb3e0000);  


Obviously, this isn't *my* code! And this bizarre sequence is the same everywhere in the disassembly, and when I view the code as "mixed".


When I step through the code, it does nothing on the "rti," nor does it actually load anything into r0. So it's not working properly at all.


Does this sound familiar to anyone? Are there any startup conditions that could cause this?