ST-LINK V2, DEV_TARGET_CMD_ERR, SWD does not work properly
Hello,
I have a custom STM32 board which has basically only the needed components to flash and use an STM32F103RET6 on board. This means, there are only a few capacitors for voltage stability, an 8MHz quarz + circuitry, and a few connectors on it.
I have the SWDIO, SWCLK and NRST lines connected through a 100 Ohms resistor exposed so a connector, so I can use them to program the device.
Now the problem ist, that I cannot connect to the device via STM32CubeProgrammer, nor the CLI, nor my IDE of choice (Keil uVision).
When I use my ST-LINK V2, connect it to the board and my pc, and then press "connect" in the program, I get the error "DEV_TARGET_CMD_ERR".
There is literally no explanation of this error anywhere, other than "hardware issues".
I then proceeded to try out the CLI and it didnt work either. My Keil uVision just throws the error "Internal Command Error".
So I set up a logic analyzer and found out, that the device is actually communicating with my ST-LINK.
It is basically doing this:
- Line Reset
- Read IDCODE (successfully)
- Wants to write to CTRL/STAT (gets ACK WAIT as response)
- Line Reset
- Repeat 1-4 ca. 100 times
- Read IDCODE
- Read from CTRL/STAT (successfully, response: 0xF0000000)
- Somehow stops doing anything and throws the error mentioned above.
My BOOT0 pin is floating, if that is of interest.
I have no idea how to proceed from here. I cant even connect to the device, however, the device is clearly communicating with the chip.
I checked a chip of my batch on a Evalboard (Nucleo), and it promptly connected and read the memory. So the chips are not defect.
Do I have to remove any write protection or something which the debug interface does automatically on the Nucleo-Board, or why cant I use my chip at all?
Thank you very much in advance!
Attachment:
The analysis of the SWD communication.
Schematics:
