STM32F4 timer interrupt help needed

Post here first, or if you can't find a relevant section!
Post Reply
picclock
Posts: 20
Joined: Sat Aug 14, 2021 8:21 am

STM32F4 timer interrupt help needed

Post 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
by GonzoG » Tue May 03, 2022 2:45 pm
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.
Go to full post
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: STM32F4 timer interrupt help needed

Post 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.)
picclock
Posts: 20
Joined: Sat Aug 14, 2021 8:21 am

Re: STM32F4 timer interrupt help needed

Post 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
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: STM32F4 timer interrupt help needed

Post 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.
picclock
Posts: 20
Joined: Sat Aug 14, 2021 8:21 am

Re: STM32F4 timer interrupt help needed

Post 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
Post Reply

Return to “General discussion”