cancel
Showing results for 
Search instead for 
Did you mean: 

Vector table relocation

ivesely
Associate II
Posted on January 05, 2015 at 17:44

I have relocated the Vector Interrupt Table as follows

        *((volatile uint32_t *)0xE000ED08) = 0xFFFFFF00 & 0x08004400;        

        // jump to bootloader

        pVector = GetBootStartEntry();

        asm volatile (''mov pc, %0'' : /* no outputs */ :''r'' (pVector));

It keeps using the old vector table. I have verified that the content of the relocation register (0xE000ED08) has changed from 0x08000000 to 0x08004400. What am I missing?

Thanks.

4 REPLIES 4
Posted on January 05, 2015 at 19:31

I have relocated the Vector Interrupt Table as follows

 

 

        *((volatile uint32_t *)0xE000ED08) = 0xFFFFFF00 & 0x08004400;        

 

        // jump to bootloader

 

        pVector = GetBootStartEntry();

 

        asm volatile (''mov pc, %0'' : /* no outputs */ :''r'' (pVector));

 

 

It keeps using the old vector table. I have verified that the content of the relocation register (0xE000ED08) has changed from 0x08000000 to 0x08004400. What am I missing?

That the first entry is a Stack Pointer? That code you haven't presented does things we don't know?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ivesely
Associate II
Posted on January 06, 2015 at 17:50

I was just giving a little bit of context to show that after relocating the vector tabl we jump to a relocated application. The stack pointer has been set before this code snippet. The point was that *((volatile uint32_t *)0xE000ED08) = 0x08004400; did not seem to re-map the vector table.

Anyway, in the meantime I have found that one is supposed to use SCB->VTOR, the effective address being 0xE000E008. Yet the Programming Manual on page 206 in table 50 states that the address of VTOR is 0xE000ED08. So the question is why is the dicrepancy there.

Posted on January 06, 2015 at 18:05

What part exactly are you using?

    printf(''SCB->VTOR %08X = %08X\n'', &SCB->VTOR, SCB->VTOR);

SCB->VTOR E000ED08 = 08000000

Documentation seems coherent for the STM32F401

That's not to say it isn't shadowed at other addresses, using an RTOS?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ivesely
Associate II
Posted on January 06, 2015 at 20:21

STM32F427ZIT6

// core_cm4.h

#define SCS_BASE (0xE000E000UL)       /*!< System Control Space Base Address  */

#define SCB  ((SCB_Type *)SCB_BASE)   /*!< SCB configuration struct           */

I did not try to print it, but it looks like 0xE000E008.

No RTOS (no printf).

What part exactly are you using?

    printf(''SCB->VTOR %08X = %08X\n'', &SCB->VTOR, SCB->VTOR);

SCB->VTOR E000ED08 = 08000000

Documentation seems coherent for the STM32F401

That's not to say it isn't shadowed at other addresses, using an RTOS?