cancel
Showing results for 
Search instead for 
Did you mean: 

Code generated and built by STM32CubeIDE can not start the timer and systick ?

lhoan.1
Associate II

Hi,

I have generated and built code by STM32CubeIDE but the SysTick and Timer not work. I set breakpoint but the interrupt function just not run. GPIO feature work normal. But when I create the project by STM32CubeMX with the same configuration and built code by KeilC then everything work good. So is that a bug of SMT32CubeIDE? I'm using STM32F103C8T6 on board Bluepill. I don't want to use KeilC anymore because it not free. What should i do now?

Thank for your advice.

17 REPLIES 17
lhoan.1
Associate II

Thanks all.

Finally, The timer work when I replace HAL Driver with LL Driver. So I think there is a bug on STM32CubeIDE Compiler when built HAL code. Because everything works well with Keil C.

TDK
Guru

> So I think there is a bug on STM32CubeIDE Compiler when built HAL code.

Probably more likely there was a bug in your code. Having the timer set up in slave trigger mode will require you to actually trigger it, which your code doesn't do.

> sSlaveConfig.SlaveMode = TIM_SLAVEMODE_TRIGGER;

> sSlaveConfig.InputTrigger = TIM_TS_ITR0;

If you feel a post has answered your question, please click "Accept as Solution".

Hi, STM32CubeIDE already write these two above command in my code. And I already called the HAL_TIM_Base_Start_IT(&htim1) function after TIM1 was initialized

please see the main.c file

Sorry. I have misunderstood your answer

lhoan.1
Associate II

Thank @TDK​ very much!

After disabled Slave Trigger mode. The Timer work well. Now I'm wondering why with the same configuration, Code compiled by KeilC work but not with SMT32CubeIDE. Is that a bug on KeilC? :D

Again, more likely to be a bug in your code rather than a bug in the compiler. The hardware is obviously the same between the two and the compilers are mature and don't have glaring errors like this. It probably isn't the same configuration.

If you feel a post has answered your question, please click "Accept as Solution".
Ons KOOLI
Senior III

Hi Ihoan.1,

Please mark this question as answered if your problem is well solved.

Best Regards,

Ons.