2021-03-29 10:52 PM
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.
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
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.
2021-04-04 08:35 PM
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 ?
2021-04-07 12:16 AM
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?
2021-04-07 07:31 AM
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.
2021-04-07 12:36 PM
And nothing strange on the NRST line? Well, then it looks like you need a new microcontroller....
2021-04-07 07:41 PM
I have a 10K pull up and 0.1uF capacitor a NRST line. Will it cause any issues ?
Everything was working fine and I have programmed it atleast 15 times without any issues. It stopped working suddenly. Then I tried in another clone of the same target board. That also showed the same issues. This makes me think that it is not a microcontroller related issue.
My STLINK is working fine, I tested it in a different board which using another STM8 chip.
2021-04-07 08:24 PM
And more over, Option Bytes and Data Memory write is working fine. Program memory read is working fine but write is failing.
2021-04-07 11:06 PM
What I would do is, first remove (if possible) the 0.1uF capacitor and try again. And second, take a look at the signals on the lines from the STLink with an oscilloscope, both with devices that work and the one that doesn't. If they all look exactly the same and the microcontroller still didn't work, I would probably hang it on my "wall of shame" next to the other devices I murdered.
2021-04-08 12:15 AM
OK, Thanks for your suggestions. I will try by removing 0.1uF in the NRST line.
Currently I am using a 1uF electrolytic capacitor for Vcap, I think I should try with a ceramic capacitor.