Page 1 of 1

Timer usage checks in wrong place  Topic is solved

Posted: Fri Dec 14, 2018 1:33 pm
by steved
The checks as to whether a particular timer is used for system tick are in hal_st_lld.c. So the appropriate '#define STM32_TIMxx_IS_USED' is executed only when compiling that file; the information is not available to other source files which may try and use the same timer.
Not sure of the ramifications, but I suggest these checks should be somewhere more 'global', probably hal_st_lld.h, so that the error is picked up as intended.
(It's not the end of the world, since the duplicate use of the interrupt vector is picked up at link-time, as long as the interrupt is used).

Re: Timer usage checks in wrong place

Posted: Mon Dec 31, 2018 9:28 am
by Giovanni
Hi,

Fixed as bug #994.

Giovanni

Re: Timer usage checks in wrong place

Posted: Mon Jan 28, 2019 3:25 pm
by russian
My project seems to be affected by this fix, need help understanding what's going on.

Is ChibiOS using TIMx in any mode or only in tickless mode? My rusefi has the following settings:

# If this value is zero then the system uses the classic periodic tick.
#define CH_CFG_ST_TIMEDELTA 0
also
#define STM32_ST_USE_TIMER 2
and
#define STM32_ICU_USE_TIM2 TRUE

My code seemed to working fine. I am trying to migrate to latest Chibi17 prior to starting Chibi18 migration and now I have
#error "ST requires TIM2 but the timer is already used"

What values should I be using for classic periodic tick in order to compile with latest Chibi17? Would Chibi18 behave the same?

rusEfi tracker https://github.com/rusefi/rusefi/issues/685

PS: is this also reported at viewtopic.php?f=35&t=4976 ?