Target not halted

The target is running and memory cannot be accessed safely.

CORTEX_M_TARGET_NOT_HALTED

Symptoms

  • An operation fails saying the target is running, and the core confirms it is not halted when asked.
  • Reading memory keeps working — only the core’s own registers are refused.

Likely causes

  • Core registers (R0–R15, xPSR, SP, PC) live behind the debug unit and can only be read while the core is halted. Memory has no such rule, which is why live monitoring is unaffected.
  • A previous halt request failed silently — e.g. the core is stuck in a low-power state where halt does not land.

How to fix it

  1. Retry the operation

    MCUHex halts the core automatically where required; a transient failure (core sleeping at that instant) often succeeds on retry.

  2. Wake the target

    If the firmware sits in STOP/STANDBY, the halt may not stick. Trigger activity (button, reset) or enable DBGMCU low-power debug bits in firmware during development.

  3. Reset and reconnect

    As a last resort, reset the target and reconnect — after reset the core halts reliably before application code interferes.