[SOLVED] ESP-14 and stm8

Arduino on the STM8 (8 bit processor)
Post Reply
Andrea
Posts: 4
Joined: Wed Sep 12, 2018 7:52 pm

[SOLVED] ESP-14 and stm8

Post by Andrea » Thu Sep 13, 2018 8:43 am

Hi,
I'm trying to use the stm8 inside the wifi module ESP-14, but I've some problem with the st link v2 (I'm using the ST Visual Programmer). The chip is connected in this way:

M_VDD -> 3.3v
M_VCAP -> 1uF to gnd also tried with 470nF
M_SWIM -> swim pin on the st link
M_NRST -> reset pin on the st link

When I try to program the stm8 I receive this error:

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.

Error : < PROGRAM MEMORY reading failed.
Error : < Operation aborted.

I tried to connect the M_NRST pin to ground and try to erase the chip using st link utility, but without success. Has anyone already had this problem? how can I solve it?

Andrea

flyboy74
Posts: 231
Joined: Wed Jun 13, 2018 11:02 am

Re: ESP-14 and stm8

Post by flyboy74 » Thu Sep 13, 2018 10:30 am

I have discovered a problem with the cheap st-links like this https://www.aliexpress.com/item/1PCS-ST ... autifyAB=0. Although it has a reset pin it isn't connected to anything. I have been using system workbench and I had to select software reset before it would program the MCU. I now have a better st-link and no longer have to do that has the hardware reset pin works this 1 https://www.aliexpress.com/item/Free-Sh ... autifyAB=0.

Andrea
Posts: 4
Joined: Wed Sep 12, 2018 7:52 pm

Re: ESP-14 and stm8

Post by Andrea » Thu Sep 13, 2018 11:21 am

I have tested the reset pin and it's working, I also tried with a genuine version of the st link v2 and I receive the same error.

User avatar
RogerClark
Posts: 8416
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: ESP-14 and stm8

Post by RogerClark » Thu Sep 13, 2018 9:15 pm

Andrea wrote:
Thu Sep 13, 2018 11:21 am
I have tested the reset pin and it's working, I also tried with a genuine version of the st link v2 and I receive the same error.
I read something on Hackaday, a few days ago, which said that STM8 can be write protected, so that once they have been programmed, they can’t be changed.

If this is true, then potentially the same is true for the STM8 in your device.

However, i have not verified if the information on Hackaday ( about a variable wattage load) was correct.

User avatar
zoomx
Posts: 835
Joined: Mon Apr 27, 2015 2:28 pm
Location: Mt.Etna, Italy

Re: ESP-14 and stm8

Post by zoomx » Fri Sep 14, 2018 6:59 am

Maybe it is an One Time Program version, I believe that they are cheaper than the others version that are reprogrammable.

User avatar
RogerClark
Posts: 8416
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: ESP-14 and stm8

Post by RogerClark » Fri Sep 14, 2018 1:23 pm

zoomx wrote:
Fri Sep 14, 2018 6:59 am
Maybe it is an One Time Program version, I believe that they are cheaper than the others version that are reprogrammable.
Ah. That’s a pain.

It probably means a lot of the modules that use STM8’s may not be modifiable :-(

MarkB
Posts: 23
Joined: Sun Oct 02, 2016 11:40 pm

Re: ESP-14 and stm8

Post by MarkB » Fri Sep 14, 2018 7:46 pm

STM8S has a read/write protect "fuse" that is enabled on some devices, but there is a procedure for reflashing the device back to factory defaults, that is erase everything including the protection fuse.

It's documented part way down on the following link using a binary from the STM8 eforth package here: https://github.com/TG9541/stm8ef/wiki/STM8S-Programming

Or without using the binary from that package as per this thread: https://github.com/vdudouyt/stm8flash/issues/38

There is not a one time programmable STM8, to my knowledge, but some of the cheap Chinese boards that came with STM8S003 have been showing up with a pin-compatible Nuvoton N76E003AT20 processor which is a 8051 architecture device, hence not software compatible, as the manufacturers strive to shave another penny or two off the BOM. I don't know whether or not this might be the case with the ESP-14. https://direct.nuvoton.com/en/n76e003at20

Andrea
Posts: 4
Joined: Wed Sep 12, 2018 7:52 pm

Re: ESP-14 and stm8

Post by Andrea » Sat Sep 15, 2018 8:10 pm

thanks for the tips, I managed to solve. The problem is the module, the pin references are not written correctly :roll: and then I connected the wrong pin.

Post Reply