AnsweredAssumed Answered

Unable to write "DWT->CTRL"

Question asked by _.andrew on Nov 2, 2015
Latest reply on Nov 12, 2015 by Zhong.Wenbin.001
Hi,
I want to get CPU cycle counter (DWT->CYCCNT) and uUnable to write DWT_CTRL register (value is always 0x40000000).

  /* Enable TRC */
  CoreDebug->DEMCR &= ~0x01000000;
  CoreDebug->DEMCR |= 0x01000000;
  /* Reset counter */
  DWT->CYCCNT = 0;
  /* Enable counter */
  DWT->CTRL &= ~0x00000001;
  DWT->CTRL |= 0x00000001;

How to solve this problem?
I use "System Workbench for STM32" IDE and "stm32f746g-discovery" board

PS: Command "mww 0xe0001000 1" for openocd works, and value for DWT_CTRL becomes 0x40000001

Outcomes