Reconfigure timer usage at run-time? Topic is solved

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: barthess, RoccoMarco

rreignier
Posts: 23
Joined: Sat Apr 15, 2017 11:49 pm
Has thanked: 7 times
Been thanked: 4 times

Reconfigure timer usage at run-time?

Postby rreignier » Mon Feb 10, 2020 11:16 pm

Hi,

I would like to be able to change the usage of a timer at run-time between GPT and QEI (encoder). Both are not used at the same time.
I know that QEI is not (yet?) part of ChibiOS HAL, only ChibiOS-Contrib, but as a general question, is it possible to change the usage of a timer at run-time?
My issue for now is that if I enable both GPT and QEI on the same timer in mcuconf.h, I get the error:

Code: Select all

"GPTD4 requires TIM4 but the timer is already used"


So, do I have to comment out this check in the ChibiOS source code or is there a workaround for that issue?

nikiwaibel
Posts: 9
Joined: Sat Mar 17, 2018 2:51 pm
Has thanked: 3 times
Been thanked: 4 times

Re: Reconfigure timer usage at run-time?

Postby nikiwaibel » Tue Feb 11, 2020 2:07 am

as of my knowledge: timers are defined/assigned statically to either the
  • GPT (gerneral purpose timer),
  • PWM or
  • ICU (input capute unit - to measure duty cycles)
driver; and that assignment can't be changed / dynamically assigned during runtime.

User avatar
Giovanni
Site Admin
Posts: 13125
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 769 times
Been thanked: 653 times
Contact:

Re: Reconfigure timer usage at run-time?  Topic is solved

Postby Giovanni » Tue Feb 11, 2020 5:30 am

Correct, timers assignment cannot be changed dynamically.

Giovanni

rreignier
Posts: 23
Joined: Sat Apr 15, 2017 11:49 pm
Has thanked: 7 times
Been thanked: 4 times

Re: Reconfigure timer usage at run-time?

Postby rreignier » Tue Feb 11, 2020 9:37 am

Ok, thank you.

I will try to use another timer for GPT. A basic timer like Timer6.


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 8 guests