cancel
Showing results for 
Search instead for 
Did you mean: 

Systick Interrupt issue

Ronik_123
Associate II

Hello Team,

I am currently working on STM32WLE5 microcontroller and getting issue in HAL_Delay(), it got stuck, ifound that systick interrupt was not generating. In main() function, I start with HAL_Init() and then HAL_Delay(500) and controller get stuck sometimes, the only way out was multiple reset. I have gone through many forums but didn't get exact the solution.

Thanks & Regards

Rohan

9 REPLIES 9

What are you doing with the BOOT0 pin in your design? Letting it Float? Pulled Low?

>>I have gone through many forums but didn't get exact the solution.

Yeah, that seems like stabbing in the dark, and you don't enumerate WHAT you did try, and what OBSERVATIONs you made, so we learn nothing.

Identify why it's not interrupting.

Is it loading SCB->VTOR correctly? What's the NVIC and SCB->VTOR showing in working vs not-working situations?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Karl Yamashita
Principal

You haven't shown any code so we don't know how you've used HAL_Delay. So i'll take a stab.

Some people mistakenly place HAL_Delay in a interrupt routine, which will get stuck.

If that is the case, you need to rethink on how to do the minimum in the interrupt and exit right away. That way other interrupts  like Systick can interrupt. Do the processing of data outside of the interrupt. Or change the interrupt priorities. 

If that is not the case, then you need to show code. 

I was told that if a devices starts to smoke, put the smoke back in. I guess I never got all the smoke because the device never worked afterwards.
Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.

Hello Karl,

 I have attached snap of my main function, which clearly shows that HAL_Delay is not in any ISR.

Hi Tesla,

What are you doing with the BOOT0 pin in your design? Letting it Float? Pulled Low?

-> It is being Pulled low.

Is it loading SCB->VTOR correctly? What's the NVIC and SCB->VTOR showing in working vs not-working situations

->We will try to analyse this when the non working  condition occurs again. For your reference I have attached snap of VTOR value when in working condition and linker file of code.

 

Hi Tesla,

Did you get a chance to look into linker file? Can you please check it?

Any possible reason behind the systick interrupt not working?

Actually we are using the HAl_Delay as per below,

void HAL_Delay(__IO uint32_t Delay)
{
  if (SYS_TimerInitialisedFlag == 0)
  {
    // Here call the weak function 
    Weak_HAL_Delay(Delay);
  }
  else
  {
    TIMER_IF_DelayMs(Delay);
  }
}
Based on systick before time base initialization and then moving to time base.
 
Thanks & Regards
Piyush

Edited to apply source code formatting - please see  How to insert source code for future reference.
Andrew Neil
Super User

@Ronik_123 @renziiiii - Please see How to insert source code.

I've edited @renziiiii's post to show how it should look.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Not really learning much from the linker file.

You have SCB->VTOR set to zero, which would then be dependent on what memory maps at zero currently, ie RAM, ROM, or FLASH

Better that you explicitly set SCB->VTOR to 0x08000000 (or your vectors address) in SystemInit() code.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hi Tesla,

In our case it is pointing to flash base address, i.e. 0x8000000.

Is there any chances of systick malfunctioning with Debug Mode enabled?

Regards

Maxime_MARCHETTO
Community manager
Community manager

Hello @Ronik_123,

This post has been escalated to the ST Online Support Team for additional assistance.  We'll contact you directly.

Best regards,
Maxime


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.