I was able to erase it successfully using the utility suggested.
When I tried to build without debugging, it successfully compiled,
Good, this means two things:
- The target HW is working
- The toolchain is installed correctly
An additional test can be to flash the generated hex or bin file with the ST-Link utility.
From the first log you posted, it would appear that also the communication between gdb and OpenOCD (the bit of SWtaking care of communicating with the target HW) is correctly working, and that OpenOCD manages to contact the board.
There's one strange thing, though:
stm32f4x.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 00000000 pc: 0x0f00f1b8 msp: 0x8000f8d0
adapter speed: 8000 kHz
OK8000kHz is very high.
None of my boards uses that speed, did you perchance change it manually in the VGDB debugging setup?
You could try to lower it to 1800kHz, or to the speed the ST-Link utility uses when connecting to the target.
After a week of trying, I just gave up. I wish I'd tried the trial version first before forking over $89 for the Embedded Edition. I went back to my old standards: Eclipse and Segger Embedded Studio (AKA Rowley CrossWorks).
This is the exact opposite of my experience: VS + VGDB was more or less the only IDE/toolchain I had immediately working "out of the box".
Even ST's own Software Workbench took some fiddling before being fully operational (debug TCP port conflicts).
Let's forget about TI's abomination.
I used the trial for a couple of weeks and then paid for the Embedded+Linux version, and don't regret at all the money I spent.
I use VisualGDB almost every day, mostly with STM32(F/L)nnn and a bit with EP8266, and I find no problems whatsoever.
Single stepping is fast and reliable, as is flashing.
The only issue (documented) I had is deadly slow debugging/flash on MSP432 with CMSIS-DAP, but that's TI making, not VisualGDB or OpenOCD.
If I use a "J-linkified" ST-Link with it, it goes without a hitch (but that's not allowed by the J-Link license).