Hi all,
I tried to see whether it was due to an illegal address reset. As I have to observe without debugger,I had placed some stub routine to output the CRGINT register value thro' SCI in all my unimplemented isrs before it can reset. After many attempts, the code crashed once and I could see that in this register, ILAF was not set(it read as 0x80). Also the COPCTL was read as 0x00 too. So, I don't see it could be due to illegal address.
coming to the hardware check, the pins are pre-tied in the same state as kef had suggested.So, could not be hardware issue.
Going further, I added few more traps in the cop/clockmonitorreset/unimplemented/SW1 isrs to output some message, just to see which was the source of interrupt causing this crash(Is there any other better way to know the source of interrupt?). However after this, I have tried number of times to reproduce the crash, but has never appeared till now.
I am working on a bootloader and so jumping to a function to execute from RAM, which is declared in a seperate READ ONLY section within RAM in the linker time, I feel the address is proper as it is generated during compile/link time only.Also, I have observed when connected the debugger, it jumps to the proper RAM location where it is located and executes from there.
Only the stack pointer check messing with this area is to done, but I am trying it out, as the error is not repeatable.
As Lundin mentioned, I don't see the INITRG,INITEE .. registers for the MC9S12XDP512 device to be initialized. Are there any equivalents?
Is there a list of WRITE ONCE registers which I need to take care. please let me know..
Also, what would happen if BGND instruction is encountered in normal single chip mode? Would it reset the micro. With my debugger, i have seen it stop and say illegal BP.
I have this in all my unimplemented ISRs as the last instruction.
with regards,
Lakshman