Skip to main content
Associate III
July 29, 2025
Solved

STM32H503 DWT problem with PRODUCT STATE == 72

  • July 29, 2025
  • 1 reply
  • 1012 views

Friends, hello, I encountered a problem with starting DWT with PRODUСT STATE = 72;
I measure the time between pulses (white beam of the logic analyzer) by the EXTI5 interrupt input (falling edge of the signal), TIME_LONG_SENS = DWT->CYCCNT / (SystemCoreClock / 1000000); and then reset the counter DWT->CYCCNT = 0U; I measured the number of pulses on the generator and the number of interrupts on the input, they are equal. Then after a certain delay I control the microcontroller output to send a pulse (red and yellow beams of the logic analyzer).
The problem is that after zeroing DWT in the PRODUСT STATE = 72 state,

Mike1992_0-1753806135140.png

One output pulse is skipped.

it does not always start and upon arrival of the next interrupt, the DWT->CYCCNT value is zero, and accordingly, the measured time is also zero.
If I set PRODUСT STATE = ED,

Mike1992_1-1753806184171.png

 

then this problem does not occur and the same code works correctly.
Please tell me what my problem is and how to solve it?

Best answer by Jocelyn RICARD

Hello @Mike1992 ,

the DWT as well as all debug peripherals are not available when device is in CLOSED state..

You can use either Systick timer or any timer provided in the device

Best regards

Jocelyn

1 reply

Jocelyn RICARD
Jocelyn RICARDBest answer
ST Employee
August 12, 2025

Hello @Mike1992 ,

the DWT as well as all debug peripherals are not available when device is in CLOSED state..

You can use either Systick timer or any timer provided in the device

Best regards

Jocelyn