Skip to main content
Shilin
Associate
March 26, 2020
Solved

Assert error in STM32CubeL1: Need check definition of IS_TIM_MASTER_INSTANCE macro

  • March 26, 2020
  • 4 replies
  • 1280 views

I get some bug. I use mcu stm32l152ve. Version 1.9.0. After update i got some errors.

When i init, timer 6, 7, i got assert error in

assert_param(IS_TIM_SYNCHRO_INSTANCE(htim->Instance));

because

#define IS_TIM_MASTER_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
 ((INSTANCE) == TIM3) || \
 ((INSTANCE) == TIM4) || \
 ((INSTANCE) == TIM5) || \
 ((INSTANCE) == TIM9))
 
#define IS_TIM_SYNCHRO_INSTANCE(INSTANCE) IS_TIM_MASTER_INSTANCE(INSTANCE)

In previous versions was

#define IS_TIM_MASTER_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
 ((INSTANCE) == TIM3) || \
 ((INSTANCE) == TIM4) || \
 ((INSTANCE) == TIM5) || \
 ((INSTANCE) == TIM6) || \
 ((INSTANCE) == TIM7) || \
 ((INSTANCE) == TIM9))

it work perfect

This topic has been closed for replies.
Best answer by Imen.D

Hello,

Yes I confirm that TIM6 and TIM7 must be added to the IS_TIM_MASTER_INSTANCE macro.

I raised this internally for correction.

Thank your for highlighting this issue.

Best Regards,

Imen

4 replies

Khouloud ZEMMELI
ST Employee
March 26, 2020

​Hello @Shilin​ 

Could you please share your ioc file?

Thanks,

Khouloud

Shilin
ShilinAuthor
Associate
March 26, 2020

No problem.

Khouloud ZEMMELI
ST Employee
March 27, 2020

​Seems not a cubeMX Issue,

@Imen DAHMEN​  Could you please check it ?

Thanks,

Khouloud

Imen.DBest answer
ST Technical Moderator
April 2, 2020

Hello,

Yes I confirm that TIM6 and TIM7 must be added to the IS_TIM_MASTER_INSTANCE macro.

I raised this internally for correction.

Thank your for highlighting this issue.

Best Regards,

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks