cancel
Showing results for 
Search instead for 
Did you mean: 

B-G431B-ESC1 Not Detected by STM32CubeProgrammer After Failed Connection

Ankitesh
Associate II

I am using the B-G431B-ESC1 board, which connects to my laptop via a micro-USB to USB-A cable. After a failed connection attempt, the board is no longer detected by STM32CubeProgrammer. Additionally, a file named "File.txt" is created on the MCU after the failed attempt.

The contents of the file are:
"The interface firmware FAILED to reset/halt the target MCU."

This file appears to be causing issues with the connection to STM32CubeProgrammer.

Could anyone please help me resolve this issue?

Ankitesh_0-1770964987992.pngAnkitesh_1-1770965020484.png

 

10 REPLIES 10
Ankitesh
Associate II

it is FAIL.TXT not File.txt

STuser2
Senior III

You can try flashing with CubeIde.

Same issue with STM32CubeIDE.

Hello @Ankitesh,

Has the board been modified around SWD signal path?
Refer to the STM32CubeProgrammer user manual and try using Connect under reset mode.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA

1. Has the board been modified around SWD signal path?

Ans: No


2. Refer to the STM32CubeProgrammer user manual and try using Connect under reset mode.

Ans: I've used this method but not working. I've used different combinations of "Mode" as well as "Reset Mode" as shown below in attached pic with different frequency, But still I'm getting same error?

Ankitesh_3-1771305714010.pngAnkitesh_4-1771305738165.png

Ankitesh_5-1771305809434.pngAnkitesh_6-1771305854313.pngAnkitesh_7-1771305886854.png

 

 

 

This same issue occurs around 4 months ago, but that time somehow "FAIL.TXT" file removed from MCU, then the STM32CubeIDE as well as STM32CubeProgrammer starts connecting with MCU.

This same issue occurs this time, but now considering previous situation, it is clear that we have to remove that "FAIL.TXT" file.

Note: This is my understanding right now, If I'm not doing right approach then Please tell me. 

Hello @Ankitesh,

Did you try using another PC, USB cable, or B-G431B-ESC1 board?
Did you verify the SWD and clock signals on J4 of the B-G431B-ESC1 board?

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA
Bisharat
Associate II

This usually happens when the ST-LINK can’t reset or halt the MCU after a failed flash/debug attempt — the File.txt is just a log, not the actual problem.

Try this:

  • In STM32CubeProgrammer, select “Connect Under Reset”

  • Lower the SWD frequency (e.g., 100 kHz)

  • Fully power cycle the board and try again

  • Also check for ST-LINK firmware updates

In most cases, connecting under reset with a lower SWD speed fixes it.

1. Did you try using another PC, USB cable, or B-G431B-ESC1 board? - Yes, but same result.

2. Did you verify the SWD and clock signals on J4 of the B-G431B-ESC1 board? - Yes, but same result.