STM32 debugging issue

4.2k Views Asked by At

I am using a Nucleo F303RE board. And whenever I try to debug in STM32cubemxIDE. It always shows an error for failed to start GDB error. I have attached the screenshot

I have updated the ST-Link firmware and also checked my device manager.

I have also tried disabling my windows defender.

I have also tried to change the frequency, interface, auto-connect under Debug Configuration.

Would be great if someone could help me out. I am stuck with an important demo at work.

I also tried it on Atollic TrueStudio but still no luck.enter image description here

Thanks

enter image description here

Detailed error on Atollic TrueStudio: STMicroelectronics ST-LINK GDB server. Version 5.1.0 Copyright (c) 2018, STMicroelectronics. All rights reserved.

Starting server with the following options: Persistent Mode : Disabled Logging Level : 1 Listen Port Number : 61234 Status Refresh Delay : 15s Verbose Mode : Disabled SWD Debug : Enabled

Target no device found

Error in initializing ST-LINK device. Reason: No device found on target.

1

There are 1 best solutions below

1
On

The reason is: No device found on target. This Means the debugger is working but it can't connect to the microcontroller.

The problem may be one of these:

  • The connection between the debugger and the controller. Check them first.

  • The serial wire debugger is disabled (I strongly think that this is the problem). when you create a new project in CubeMX or CubeIDE the serial wire debugger by default is disabled (I expect that you burn the code for only one time :) ). So you MUST erase the flash using stlink utility or such a tool. And enable the serial wire debugger from the CubeMX in category SYS.