I'm able to upload and debug, but connecting with a viewer doesn't work.
Here's the output of the J-Link Commander V7.00. I've also tried 1000 kHz with the same result.
SEGGER J-Link Commander V7. 0 (Compiled Apr 8 2021 14:31:32)
DLL version V7.00, compiled Apr 8 2021 14:30:05
Connecting to J-Link via USB...O.K.
Firmware: J-Link STLink V2 compiled Aug 12 2019 10:28:03
Hardware version: V1.00
S/N: 778399013
VTref=3.300V
Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: STM32F407VG
Type '?' for selection dialog
Device>
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>S
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>
Device "STM32F407VG" selected.
Connecting to target via SWD
InitTarget() start
ERROR: Unknown DEV_ID found: 0x00000411
Failed to unlock device.
Can not attach to CPU. Trying connect under reset.
ERROR: Unknown DEV_ID found: 0x00000411
Failed to unlock device.
Connecting to CPU via connect under reset failed.
InitTarget() end
InitTarget() start
ERROR: Unknown DEV_ID found: 0x00000411
Failed to unlock device.
Can not attach to CPU. Trying connect under reset.
ERROR: Unknown DEV_ID found: 0x00000411
Failed to unlock device.
Connecting to CPU via connect under reset failed.
InitTarget() end
InitTarget() start
ERROR: Unknown DEV_ID found: 0x00000411
Failed to unlock device.
Can not attach to CPU. Trying connect under reset.
ERROR: Unknown DEV_ID found: 0x00000411
Failed to unlock device.
Connecting to CPU via connect under reset failed.
InitTarget() end
InitTarget() start
ERROR: Unknown DEV_ID found: 0x00000411
Failed to unlock device.
Can not attach to CPU. Trying connect under reset.
ERROR: Unknown DEV_ID found: 0x00000411
Failed to unlock device.
Connecting to CPU via connect under reset failed.
InitTarget() end
Cannot connect to target.
Here's the output of the J-Link Commander V7.00. I've also tried 1000 kHz with the same result.
SEGGER J-Link Commander V7. 0 (Compiled Apr 8 2021 14:31:32)
DLL version V7.00, compiled Apr 8 2021 14:30:05
Connecting to J-Link via USB...O.K.
Firmware: J-Link STLink V2 compiled Aug 12 2019 10:28:03
Hardware version: V1.00
S/N: 778399013
VTref=3.300V
Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: STM32F407VG
Type '?' for selection dialog
Device>
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>S
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>
Device "STM32F407VG" selected.
Connecting to target via SWD
InitTarget() start
ERROR: Unknown DEV_ID found: 0x00000411
Failed to unlock device.
Can not attach to CPU. Trying connect under reset.
ERROR: Unknown DEV_ID found: 0x00000411
Failed to unlock device.
Connecting to CPU via connect under reset failed.
InitTarget() end
InitTarget() start
ERROR: Unknown DEV_ID found: 0x00000411
Failed to unlock device.
Can not attach to CPU. Trying connect under reset.
ERROR: Unknown DEV_ID found: 0x00000411
Failed to unlock device.
Connecting to CPU via connect under reset failed.
InitTarget() end
InitTarget() start
ERROR: Unknown DEV_ID found: 0x00000411
Failed to unlock device.
Can not attach to CPU. Trying connect under reset.
ERROR: Unknown DEV_ID found: 0x00000411
Failed to unlock device.
Connecting to CPU via connect under reset failed.
InitTarget() end
InitTarget() start
ERROR: Unknown DEV_ID found: 0x00000411
Failed to unlock device.
Can not attach to CPU. Trying connect under reset.
ERROR: Unknown DEV_ID found: 0x00000411
Failed to unlock device.
Connecting to CPU via connect under reset failed.
InitTarget() end
Cannot connect to target.