STM32F746ZGTx DWT Issue
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-03-17 5:22 AM
Posted on March 17, 2016 at 13:22
Hi,
I'm trying to get the value of the CYCCNT in a STM32F746 Nucleo Board. Code is as follows:
// Configuring DEMCR & CTRL registers
CoreDebug->DEMCR &= ~0x01000000;
CoreDebug->DEMCR |= 0x01000000;
DWT->CTRL &= ~0x00000001;
DWT->CTRL |= 0x00000001;
DWT->CYCCNT = 0;
//Do something...
uint32_t Count = DWT->CYCCNT;
Registers were not written, and Count is always zero.
Has anyone faced a similar issue?
I employ the same code for Cortex M4 STM32F4xx MCUs, and it works perfect!
Thanks,
#stm32f746zgtx-dwt-issue
Labels:
- Labels:
-
STM32F7 Series
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-03-17 7:58 AM
Posted on March 17, 2016 at 15:58
Has anyone faced a similar issue?
Yes, and it has been covered here before, you need to unlock access to the registers. Google a bit, something will come up.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-03-17 8:27 AM
Posted on March 17, 2016 at 16:27
Thanks for the reply,
A functional code is as follows:
1.
DWT->LAR = 0xC5ACCE55;
// Unlock code
2.
3.
DWT->CTRL |= 0x01;
4.
DWT->CYCCNT = 0;
5.
6.
// Do something...
7.
8.
uint32_t Count = DWT->CYCCNT;
