GPT and timer 14 on STM32F0....

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

Moderator: RoccoMarco

Post Reply
rew
Posts: 383
Joined: Sat Jul 19, 2014 12:59 pm
Has thanked: 2 times
Been thanked: 14 times

GPT and timer 14 on STM32F0....

Post 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....
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

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

Post by Giovanni »

Fixing it, I have to check also other branches.

Giovanni
rew
Posts: 383
Joined: Sat Jul 19, 2014 12:59 pm
Has thanked: 2 times
Been thanked: 14 times

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

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

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

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