cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 Init Vector Table

Carlos Hernandez
Associate II
Posted on March 14, 2018 at 01:06

Hi, I'm following a TI tutorial where the author is creating a Init Vector to determine which exception and interrupts are able to that program...

He's basically creating an array of pointers to int and pass function pointers.

I know that the microcontroller in that TI board is the same than the STM32F4 (Arm cortex M4).

I did a overview of the manual and I couldn't figure out how to set your own Vector.

Here you call it Interrupt Vector but, it's equal to their Init Vector...

The memory of this vector starts at 0x0000.

I just need some guidance or example to set this vector in my STM32F4

Thanks in advance.

#stm32f4
12 REPLIES 12
Posted on March 14, 2018 at 20:25

Thanks Neil!

Ajay2
Associate

Hello Carlos,

 

I'm very new to MC dev myself and I've just start working on them. I suspect you were following Miro Samek tutorial. I'm following that myself. I want to override the default interrupt handler for SysTICK interrupt.  This is what i could find in start up code in startup_stm32f401xx.s:

 

PUBWEAK SysTick_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
SysTick_Handler
B SysTick_Handler

How and where do I override this handler to do my own defined activities (such as glowing an LED) when ISR is hit?

I am using an STM32F410RE on a nucleo board

 

. @Andrew Neil @Carlos Hernandez @David SIORPAES . Would really appreciate some help on this.

The key is in the "weak" in "PUBWEAK"

The "weak" means, "here is a definition of this symbol, but  any other definition will override it"

So all you have to do is to provide your own definition of SysTick_Handler; ie, just define a function with the name SysTick_Handler.

eg, the HAL will automatically create one in the stm32xxxxx_it.c file:

/**
  * @brief This function handles System tick timer.
  */
void SysTick_Handler(void)
{
  /* USER CODE BEGIN SysTick_IRQn 0 */

  /* USER CODE END SysTick_IRQn 0 */
  HAL_IncTick();
  /* USER CODE BEGIN SysTick_IRQn 1 */

  /* USER CODE END SysTick_IRQn 1 */
}