Not able to Debug STM8s001J3 with STVD and STVP using STLinkv2 Debugger

2.3k Views Asked by At

As the STM8S001J3 MCU has no Reset pin, How do I connect the MCU with ST Link v2 using SWIM pin for debugging?

STLink V2 : STM8s001j3

VDD : VDD

GND : GND

SWIM : SWIM

RESET : ?

I have left the STLink V2's reset pin free, but not able to enter debug mode in STVD and STVP.

I am getting below Error:


STVP:

Cannot communicate with the device !

Check the SWIM cable connection and check all the needed pin connections on the SWIM connector.

If the application code uses Swim Disable and Reset pin as Output or has disabled SWIM Clock Divider:

Try Now to SWITCH OFF and ON the application Power Supply while NRST Reset pin is forced low.

OK

1

There are 1 best solutions below

0
On

See section 4.4 of the datasheet:

Only the “connect on-the-fly” method can be used to program the device through the SWIM interface. The “connect under-reset” method cannot be used because the NRST pin is not available on this device.

If anything is causing the MCU to frequently reset, this can be difficult, "therefore it is recommended that device is never erased and that is contains always a valid code loop". If you need to use the SWIM pin for I/O, implement a startup delay before switching functionality.

In general, it might be easier to develop and debug on STM8S003 or STM8S103 devices; the STM8S001 is supposed to have the exact same die, just in a different package.