Arm Cortex-M: Failed to initialize debug session

01-Aug-2024

Possible solutions

LPC devices

The most common cause is that the image programmed in the Flash prevents any further debug access or connections and fails to establish a debug session. The image usually contains code that:

  • Sets the SoC clocks up incorrectly
  • Enables a watchdog timer
  • This puts the SoC into a very low-power mode
  • Switches off some, or all of the multiplexed debug pins (JTAG/SWD)

If the CPU comes out of reset and executes such code before the BlueBox takes control of the system, the debugger is not able to make a successful debug connection and results in an error message Failed to initialize debug session.

Trigger an ISP reset where the appropriate ISP pin(s) is pulled low as the board is reset.

LPC MCUs typically feature one or more ISP pins which are read by the built-in bootloader at reset which determines whether the image in Flash should be executed or not. It is typically possible to recover a target with a bad image programmed into Flash by triggering an ISP reset.


XMC1000 devices

Refer to the topic System reset fails for more information. 


Failed to initialize debug session

Was this answer helpful?