Hi everyone,
I use MCUXpresso SDK: I noticed that in the startup code for all the compilers other than MCUXpresso, there is the code for setting VTOR register before the call of the SystemInit function, but there isn't such code for MCUXpresso compiler.
For ARM:
LDR R0, =0xE000ED08
LDR R1, =__Vectors
STR R1, [R0]
LDR R2, [R1]
MSR MSP, R2
For GCC:
.equ VTOR, 0xE000ED08
ldr r0, =VTOR
ldr r1, =__isr_vector
str r1, [r0]
ldr r2, [r1]
msr msp, r2
For IAR:
LDR R0, =0xE000ED08
LDR R1, =__vector_table
STR R1, [R0]
LDR R2, [R1]
MSR MSP, R2
What is the reason for this choice?
How can I set the VTOR register?
Many thanks
Biafra
Solved! Go to Solution.
Hi Francesco Bianchini
As long as MCUXpresso IDE uses a GCC compiler, if you want to set VTOR register you could use the same code that you mentioned, you will only have to specify that you going to uses assembly code.
Hope this helps
Best Regards
Jorge Alcala
Hi Francesco Bianchini
As long as MCUXpresso IDE uses a GCC compiler, if you want to set VTOR register you could use the same code that you mentioned, you will only have to specify that you going to uses assembly code.
Hope this helps
Best Regards
Jorge Alcala