-
#include "stm32f4xx_hal.h" TIM_HandleTypeDef htim3; void setup() { HAL_Init(); __HAL_RCC_TIM3_CLK_ENABLE(); // Configurazione del Timer 3 HAL_TIM_Base_DeInit(&htim3); __HAL_TIM_ENABLE_IT(&htim3, TIM_IT_UPDATE); //HAL_NVIC_SetPriority(TIM3_IRQn, 0, 1); // Avvia il Timer 3 void loop() { void TIM3_IRQHandler(void) { If I change void TIM3_IRQHandler(void) with void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) { Uso la libreria SrcWrapper alla versione 1.0.1 nella cartella: C:\Users\MYSELF\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.6.0\libraries\SrcWrapper Compilation error: exit status 1 I need an interrupt to count timer pulses. This is just a simple example. I don't want to use HardwareTimer library to control timers because I want generate precise PWM. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @ennio64 So define |
Beta Was this translation helpful? Give feedback.
-
SOLVED |
Beta Was this translation helpful? Give feedback.
Hi @ennio64
You have to disable the usage of HAL TIM for Arduino API:
https://github.com/stm32duino/Arduino_Core_STM32/wiki/HAL-configuration#hal-module-only
So define
HAL_TIM_MODULE_ONLY
thanks the build_opt.h or hal_conf_extra.h.Then do not forget to add
extern "C"
before each handler definition, ex:extern "C" void TIM3_IRQHandler(void) {