microbit-foundation / micropython-microbit-v2

Temporary home for MicroPython for micro:bit v2 as we stablise it before pushing upstream
MIT License
41 stars 22 forks source link

codal_port/ticks_cpu: Check CoreDebug DEMCR trace enable bit. #199

Closed microbit-carlos closed 2 months ago

microbit-carlos commented 2 months ago

The DAPLink controlled reset button performs a target reset via SWD, and the CoreDebug trace enable bit seems to be cleared while the DWT->CTRL cycle count enable bit is not.

Fixes https://github.com/microbit-foundation/micropython-microbit-v2/issues/179#issuecomment-2059077656.

dpgeorge commented 2 months ago

Nice find! I tested this and it fixes the issue.