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 / not halted.
  • Live monitoring works, but a specific action (e.g. flashing) refuses to start.

Likely causes

  • The requested operation (flash programming, certain register accesses) is only safe with the core halted, and the core is running.
  • 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.