Page 1 of 1
STM32F4 timer interrupt help needed
Posted: Tue May 03, 2022 11:46 am
by picclock
Hi
I'm trying to implement a timer software interrupt. I've tried using the example from :
https://github.com/stm32duino/STM32Exam ... llback.ino
But this fails with:
STM32TimerInterrupt.h:67:5: error: 'TIM_TypeDef' does not name a type
TIM_TypeDef* _timer;
Could really use some help or pointers to information as I seem to be stuck ..
Best Regards
picclock
Re: STM32F4 timer interrupt help needed
Posted: Tue May 03, 2022 12:57 pm
by GonzoG
Use main source code, not from some branch:
https://github.com/stm32duino/STM32Exam ... llback.ino
If you still get compile errors, we need more information (IDE version, core version, your exact source code, etc.)
Re: STM32F4 timer interrupt help needed
Posted: Tue May 03, 2022 1:25 pm
by picclock
@GonzoG
The source code I am using is the official example per the link I quoted in my post.
Arduino Version is 1.8.15
If Board is selected as Blackpill : STM32F401CCU6
Error: 'TIM_TypeDef' does not name a type TIM_TypeDef* _timer;
or
If Board selected as Generic STM32F series, then Generic F401CCU6
Error : 'HardwareTimer::attachInterrupt(void (&)(HardwareTimer*))'
code from :
https://github.com/stm32duino/STM32Exam ... llback.ino
Board from
https://github.com/stm32duino/BoardMana ... raw/master package_stmicroelectronics_index.json
Programming with ST LINK V2, not that its relevant as the error is with compile.
Hope this clarifies things
Best Regards
picclock
Re: STM32F4 timer interrupt help needed
Posted: Tue May 03, 2022 2:45 pm
by GonzoG
The link you pasted is on the official github but it's not the main code, it's a branch and an old one (for core v1.8 or earlier)
The main code in under this address:
https:// github.com/stm32duino/STM32Examples/blob/main/examples/Peripherals/HardwareTimer/Timebase_callback/Timebase_callback.ino
Your link:
https:// github.com/stm32duino/STM32Examples/blob/824017c21d555001db1ce047d97b562c1b7b6a9c/examples/Peripherals/HardwareTimer/Timebase_callback/Timebase_callback.ino
The code from main code example compiles without any errors.
Re: STM32F4 timer interrupt help needed
Posted: Tue May 03, 2022 2:56 pm
by picclock
@ GonzoG
Thank You so much. I have spent hours trying to figure this out, getting nowhere.
Cunningly shortening the links so that they appear identical in the posts didn't help either

.
Many Thanks for your assistance !!
Best Regards
picclock