[SOLVED]Interruptions in the timer do not work

STM32F103 Nucleo boards e.g. STM Nucleo F103RB
fpiSTM
Posts: 316
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: Interruptions in the timer do not work

Post by fpiSTM » Wed Nov 29, 2017 8:26 am

Which core you used?

Note that, if the IRQHandler is defined in a cpp file or the ino file, you have to declare the TIM6_DAC_IRQHandler as extern "C"

Code: Select all

extern "C" void TIM6_DAC_IRQHandler()
With the Arduino_Core_STM32, there is an issue with the TiMx_IRQHandler which are not defined as weak.
I will handle Timer management soon

FRANCISCOGIMENO
Posts: 38
Joined: Wed Nov 08, 2017 12:30 pm

Re: Interruptions in the timer do not work

Post by FRANCISCOGIMENO » Wed Nov 29, 2017 10:58 am

The code is compiled well and the counter counts according to plan.

Both in your example and in the previous one published by me.

The problem is that when you reach the end of the account, the micro is blocked and never enters the
interruption, it's as if I was going to look for that interruption and I will not find it, and of course it hangs up.

This happens with the two examples with yours and mine

Any suggestions?

FRANCISCOGIMENO
Posts: 38
Joined: Wed Nov 08, 2017 12:30 pm

Re: Interruptions in the timer do not work

Post by FRANCISCOGIMENO » Wed Nov 29, 2017 11:18 am

Hello

Core: nucleo STMF303 - F303K8

and that line where I put it, because I tested the start of the program:

extern "C" void TIM6_DAC_IRQHandler();

and I get an error.

core.a(timer.c.o)*: In function TIM6_DAC1_IRQHandler
timer.c*: (.text.TIM6_DAC1_IRQHandler+0x0): multiple definition of TIM6_DAC1_IRQHandler

dannyf
Posts: 228
Joined: Wed May 11, 2016 4:29 pm

Re: Interruptions in the timer do not work

Post by dannyf » Wed Nov 29, 2017 11:55 am

never enters the
interruption,
you haven't (and couldn't) establish that. if you try to establish that, you will find the problem with your code.
Any suggestions?
the same as I gave you earlier.

FRANCISCOGIMENO
Posts: 38
Joined: Wed Nov 08, 2017 12:30 pm

Re: Interruptions in the timer do not work

Post by FRANCISCOGIMENO » Wed Nov 29, 2017 12:22 pm

Excuse me but I do not understand what you mean.

fpiSTM
Posts: 316
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: Interruptions in the timer do not work

Post by fpiSTM » Wed Nov 29, 2017 1:01 pm

Error is normal with the Arduino_CORE_STM32 as the function TIM6_DAC1_IRQHandler is already defined in the core.

As already said, I have to review timer management, issue opened to track this review:
https://github.com/stm32duino/Arduino_C ... issues/146

You issue is linked to this PR:
https://github.com/stm32duino/Arduino_C ... 2/pull/150
Core already defined TIMx_IRQHandler while it should not.

Specifically this line:
https://github.com/stm32duino/Arduino_C ... 54128R1119

Code: Select all

WEAK void TIM6_IRQHandler(void)
where
#define TIM6_IRQHandler TIM6_DAC_IRQHandler
See https://github.com/stm32duino/Arduino_C ... mer.h#L100

FRANCISCOGIMENO
Posts: 38
Joined: Wed Nov 08, 2017 12:30 pm

Re: Interruptions in the timer do not work

Post by FRANCISCOGIMENO » Wed Nov 29, 2017 1:49 pm

Ok. Ok, IT ALREADY WORKS FINALLY :D :D :D :D :D
Many many thanks, everyone.

Summarized for the one that happens to me and does not go crazy ... :roll: :roll:

Change the timer.c file
All these void TIM.... for these WEAK void TIM...... and save.


When the interruption is defined in this way:

extern "C" {
void TIM6_DAC_IRQHandler ()
{
interruption code
}
}

And now :lol: :lol: :lol: :lol: :lol:

I almost died in this one.

thanks, thanks, thanks, everyone.

Post Reply