SWD (you can use JTAG if you connect the rest of the pins)
4.0 MHz (though slower speeds will work too)
Access Port 0
Hot Plug mode
Software System Reset reset mode
From the log into looks like you do, except may be software system reset. Makes sure that’s selected.
Also make sure you connect pin 1 on the ST-LINK (VCC) to 3V3 on an actual ST-LINK/V2 device. It’s a voltage sense pin, not a power pin, and if you don’t connect it programming will fail.
If you have a voltmeter, check the voltage of the 3V3 pin. If the voltage regulator has failed, and it’s actually 1.3V, then then would explain why you’re in Dim D7 and also why you can’t program it.
I solved this issue by myself.
The problem was not connecting Target VCC (Pin1 of ST-LINK) to 3.3v from the board.
I should have connected the TVCC pin as below.