Skip to main content
sheng yang
Senior
September 5, 2024
Solved

systick handler keep pending on stm32h7 board.

I made a project with stm32h7 board, and use pemicro multlink to debug it under keil. I found it keep in systick handler pending but no active.

I checked systick module register as:

shengyang_0-1725578415036.png

the counter is changed.

and then I checked SCB releate registers as

shengyang_1-1725578563853.png

and the interrupt handler addr is as

shengyang_2-1725578660534.png

matched with vector config as:

shengyang_3-1725578726103.png

 

I don't know where is wrong ?

This topic has been closed for replies.
TDK
TDKBest answer
September 6, 2024

Only so many reasons why an interrupt is not happening. Go down the list and verify them all:

  • Interrupts need to be enabled globally (they are by default, use __enable_irq()).
  • SysTick interrupt needs to be enabled (in SysTick->CTRL)
  • Execution cannot be in an equal or higher priority interrupt (print out SCB registers).

Viewing values in a register viewer (e.g. the SFR window in STM32CubeIDE) will be easier to navigate than viewing raw memory and translating.

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

4 replies

TDK
TDKBest answer
September 6, 2024

Only so many reasons why an interrupt is not happening. Go down the list and verify them all:

  • Interrupts need to be enabled globally (they are by default, use __enable_irq()).
  • SysTick interrupt needs to be enabled (in SysTick->CTRL)
  • Execution cannot be in an equal or higher priority interrupt (print out SCB registers).

Viewing values in a register viewer (e.g. the SFR window in STM32CubeIDE) will be easier to navigate than viewing raw memory and translating.

"If you feel a post has answered your question, please click ""Accept as Solution""."
sheng yang
Senior
September 6, 2024

1. I have checked SysTick->CTRL = 0X7 so SysTick interrupt has beed enabled. 

2. Execution cannot be in an equal or higher priority interrupt (print out SCB registers)  I wonder which register do you mean ? and I have print these registers in the picture below.

3. Interrupts need to be enabled globally (they are by default, use __enable_irq()) I will check this later with PRIMASK , FAULTMASK, BASEPRI..

 

TDK
September 6, 2024

> 2. Execution cannot be in an equal or higher priority interrupt (print out SCB registers)  I wonder which register do you mean ? and I have print these registers in the picture below.

Mainly SCB->ICSR, which contains VECTACTIVE. Should also get this information by looking at the call stack.

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