This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to relocate the Cortex-M3 Vector Table

Hello,
I am Davide Masi and I work on Fujitsu based on ARM Cortex M3.

How do I relocate the interrupt vector table from address 0x0000 to a different address, for examples in RAM?
Where can I find examples or AN about the problem?

Thanks

Parents
  • 
    
    #define NVIC_VectTab_FLASH      (0x00000000)
    #define AP_START_SECTOR          0x00010000
    
    
    void NVIC_SetVectorTable(unsigned long NVIC_VectTab, unsigned long Offset)
            {
    
            SCB->VTOR = NVIC_VectTab | (Offset & (unsigned int)0x1FFFFF80);
            }
    
    int main (void) {
    
            void (*user_code_entry)(void);
    
            // your code here
            .
            .
            .
    
            // the jump to new vector table.
    
    
            NVIC_SetVectorTable(NVIC_VectTab_FLASH, AP_START_SECTOR);
            user_code_entry = (void (*)(void))((AP_START_SECTOR)+1);
    
            // jumps to new position of vector class
            user_code_entry();
            }
    
    

Reply
  • 
    
    #define NVIC_VectTab_FLASH      (0x00000000)
    #define AP_START_SECTOR          0x00010000
    
    
    void NVIC_SetVectorTable(unsigned long NVIC_VectTab, unsigned long Offset)
            {
    
            SCB->VTOR = NVIC_VectTab | (Offset & (unsigned int)0x1FFFFF80);
            }
    
    int main (void) {
    
            void (*user_code_entry)(void);
    
            // your code here
            .
            .
            .
    
            // the jump to new vector table.
    
    
            NVIC_SetVectorTable(NVIC_VectTab_FLASH, AP_START_SECTOR);
            user_code_entry = (void (*)(void))((AP_START_SECTOR)+1);
    
            // jumps to new position of vector class
            user_code_entry();
            }
    
    

Children
No data