SOLVED - Debugging custom board through ST Link 2 using SWD interface. Fail in launch sequence
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-26 5:06 AM
I am using v 1.5 of STM32CubeIDE, and an ST link v2 running firmware V2J37S7.
I have chosen the CPU that I have on my custom board (STM32F410R8T6), configured my periphials and written some code. However, I face an issue when trying to debug the program, or run it on the hardware. When I click the debug button, the debug viewer appears shortly, where i can press run and terminate, before it snaps out of it, and shows this error:
The console outputs the following:
I have messed around with my debug configuration settings. They can be seen here:
My connections from ST link to MCU are:
St link -> Stm32
Pin 1 (MCU VDD) -> VCC (3.3 V)
Pin 7(SWDIO) -> PA13
Pin 9 (SWCLK) ->PA14
Pin 10 (GND) -> (Common GND)
Pin 15(NRST) -> NRST
Listening on onboard testpoints with oscilloscope shows 3.3 V on pin 1 and 7, and 0 V on Pins 9, 10 and 15. When i press debug i can see the datastream on SWDIO and SWCLK. Nothing appears on NRST.
The LED on the ST link shines red when connected to the board. When i press debug it blinks red/green and pauses at green for some time, before going back to red, and the error message pops up. A GDB server logfile is outputted, that can be seen below:
Solved! Go to Solution.
- Labels:
-
ST-Link
-
STM32CubeIDE
-
STM32F4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-26 6:07 AM
Q1 gate is floating, hmm...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-26 5:07 AM
tr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-26 5:09 AM
There is no text/image after the ":" visible...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-26 5:12 AM
Yep, my apologies. I have inserted them properly now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-26 5:19 AM
Do other, less cumbersome, tools connect?​ ie like STM32 Cube Programmer
​
D​o you have code reconfiguring GPIOA, PA13 or PA14, or have the core entering low power modes or WFI loops?
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-26 5:30 AM
You can try switching to the other debugger (OpenOCD) in dropdown list.
> Nothing appears on NRST.
Thats because you set Reset behaviour = none. You might change that and check NRST.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-26 5:31 AM
Pin are setup as shown above. At no point in the code do i use PA13 or 14, except for the autogenerated stuff, which i presume sets up the SWD interface. I don't make it enter low power mode, and haven't heard of WFI loops. I have it enter multiple interrupt rutines triggered by both spi and external pins though, but i don't think that should matter. I'll try STM32 Cube Programmer at once!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-26 5:35 AM
KnarfB is right, you must try with "connect under reset" mode to have no issue with appli running and possibly changing SWD pins...
We see the PC value which has a weird value.
Rgds,
Laurent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-26 5:40 AM
You can also try to connect to the board using STM32CubeProgrammer and see if this works.
If it works you can try to erase the flash with CubeProgrammer.
When using ST-LINK gdbserver it is also possible that you need to reduce the ST-LINK clock frequency if there is a problem using to high frequency due to hw.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-26 5:42 AM
I tried changing reset behavior to connect under reset. I still see no information (0 V) on the nrst testpoint, but I receive a different error now: And console now reads:
