Using CYCCNT in STM32G491RE
Hi every one
I want to use DWT->CYCCNT in my software for STM32G491RE. I used these 2 lines to enable it:
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; But when I see with the debugger it seems that it does not write anything to these registers. AFAIK for Cortex M7 we also have a lock register that should be written with the unique value provided by the reference manual.
But here as we have cortex m4 I think we don't have such a thing, as I couldn't find this register in the CMSIS header file too.
Am I missing anything? What should I do?
By the way, I have to say that I can use CYCCNT while the debugger is connected. the problem is that I need to also use it when it is not connected to the debugger.
