Skip to content

Commit 0779932

Browse files
authored
Merge pull request #2 from doesnotcompete/main
Unlock DWT register
2 parents 93056b8 + a7e61bb commit 0779932

File tree

1 file changed

+2
-1
lines changed
  • libs/trace/include/orbcode/trace

1 file changed

+2
-1
lines changed

libs/trace/include/orbcode/trace/dwt.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ extern "C"
197197
void DWTSetup(const DWTOptions* options)
198198
{
199199
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; // Enable ITM and DWT
200+
DWT->LAR = 0xC5ACCE55; // Unlock DWT access via magic number
200201

201202
uint32_t ctrl = 0;
202203
ctrl |= (options->FoldedInstructionCounterEvent ? 1 : 0) << DWT_CTRL_FOLDEVTENA_Pos;
@@ -265,4 +266,4 @@ extern "C"
265266

266267
#ifdef __cplusplus
267268
}
268-
#endif
269+
#endif

0 commit comments

Comments
 (0)