Allright, got SWD working too now.
I made a small custom shield, that only connects the SWD pins.
The connections are:
Pin ST-LINK V2 cable Spark Core
1,2 VDD 3.3V
4,6,8,10,12,14,16* GND GND
7 TMS_SWDIO D7
9 TCK_SWCLK D6
15 NRST RESET
* One is enough, but more is preferred according to ST-Link V2 datasheet
Here is my little board:
I sent in a pull request to enable SWD without enabling JTAG:
st-util finds the spark via SWD and debugging in Netbeans works great. As described above, I upload the elf file via the run button, then attach the debugger and step debug.
I am able to stop on breakpoints, step through code, step into functions, step out of functions, etc.
I cannot reset the core via Netbeans or pause it when it is running freely, so I will have to make sure I hit a breakpoint and can then step debug or let it run freely from break point to break point.
I can now debug my TFT display, which is connected to a few pins that are also JTAG pins. When step debugging, I can let the text appear on screen line by line.