TIMv1 driver define error Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
Post Reply
srichard95
Posts: 5
Joined: Fri Jan 20, 2017 5:42 pm
Has thanked: 1 time
Been thanked: 1 time

TIMv1 driver define error

Post by srichard95 »

Dear Giovanni,

I have started to use the newest version of the ChibiOS and during the compiling i got errors to ICUD7, PWMD7. The TIMER7 is used for GPT.

Chibios version: ChibiOS 20.3.0
Platform: STM32
Compiler: gcc-arm-none-eabi-8-2018-q4-major

I take a look at to the "os/hal/ports/STM32/stm32_tim7.inc" and i found this at line 95:

Code: Select all

/**
 * @brief   TIM7 interrupt handler.
 *
 * @isr
 */
OSAL_IRQ_HANDLER(STM32_TIM7_HANDLER) {

  OSAL_IRQ_PROLOGUE();

#if HAL_USE_GPT
#if STM32_GPT_USE_TIM7
  gpt_lld_serve_interrupt(&GPTD7);
#endif
#endif
#if HAL_USE_ICU
  icu_lld_serve_interrupt(&ICUD7);
#endif
#if HAL_USE_PWM
  pwm_lld_serve_interrupt(&PWMD7);
#endif
#if 1
#if STM32_ST_USE_TIM7
  st_lld_serve_interrupt();
#endif
#endif

  OSAL_IRQ_EPILOGUE();
}


The compiler gives an error because ICU is activated and tries to call ICU "lld_serve_interrupt" but ICUD7 is not activated. If the ICU and PWM subsystem activeted it also tries to call both lld functions which I guess is not functional.

I have made the following changes and the errors fixed:

Code: Select all

/**
 * @brief   TIM7 interrupt handler.
 *
 * @isr
 */
OSAL_IRQ_HANDLER(STM32_TIM7_HANDLER) {

  OSAL_IRQ_PROLOGUE();

#if HAL_USE_GPT
#if STM32_GPT_USE_TIM7
  gpt_lld_serve_interrupt(&GPTD7);
#endif
#endif
#if HAL_USE_ICU
#if STM32_ICU_USE_TIM7
  icu_lld_serve_interrupt(&ICUD7);
#endif
#endif
#if HAL_USE_PWM
#if STM32_PWM_USE_TIM7
  pwm_lld_serve_interrupt(&PWMD7);
#endif
#endif
#if 1
#if STM32_ST_USE_TIM7
  st_lld_serve_interrupt();
#endif
#endif

  OSAL_IRQ_EPILOGUE();
}


In that case i can activate ICU and PWM subsystem while I using the TIMER7 for GPT. It is the same error for TIM6. I suppose it is a bug. If not, i apologize for take your time.

Best regards
Richard
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: TIMv1 driver define error

Post by Giovanni »

Hi Richard,

Thanks for finding, it is an obvious error, there is a missing check there. Will be fixed in next version and in trunk ASAP.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: TIMv1 driver define error

Post by Giovanni »

Fixed as bug #1078 in repository.

Giovanni
Post Reply