cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging Nucleo-F401RE with st-link

VZerb.1
Associate II

I am trying to debug a a nucleo-F401RE with the st-link. About a week ago, it was fine and the code uploaded. I had made it so that the LED on the F401RE turned on and off when I pushed down and released the push button. I came back to it yesterday to work on more after I got parts to do other stuff.

I simply tried to reupload the code to turn the LED on and off with the pushbutton again, but it failed and I began getting many errors. Some about trying to join a joined drive, and this one below. I searched all over and could not find a solution. I upgraded CubeIDE to 1.5 but that didn't help. I tried to delete everything and redownload both versions of cubeIDE again. Now I am just getting this error:

Error in final launch sequence:

Failed to execute MI command:

target remote localhost:61234

Error message from debugger back end:

Remote communication error. Target disconnected.: Success.

Failed to execute MI command:

target remote localhost:61234

Error message from debugger back end:

Remote communication error. Target disconnected.: Success.

Remote communication error. Target disconnected.: Success.

Please let me know what to try next. Sorry if I haven't provided enough info. Please let me know if I should provide any other details. I am new to this.

11 REPLIES 11

Check if you can connect using STM32 Cube Programmer, without involving CubeIDE or GDB Server

If you can connect, try erasing the firmware on the board.

See if you can "Connect under Reset"

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
VZerb.1
Associate II

When I try to connect with STM32 Cube Programmer, it gives me this error:

Error: ST-LINK error (DEV_TARGET_HELD_UNDER_RESET)

Do you mean try to "connect under reset" in the programmer or in CubeIDE. When I tried to connect under reset in cubeIDE it gave me a similar "target held under reset" error.

VZerb.1
Associate II

After changing the settings, I have found that it will connect in hot plug mode in both Cube Programmer and ST Link Utility. I do not know if this helps anything though.

VZerb.1
Associate II

When I try to do a mass erase in Cube Programmer, it gives me this error:

Error: Mass erase operation failed.Please verify flash protection

VZerb.1
Associate II

When I try to "erase chip" in ST Link Utility, it gives me this error and message:

19:49:00 : Internal command error

19:49:04 : Read out protection is activated

LaurentL
ST Employee

So maybe you have activated Read out Protection in option bytes.

Try to reprogram option bytes to remove read out protection on STM32CubeProgrammer.

Rgds,

Laurent

VZerb.1
Associate II

I removed read out protection and I still can't do anything else. When I try to do a full chip erase it gives me this error:

 10:55:16 : Starting Automatic Mode...

 10:55:16 : Waiting for device n:1...

 10:55:16 : MASS ERASE ... 

 10:55:18 : Mass erase operation failed.Please verify flash protection

 10:55:18 : Please disconnect device n:1 and connect the next...

I cannot find where to "verify flash protection"

VZerb.1
Associate II

@LaurentL​ 

LaurentL
ST Employee

Are you up to date on CubeProgrammer version ?

v2.6.0 is the latest.

If you connect and read option bytes, what is the read out protection state ? and write protections ?

Then, set write protections off when you remove also the read out protection if set.

Then, you can use the eraser button on the bottom left to do a mass erase.

After that, you might use the automatic mode but you need to set the device in a workable state first.

Then, to use CubeIde, don't forget to disconnect on CubeProgrammer (or exit CubeProgrammer).

I think I remember there was this read out protection issue on some F4 a long time ago, I don't remember if the issue was on VCAP capacitors.

Check them and check that VCAP voltage are ok (1.35 V I think).

Check also all GND, VDD and VDDA pins if any. Also the BOOT pins.

Well, on a Nucleo board, this should be ok, I thought it was a self made board.

Rgds,

Laurent