My projects don't work after upgrading Cube IDE to 1.19.1
I used Cude IDE version 1.18.1. successfully then upgraded and wrote the second project (timer). I'm using Nucelo-64 STM32 F411RE with clock rate 84Mhz.
My new project is to use the TIM4 with the settings: PSC: 8399, CP: 10000 to toggle the LED per second. The LED doesn't turn on/off whatsoever. (My prior project - to use the user button - doesn't work either!)
My files: lib.hpp:
#ifndef INC_LIB_HPP_
#define INC_LIB_HPP
#if __cplusplus
extern "C" {
#endif
void run();
void HAL_GPIO_EXTI_Callback(uint16_t);
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *);
#if __cplusplus
}
#endif
#endiflib.cpp:
#include "main.h"
#include "lib.hpp"
#include <stdio.h>
auto pressed = 0u;
auto flag = false;
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
if(GPIO_Pin == B1_Pin)
flag = true;
else flag = false;
}
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
HAL_GPIO_TogglePin(LED_GPIO_Port,LED_Pin);
}
void run() {
while (1) {
if(flag){
pressed++;
flag = false;
HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_SET);
}
else
HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET);
} // End of while (1)
}main.c file is rather big hence attached below.
