Where is the Definition of the SYSTICK Handler?

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Custom board with a ATSAMV71N19B. Calls to the HAL_Delay on one project are hanging because the SYSTICK count flag isn't getting set. SYSTICK is enabled and has a clock source in PMC. Created a small project with just some delay calls, and that's working fine. I've combed through and can't figure out what the difference is that's preventing SYSTICK from working in the one project. In both projects, I see the declaration of the handler but no definition. Clearly there is one, because it's working. What am I mising? 

 

Directly from START:

/**
 * \brief Delay loop to delay n number of cycles
 */
void _delay_cycles(void *const hw, uint32_t cycles)
{
	(void)hw;
	uint8_t  n   = cycles >> 24;
	uint32_t buf = cycles;

	while (n--) {
		SysTick->LOAD = 0xFFFFFF;
		SysTick->VAL  = 0xFFFFFF;
		while (!(SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk)) //HANGS HERE
			;
		buf -= 0xFFFFFF;
	}

	SysTick->LOAD = buf;
	SysTick->VAL  = buf;
	while (!(SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk))
		;
}

 

This topic has a solution.
Last Edited: Fri. Jan 14, 2022 - 01:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That code isn’t using a handler…

 

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Has delay_init(SysTick) been called? Normally this is done from the start generated code in driver_init.c

/Lars
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Lajon wrote:

Has delay_init(SysTick) been called? Normally this is done from the start generated code in driver_init.c

/Lars
 

 

Lars,

That's twice this week you've made me smack my own forehead after pointing out something simple I missed. Thank you!