Skip to main content
Visitor II
October 6, 2020
Question

Application crashing after running from bootloader in case of different time base source

  • October 6, 2020
  • 1 reply
  • 755 views

Hello, In my bootloader time base source is Timer 6 and application its SysTick. When I make same time base for both ( i.e. timer 6), my application works fine.

Before jumping to main application I am de-installing timer 6 using below function but still my application is crashing. Any suggestion if I am missing anything here.

void HAL_DenitTick (void){
 
	 /* Disable the TIM6 global Interrupt */
	 HAL_NVIC_DisableIRQ(TIM6_DAC_IRQn);
 
	 /* Disable TIM6 clock */
	 __HAL_RCC_TIM6_CLK_DISABLE();
	 /* Stop the TIM time Base generation in interrupt mode */
	 HAL_TIM_Base_Stop(&htim6);
	 HAL_TIM_Base_DeInit(&htim6);
 
}

    This topic has been closed for replies.

    1 reply

    Graduate II
    October 6, 2020

    https://community.st.com/s/feed/0D53W00000Jl6vkSAB

    Figure out where it "crashes", you need to understand the failure.

    Disable the TIM6 clock LAST, otherwise you can't access the registers, ie going to be hard to stop/deinit

    Visitor II
    October 6, 2020

    Thanks for Reply. I re-generated project with STMCUBEMx and its started working without your suggested change. Strange....

    Anyway I added suggested changes. Will test it more.