Question
Unable to write ''DWT->CTRL''
Posted on November 02, 2015 at 14:30
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 #stm32f746g-dwt-cyccnt