Skip to main content
Visitor II
March 30, 2021
Question

Unable to Program STM8 using STVD Light Programmer or STVP

  • March 30, 2021
  • 2 replies
  • 3288 views

Hello Everyone,

I am using a STM8S105C6T6 in one of my application and I am facing problem while programming it.

Software used: STVD version 4.3.12

Compiler: Cosmic CXSTM8 Special Edition 4.5.1 (Free 1yr License version)

I have build my application and when I click on ''start Debug'' in STVD, below error comes

Debug Seesion:

Starting debug session...

 -> Emulator reset (usb://usb)...

 done.

Opening application C:\Users\Micro\Desktop\STM8\STM8S105\led\Debug\led.elf...

 -> failed to download application: error: swim prog error [42004]: memory write error

Application closed.

Debug session closed.

0693W000008yErVQAU.png 

2. When I am Trying to Program using STVD in-built Programmer, it is showing below error:

''STVD > Tools > Programmer'' or using STVP.

Programming...

PROGRAM MEMORY:

> Blank Check not feasible

> Programming

Error : Programming failed

Error : Problem while trying to Reset swim and device. Apply a Power On Reset

0693W000008yErfQAE.png 

The interesting thing is, sometimes the MCU is getting programmed (LEDs are blinking as per requirement) but the software is showing same error message as above.

I don't understand why I am getting this error. My hardware connection and the SWIM communication are OK because I am able to program my other MCU i.e. STM8103F3P6 bare minimum board using same settings in STVD

How can I solve this error ?

Thanks in advance.

    This topic has been closed for replies.

    2 replies

    Visitor II
    April 5, 2021

    I am also facing the same issue.

    Please check this : https://community.st.com/s/question/0D53W00000gfqjeSAA/stm8s005k6-swim-prog-error-42004-memory-write-error

    Did you managed to solve it ?

    Visitor II
    April 7, 2021

    Is there anything that might disturb the NRST function? Such as a large capacitor or a pull-up resistor? Also, as suggested in the other post, is there a suitable capacitor on the VCAP pin? Is the power stable? Do the powerline(s) have good decoupling capacitors?

    Visitor II
    April 7, 2021

    VCAP is having 1uF capacitor. I tried with laptop power supply via the programmer, also tried by giving separate power to the chip. Both having similar results.

    Everything was working good, and I programmed few times without any issues. Suddenly it stopped working. I even tried using a different hardware, same results.

    But working fine if I try with a different chip.

    Visitor II
    April 7, 2021

    And nothing strange on the NRST line? Well, then it looks like you need a new microcontroller....