GPT and timer 14 on STM32F0....

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

Moderators: barthess, RoccoMarco

rew
Posts: 338
Joined: Sat Jul 19, 2014 12:59 pm
Been thanked: 11 times

GPT and timer 14 on STM32F0....

Postby rew » Fri Oct 23, 2015 1:55 pm

Hi,
I have a simple thing I want "done" with a timer, so I enabled GPT, and decided the simplest timer I could find would suffice..... I picked "TIM14". But I'm getting a bunch of compiler errors. As a test, I went to testhal/STM32/STM32F0xx/ADC, enabled GPT in halconf.h, and then enabled TIM1 in mcuconf.h. That compiles fine. Then I enabled TIM14 as well and:

Code: Select all

../../../../os/hal/ports/STM32/LLD/TIMv1/gpt_lld.c:379:2: error: #error "STM32_TIM14_HANDLER not defined"
 #error "STM32_TIM14_HANDLER not defined"
  ^
../../../../os/hal/ports/STM32/LLD/TIMv1/gpt_lld.c: In function 'gpt_lld_start':
../../../../os/hal/ports/STM32/LLD/TIMv1/gpt_lld.c:660:7: warning: implicit declaration of function 'rccEnableTIM14' [-Wimplicit-function-declaration]
       rccEnableTIM14(FALSE);
       ^
../../../../os/hal/ports/STM32/LLD/TIMv1/gpt_lld.c:661:7: warning: implicit declaration of function 'rccResetTIM14' [-Wimplicit-function-declaration]
       rccResetTIM14();
       ^
../../../../os/hal/ports/STM32/LLD/TIMv1/gpt_lld.c:663:24: error: 'STM32_TIM14_NUMBER' undeclared (first use in this function)
       nvicEnableVector(STM32_TIM14_NUMBER, STM32_GPT_TIM14_IRQ_PRIORITY);
                        ^
../../../../os/hal/ports/STM32/LLD/TIMv1/gpt_lld.c:663:24: note: each undeclared identifier is reported only once for each function it appears in
../../../../os/hal/ports/STM32/LLD/TIMv1/gpt_lld.c: In function 'gpt_lld_stop':
../../../../os/hal/ports/STM32/LLD/TIMv1/gpt_lld.c:804:25: error: 'STM32_TIM14_NUMBER' undeclared (first use in this function)
       nvicDisableVector(STM32_TIM14_NUMBER);
                         ^
../../../../os/hal/ports/STM32/LLD/TIMv1/gpt_lld.c:806:7: warning: implicit declaration of function 'rccDisableTIM14' [-Wimplicit-function-declaration]
       rccDisableTIM14(FALSE);
       ^

Should I produce a patch? It's probably less work for you because you're more familiar with the code, but I can probably manage....

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

Re: GPT and timer 14 on STM32F0....

Postby Giovanni » Fri Oct 23, 2015 6:22 pm

Fixing it, I have to check also other branches.

Giovanni

rew
Posts: 338
Joined: Sat Jul 19, 2014 12:59 pm
Been thanked: 11 times

Re: GPT and timer 14 on STM32F0....

Postby rew » Sat Oct 24, 2015 12:07 pm

While on the subject of GPT and timers. TIM15, 16, and 17 are too "basic" to be used as GPT timers?
My STM32F072RB has those, but it seems ChibiOS cannot use them for GPT....

[update] GPT is able to use TIM6, TIM7 on stm32F4, but not on F072? The hardware modules are the same. (the text in the reference manual is almost letter-for-letter the same). Hmm. This seems to be only related to missing defines in my mcuconf.

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

Re: GPT and timer 14 on STM32F0....

Postby Giovanni » Sat Oct 24, 2015 1:41 pm

Hi,

Those timers share the IRQ with other timers so it is problematic. I am working on a solution but it will take a while, basically each platform will declare its ISRs for conflicting timers, I already made something similar in the DMAv1 driver.

Giovanni


Return to “STM32 Support”

Who is online

Users browsing this forum: Google [Bot] and 5 guests