cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F cyclecounter, cctimer1, cctimer2 address mapping

George.P
Associate III
Posted on May 18, 2017 at 11:40

Οn which documentation file can one find the address mapping for the ARM registers on topic?

1 ACCEPTED SOLUTION

Accepted Solutions
AvaTar
Lead
Posted on May 19, 2017 at 10:38

I didn't mess wit DWT myself yet, just left it to the debugger.

But I'm pretty sure you need to enable it the same way as other peripherals. Perhaps you missed that ?

View solution in original post

9 REPLIES 9
Posted on May 18, 2017 at 16:24

ARM has Technical Reference Manuals for their cores.

ST has a Reference Manuals for the peripheral registers they add to their designs.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
George.P
Associate III
Posted on May 19, 2017 at 07:12

Hi Clive,

Since I'm talking about memory address mapping, only ST can give the location those registers are mapped, which is not being discussed in their reference manuals. 

Posted on May 19, 2017 at 08:29

DWT belongs to the core space, the peripheral address is thus defined by ARM. Like the SysTick counter, it is the same on every device - if the vendor chooses to implement it (DWT is optional).

For some reasons whatsoever ST forgoes to document the core space peripherals. Others do/did not.

AvaTar
Lead
Posted on May 19, 2017 at 10:38

I didn't mess wit DWT myself yet, just left it to the debugger.

But I'm pretty sure you need to enable it the same way as other peripherals. Perhaps you missed that ?

Posted on May 19, 2017 at 09:48

Hi AvaTar,

Thanks for the clarification.

I wasn't aware that memory mapping for core peripherals is defined by ARM. I was under the impression that ST could reallocate the memory to better suit their design.

In any case, I wasn't able to read 

DWT_CYCCNT @ 

0xE0001004, so I'll have to research it a bit further.

Posted on May 19, 2017 at 09:52

In any case, I wasn't able to read 

DWT_CYCCNT @ 

0xE0001004,

...

As said, the implementation is optional, i.e. left to the vendor.

Not only that, ARM states that not all DWT registers might be present in all implementations.

You might need to check the Ref. Manual of the device you are using, what it actually implements.

Posted on May 19, 2017 at 10:07

The device is STM32F303CC which does implement it (RM0316, ch33.13), it just that the pointer (volatile uint32_t *DWT_CYCCNT = (uint32_t *)0xE0001004;) I've declared doesn't seem to report sane values. Thanks for the help.

Posted on May 19, 2017 at 10:43

 ,

 ,

 ,
Posted on May 19, 2017 at 11:24

Yeap, that was it.

DWT needs to be enabled before one can read DWT_CYCCNT, as waclawek.jan's link shows.