I'm using the Cortex-M33 and I would like to know if it's possible to change the Non Secure Vector table offset address (VTOR) while maintaining the Secure VTOR pointing to a different address.
The VTOR_S is located at 0xE000ED08 and the VTOR_NS at 0xE002ED08.
If I change the address of the VTOR_S, the address of VTOR_NS also changes to the same as the secure. On the other hand, if I change the VTOR_NS (located at 0xE002ED08) nothing happens, not even the VTOR_NS itself...is there any protection bit that it's missing to me?
According the manual, VTOR is banked. So in secure mode you read/write VTOR_S and in normal mode VTOR_NS.
But real world might differ from theory (I have no M33 yet on desk).
That's correct. In addition, Secure software can change VTOR_NS using Non-secure alias address 0xE002ED08 as the original poster mentioned. The question for Afonso - are you talking about changing the VTOR_S using software, or by debugger? (Debugger don't see 0xE002ED08 and use a separated control bit to select current Security domain).
Sorry for the late reply... Yes, I´m using the debugger...that makes sense, because when I change directly the memory (on the debugger) the address is cleared automatically...and when I try to change it by software (using a pointer ou assembly intructions) the content of the address remains the same.
Sorry for the late reply... I'll try to change to the Non-Secure bank (thread) and change it.
You're welcome. Instead of using memory window to modify VTOR_S/VTOR_NS, debug tool should have some separate core peripheral access windows that allow you to control these registers.
In case you want to know the details:
In Armv8-M architecture Reference Manual, section1.2.50 DSCSR,
there is two bits called SBRSEL (Secure banked register select), and SBRSELEN (Secure banked register select enable), debugger can set SBRSELEN to 1, then it can use SBRSEL to decide if it want to see Secure or Non-secure versions of VTOR.