Skip to main content
Visitor II
July 26, 2013
Question

Debug works but Program does not work

  • July 26, 2013
  • 2 replies
  • 1567 views
Posted on July 26, 2013 at 11:22

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...

OPTION BYTE:

> 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.

#stvd #st-link #stvp
    This topic has been closed for replies.

    2 replies

    contactAuthor
    Visitor II
    July 30, 2013
    Posted on July 30, 2013 at 10:21

    Hi all,

    I have found the error.

    The value of the pull-up resistor of the RESET pin was really too low (50Ohm).

    Then the RESET pin was always at HIGH level.

    This explain why program does not work and debug only partially works with some ''memory write error'' or ''connection time out''.

    Visitor II
    November 14, 2018

    How about STM8s001j3 MCU which doesnot have Nrst pin?

    Not able enter debug mode, STVD crashes when debug button is pressed. :(