I've looked at the code and it seems like the vector is transfert to RAM and the vbr is set to the new place. Here's the code:
register uint32_t n;
register uint8_t *dp, *sp;
/*
* Copy the vector table to RAM
*/
if (__VECTOR_RAM != VECTOR_TABLE)
{
for (n = 0; n < 256; n++)
__VECTOR_RAM[n] = VECTOR_TABLE[n];
}
mcf5xxx_wr_vbr((uint32_t)__VECTOR_RAM);
The thing is that the n variable's value is 536891432 (0x20000000) and doesn't change in the for clause, and it location is $A1. What's that suppose to mean ?
The strange thing is that it's working with the debugger if I'm not trying to make it works alone before; if I remove and put back power on the device, and then try with the debugger, it doesn't work. I've looked at the vector table in both situation, and when it doesn't work, the vector table doesn't seems to be moved correctly from ROM to RAM.
Fred Talbot
Message Edited by FredT on
2008-01-09 09:46 AM