Se você estiver tendo esse erro ao gravar um stm8 com o st-link v2:
Error : 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.
A solução e o VCAP, olhe o datasheet do seu ci e procure pelo valor recomendado.
Tive esse problema depois de colocar o valor recomendado de 470nf o programa reconheceu e gravou.










