TIM1 as a OS Timer

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

Moderator: RoccoMarco

Post Reply
joaquin
Posts: 50
Joined: Sat Jan 22, 2011 8:44 pm
Has thanked: 1 time
Been thanked: 3 times

TIM1 as a OS Timer

Post by joaquin »

I'm trying to port an application to a STM32F103CBT6. This version of cpu has only 4 timers, and I use TIM2, TIM3 and TIM4 for PWM capture and PWM generation. So I suppose I have to change the default timer on mcuconf.h to TIM1 by assigning the variable STM32_ST_USE_TIMER to 1. I use the board configuration for Olimex P103 (which has #define STM32F103_MCUCONF on mcuconf.h file)
However, when compiling it gives an error:

Code: Select all

In file included from ../ChibiOS_3.0.2/os/hal/include/st.h:46:0,
                 from ../ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_timer.h:32,
                 from ../ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h:202,
                 from ../ChibiOS_3.0.2/os/rt/include/ch.h:74,
                 from ../ChibiOS_3.0.2/os/rt/src/chvt.c:29:
../ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h:93:2: error: #error "STM32_ST_USE_TIMER specifies an unsupported timer"
 #error "STM32_ST_USE_TIMER specifies an unsupported timer"

Does anybody encountered some time this error and could give me an advise?
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: TIM1 as a OS Timer

Post by Giovanni »

Hi,

TIM1 is not currently supported by the ST driver. You may add it to the driver or disable the tickless mode in chconf.h (CH_CFG_TIMEDELTA = 0).

Giovanni
joaquin
Posts: 50
Joined: Sat Jan 22, 2011 8:44 pm
Has thanked: 1 time
Been thanked: 3 times

Re: TIM1 as a OS Timer

Post by joaquin »

I have to confess that I didn't understand tickless mode (with your clue now I understand at least the basics). What confused me is that new tickless mode is active by default.
Thanks a lot, Giovanny, once tickless mode is deactivated, it works smoothly...
Post Reply