Timer usage checks in wrong place Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
Posts: 699
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 9 times
Been thanked: 99 times

Timer usage checks in wrong place  Topic is solved

Postby steved » Fri Dec 14, 2018 1:33 pm

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).

User avatar
Site Admin
Posts: 12887
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 720 times
Been thanked: 602 times

Re: Timer usage checks in wrong place

Postby Giovanni » Mon Dec 31, 2018 9:28 am


Fixed as bug #994.


User avatar
Posts: 320
Joined: Mon Oct 29, 2012 3:17 am
Location: Jersey City, USA
Has thanked: 14 times
Been thanked: 7 times

Re: Timer usage checks in wrong place

Postby russian » Mon Jan 28, 2019 3:25 pm

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 STM32_ST_USE_TIMER 2

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 ?
http://rusefi.com/ - electronic fuel injection

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 3 guests