STM32CubeIde Unable to debug - Page 1
Forum section: electronics / general

author: failsafinho
author_rank: Newbie
timestamp: September 27, 2020, 03:21:40 pm
content: Hi all,I have a board known as blue pill based on the STM32F103C8T6 microcontroller and also a st-link V2 chinese clone. When I am trying to debug on the software mentioned, I am able to program the board and then it disconnects and I am unable to debug any. When setting up the device, in system I used "serial wire" in the debug option. The debugger is fully being detected and as mentioned is able to program the micro with no issues at all, but after programming, it just disconnects.Things I tried: changing the probe to OPENOCD in the debugger settings, completely erasing the micro with the STM32Programmer, reduced the frequency of the debugger, all the reset options available with no luck.Any ideas of how to fix it? Thanks in advance

author: Ario
author_rank: Regular Contributor
timestamp: September 28, 2020, 01:38:19 pm
content: Hi,Are you running Mac? I did some quick googling and found the following, thread:https://community.st.com/s/question/0D50X0000BVnlm0/debugger-not-working-after-upgrade-to-stm32cubeide-110

author: failsafinho
author_rank: Newbie
timestamp: September 28, 2020, 03:51:29 pm
content: Hi and thank you for your response,no, I am working on Windows, what it is weird is that I am able to halt the micro and step in st link utility.I tried more things, completely empty project, just with the debug enabled by serial, connecting a reset line to the debugger, downgrading the firmware version with the st link utility (and then cube ide complained asking for an upgrade again, but same result). It is very weird.

author: MosherIV
author_rank: Super Contributor
timestamp: September 28, 2020, 05:38:26 pm
content: This usually happens if you have configured the pins used for the debugger.Check the schematics and make sure the pins used for the debugger are not configured for your use.I have not used stmcube so I do not know if there is pin/port config option for debugger

author: failsafinho
author_rank: Newbie
timestamp: September 28, 2020, 05:45:30 pm
content: No I didn´t, have a look to the third picture on the first post, pins are set up right when I selected the option to tell the software I would like to use the debugger. Pins PA13 as SWDIO and pin PA14 as SWCLK. It is very strange, but I will eventually make it work. In a few moments I will start with a completely blank project and erase the full memory of the micro and see what happens.Thanks!

author: MosherIV
author_rank: Super Contributor
timestamp: September 28, 2020, 05:50:04 pm
content: Another reason for disconnect is that there is something wrong during the boot up and the processor is reset. The debugger can then not talk to the processor.Try a simple led blinky to see if the program boots ok.

author: failsafinho
author_rank: Newbie
timestamp: September 28, 2020, 05:59:16 pm
content: That´s is very interesting, I will have a look into that also, thanks!

author: failsafinho
author_rank: Newbie
timestamp: September 28, 2020, 06:52:48 pm
content: With a completely empty project I am able to debug it. So now I am really sure there is something fishy on my code that is not allowing it to debug, I will find it.Thank you very much all for your help, at least now I know there is something on my code!