Page 1 of 1

GPT and timer 14 on STM32F0....

Posted: Fri Oct 23, 2015 1:55 pm
by rew
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....

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

Posted: Fri Oct 23, 2015 6:22 pm
by Giovanni
Fixing it, I have to check also other branches.

Giovanni

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

Posted: Sat Oct 24, 2015 12:07 pm
by rew
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.

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

Posted: Sat Oct 24, 2015 1:41 pm
by Giovanni
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