Skip to main content
TShet.2
Associate II
October 30, 2023
Solved

SysTick is not triggering after shifting the Interrupt Vector Table

  • October 30, 2023
  • 3 replies
  • 1465 views

Hello Everyone,

 I am using STM32F030CCT6TR microcontroller for Bootloader application. But as the mentioned controller is cortex M0+ ,  I directly can't change the interrupt vector table address myself using VTOR.

So, I am copying the interrupt vector table from Flash memory to RAM and calling it when Application is running from the Bootloader.

All the Interrupt are getting triggered expect for Sys Tic(),

So Please help me with above problem.

 

Below is function  i am using for the same.

 

void goto_application(void)

{

void (*app_reset_handler)(void) = (void*)(*((volatile uint32_t*) (ETX_APP_FLASH_ADDR + 4U)));

deinitEverything();

app_reset_handler(); //call the app reset handler

}

 

 

void deinit Everything(void)

{

__HAL_RCC_GPIOC_CLK_DISABLE();

__HAL_RCC_GPIOD_CLK_DISABLE();

__HAL_RCC_GPIOB_CLK_DISABLE();

__HAL_RCC_GPIOA_CLK_DISABLE();

HAL_RCC_DeInit();

HAL_DeInit();

SysTick->CTRL = 0;

SysTick->LOAD = 0;

SysTick->VAL = 0;

 

HAL_SuspendTick();

}

 

Calling the

HAL_ResumeTick(); and HAL_Init(); after jumping to the Application.

 

 

Using the below line of code for copying the Interrupt Vector table from flash memory to RAM.

 

 

    This topic has been closed for replies.
    Best answer by Rim LANDOLSI

    Hello @TShet.2 ,

     

    I suggest you consult this link . It would be helpful to create a bootloader application.

     

    Thanks ,

    Rim

    3 replies

    gbm
    Super User
    October 30, 2023

    The most important parts of your code are missing: copying the exception table and mapping RAM at 0. These must be done before jumping to the app code. Also, I cannot see the stack pointer setting in your code.

    My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
    Tesla DeLorean
    Guru
    October 30, 2023

    The STM32F0 is a CM0, not a CM0+ device

    You need to carve out 192 / 0xC0 space at 0x20000000 (RAM), memcpy the 192 bytes from your new vector table in Flash over to the 0x20000000 space, then remap RAM into the zero space instead of FLASH

    I'm sure there are actual examples posted in the forum.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Rim LANDOLSI
    Rim LANDOLSIBest answer
    ST Employee
    October 31, 2023

    Hello @TShet.2 ,

     

    I suggest you consult this link . It would be helpful to create a bootloader application.

     

    Thanks ,

    Rim