52235 - moving vector table to RAM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

52235 - moving vector table to RAM

1,390 Views
GudeADS
Contributor III
in the sysinit code, the vector table is copied to RAM

/* 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)__VECTOR_RAM);



why does it has to like this. I tried to do just
mcf5xxx_wr_vbr((uint32)VECTOR_TABLE);
to use the vector table in flash, but this does not work at all.

I do not need to remap any irq vectors at runtime, so I hoped to use a fixed vector table undestroyable by errounous ram accesses.
Labels (1)
0 Kudos
Reply
1 Reply

470 Views
PaoloRenzo
Contributor V
Do you try to only erase this "for" cycle and vector base address modification? By default, VBR and FLASH are in 0x0000_0000, so it should work without this copy Vector table from ROM to RAM.

Good luck,
0 Kudos
Reply