Timer usage checks in wrong place Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
steved
Posts: 562
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 4 times
Been thanked: 62 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
Giovanni
Site Admin
Posts: 11649
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 488 times
Been thanked: 409 times
Contact:

Re: Timer usage checks in wrong place

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

Hi,

Fixed as bug #994.

Giovanni

User avatar
russian
Posts: 310
Joined: Mon Oct 29, 2012 3:17 am
Location: Jersey City, USA
Has thanked: 12 times
Been thanked: 5 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 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 ?
http://rusefi.com/ - electronic fuel injection


Return to “Bug Reports”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests