Per AN4533, page 11, section 5.4. It says "You must program the interrupt vector table and flash configuration fields (FSEC, FOPT, and so on) to the nonactive upper block before swapping.". This doesn't make sense. Is this true? I don't think it is. I couldn't find this being done for the AN4533SW.zip example.
If it is true after a swap and reset does the value of SCB_VTOR get automatically adjusted, if so how?
Thanks
Hello Leif Zars:
That is true, you need to have the vector table programmed in the nonactive block before swapping and if you need a custom flash configuration (protection, security) then also program the corresponding fields as stated in the appnote.
In the example software the whole contents of the active flash block are copied to the nonactive block, including the vectors and the flash configuration, that's why you don't see it.
As for the SCB_VTOR, there is no need to adjust it, the reset value is 0x0 and it will point to the vector table of the new active block after reset.
I hope this helps.
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Ahh I thought the doc was talking specifically about SCB_VTOR, my mistake.