-
Notifications
You must be signed in to change notification settings - Fork 39
MonoTimer does not work without debugger connected #76
Comments
Having the same issue, but only works if it just has been flashed by the debugger. Unplugging, and plugging it back to the debugger causes the |
@TheZoq2 Got it running with the following workaround, which I call before #define DEMCR_TRCENA 0x01000000
/* Core Debug registers */
#define DEMCR (*((volatile uint32_t *)0xE000EDFC))
...
/* Enable DWT */
DEMCR |= DEMCR_TRCENA;
*DWT_CYCCNT = 0;
/* Enable CPU cycle counter */
DWT_CTRL |= CYCCNTENA; There is no such equivalent of the |
Cool, I have since moved on to another solution without the A more rusty approach would be to use the |
Haha, definitely. I just needed some kind of a solution yesterday evening :) |
111: Add DCB::enable_trace() and DCB::disable_trace() r=korken89 a=kellerkindt This is required for the cycle counter of DWT to work, if the power supply has been unplugged since the last time it has been flashed japaric/stm32f103xx-hal/issues/76. See bit 24 here http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0337e/CEGHJDCF.html Corresponding PR in stm32f103xx-hal: japaric/stm32f103xx-hal/pull/94 Co-authored-by: kellerkindt <[email protected]> Co-authored-by: Michael Watzko <[email protected]>
114: Release 0.5.7 r=japaric a=kellerkindt As mentioned in /pull/111 (#111 (comment)), releasing 0.5.7 will allow the merge of japaric/stm32f103xx-hal/pull/94 which then allows japaric/stm32f103xx-hal/issues/76 to be resolved. Co-authored-by: Michael Watzko <[email protected]> Co-authored-by: Jorge Aparicio <[email protected]>
I just noticed that MonoTimer seems to be stopped, while I writing something to hstdout. |
My current project reads a
MonoTimer
in order to keep track of signals which have been received. These signals are then sent over serial to a pc. This works flawlessly when the stlink debugger is connected, however without it connected the value read is always 0.I assume this is because monotimer uses the "debug watch trace" peripheral which judging by the name means that it doesn't work without a debugger. Perhaps this should be specified in the documentation, or perhaps mono timer could be rewritten to use something that works without the debugger.
One thing to note is that the frequency reading still works.
The text was updated successfully, but these errors were encountered: