We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
I need to change the Vector Table but I need it to be persistent through a reset, what I'm trying to do is set a vector table duplicate as a safety measurement for reprogramming the original vector table.
So far I being playing with the VTOR register but it seem that it return to 0 when a reset occurs.
am I messing something?
Regards.
No, there is no way. On Cortex-M VTOR is always set to zero on reset.But since this table is in Flash, why do you want any safety measures? Sure, there is a small likelyhood that the reset-vector gets destroyed, but this renders likely your device inoperable and you external HW should deal with a CPU which does not work (there are plenty of other reasons).
Well, because at the end the reflash of the bootloader (including the vector table) will be done by a peripheral like SPI (or some other), there won't be debug access on the units, and if something goes wrong I will end up with a dead unit.
So it was a safety measure that some microcontrollers that I have previously work with allow, so that's why I though I was missing something.
Is there another to achieve safety while flashing the vector table in this processor? Or is it consider a issue that doesn't need to be address due to the minimal possibility for it to happen?
OK, you want to update the bootloader? Why not have a two bootloaders. The first stage bootloader is as simple as possible but will never be changed. The second stage bootloader does not have to change the vector table thanks to VTOR. If it gets corrupted, you have at least a chance to fix it.
Or, choose a device which has a bootloader in ROM.
Two bootloaders will probably be the answer for my case. Thanks for you support Bastian.