cancel
Showing results for 
Search instead for 
Did you mean: 

SysTick does not interrupt in project created by STM32CubeIDE

WHuan.11
Associate

I used STM3CubeIDE to create a default project (no settings changed) for a stm32l496ve chip. It generates a main file that has:

int main(void)
  HAL_Init();
 
  SystemClock_Config();
 
  while (1)
  {
  }
  return 0;
}

And a SysTick_Handler defined in stm32l4xx_it.c:

void SysTick_Handler(void)
{
  /* USER CODE BEGIN SysTick_IRQn 0 */
 
  /* USER CODE END SysTick_IRQn 0 */
  HAL_IncTick();
  /* USER CODE BEGIN SysTick_IRQn 1 */
 
  /* USER CODE END SysTick_IRQn 1 */
}

The startup file startup_stm32l496vetx.s has SysTick defined in the vector table:

_pfnVectors:
	.word	_estack
	.word	Reset_Handler
	.word	NMI_Handler
	.word	HardFault_Handler
	.word	MemManage_Handler
	.word	BusFault_Handler
	.word	UsageFault_Handler
	.word	0
	.word	0
	.word	0
	.word	0
	.word	SVC_Handler
	.word	DebugMon_Handler
	.word	0
	.word	PendSV_Handler
	.word	SysTick_Handler
	.word	WWDG_IRQHandler
	...
        ...

But despite this, it doesn't seem like the SysTick is being interrupted. HAL_Delay() would cause an infinite loop and a breakpoint at HAL_IncTick in SysTick_Handler() is never called.

1 ACCEPTED SOLUTION

Accepted Solutions
WHuan.11
Associate

So I found out why. I moved the start of FLASH to a different address via the linker script. I forgot to change the FLASH_BASE define accordingly in stm32l496xx.h

View solution in original post

1 REPLY 1
WHuan.11
Associate

So I found out why. I moved the start of FLASH to a different address via the linker script. I forgot to change the FLASH_BASE define accordingly in stm32l496xx.h