cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CUBEIDE Interrupt Vector Table does not correctly

erenimo
Associate

Hi I am trying to implement my own drivers in order to learn C++ for embedded. I am working with a STM32F407G (discovery board). I was trying to implement a Handler for SysTick but for some reason when I look into the vector table in memory, SysTick vector is not set to correct function. Most probably my mistake obvious but I am a beginner and I would appreciate any help. My main.cpp looks like this:

#include <stdint.h> #include <stdio.h> #include "STM32F4xx_GPIO.hpp" #include "STM32F4xx_IRQ.hpp" void SysTick_Handler(); volatile uint8_t a; int main(void) { SysConfig(); GPIO LED(GPIO::GPIOD, PD12, GPIO::OUTPUT, GPIO::PUSHPULL, GPIO::SPEED_VERYHIGH, GPIO::FLOAT); GPIO BUTTON(GPIO::GPIOA, PA0, GPIO::INPUT, GPIO::PUSHPULL, GPIO::SPEED_LOW, GPIO::FLOAT); /* Loop forever */ while(1){ LED.Write(BUTTON.Read()); } } void SysTick_Handler(){ System_Tick++; }

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

CPP name mangles.

Use extern "C" to insure C linkage

extern "C" void SysTick_Handler(void)

{

 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

2 REPLIES 2

CPP name mangles.

Use extern "C" to insure C linkage

extern "C" void SysTick_Handler(void)

{

 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

That solved the problem thank you.