2023-08-31 04:47 AM - edited 2023-08-31 04:52 AM
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.
Solved! Go to Solution.
2023-08-31 05:05 AM
CPP name mangles.
Use extern "C" to insure C linkage
extern "C" void SysTick_Handler(void)
{
2023-08-31 05:05 AM
CPP name mangles.
Use extern "C" to insure C linkage
extern "C" void SysTick_Handler(void)
{
2023-08-31 05:28 AM
That solved the problem thank you.