AnsweredAssumed Answered

Debug works but Program does not work

Question asked by StephB on Jul 26, 2013
Latest reply on Jul 30, 2013 by StephB
Hello everybody,

I am using a STM8S207R8T6 and I have a problem when trying to program it.
I have build my application and click on "start Debug" in STVD.
There were a previous firmware with ROP enabled, so I choose to disable it and erase flash memory.
I managed to start the application but the PC is not automatically set at the beginning of the main function, it is set to 0x3f and I don't know why. If I change manually the PC my application is then running.
Until here, it is almost ok.

The problem is when I want to program my MCU either using the "STVD > Tools > Programmer" or using STVP.
I always get the same error message : 
> Programming
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.

I don't understand why I get this error. My hardware connection and the SWIM communication are OK because they work in Debug mode !!!
How can I solve this error ?

Thanks in advance.