Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

STM32L1 stuck in WFI after flash error #955

Description

@tomasvr

Dear community,
I have been using a BMP to program and debug the stm32l162 processor with GDB. Most of the time this works without problems, but now I have ran into a problem during flashing which has left the mcu unresponsive.

I was trying to flash new firmware and during the load phase the following error occured:

Error writing data to flash

This has happened before, but usually I would just try to flash again and that would work.
This time however, when I retry to flash firmware onto the mcu I keep getting the following response:

Target voltage: 1.79V
Timeout during scan. Is target stuck in WFI?
Timeout during scan. Is target stuck in WFI?
SW-DP scan failed!
gdb/gdb.gdb:3: Error in sourced command file:
.gdb/target:4: Error in sourced command file:
Attaching to Remote target failed

It seems to me like the MCU is stuck in a faulty state in which it is unresponsive to the SWD lines, possibly because of the error during writing to flash in the load phase.

what I've tried so far:

  • Replugging the power of the device
  • Replugging all the BMP cables
  • Resetting the device through hard_srst
  • enabling connect_srst

None of these seem to help. Since I currently don't have access to another set of cables/probe/target I cannot verify whether this problem is exclusive to this single board.

Any help is welcome. Thank you in advance!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugConfirmed bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions