cancel
Showing results for 
Search instead for 
Did you mean: 

STLINK V2 not talking to an STM8TL52F4P6 chip

Ted Jackson
Senior

Hi. I just bought an STLINK/V2 dongle, trying to install and debug an example project (SimpleLEDBlinkExample) on an STM8 MCU via its SWIM pin, working within the IAR Embedded Workbench. For the dongle, I installed the recommended USB driver and the current STLINK firmware upgrade. I plugged the dongle up to a USB port and its COM LED is on. In Windows Device Manager under 'Universal Serial Bus devices', the dongle shows up as 'STM32 STLink' and appears to be installed properly. First thing I notice is that the dongle's VDD pin has no voltage. 

Shouldn't it be putting out 3.3V (or perhaps the USB's 5V)? Attempting to execute Project>Download and Debug throws an error, but I assume I need to understand why there's no voltage from the dongle first.  What have I missed? Any suggestions? Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

I meant stm8flash from https://github.com/vdudouyt/stm8flash

The FLASHER-STM8 is something quite different: A tool to use a serial line and the integrated bootloader some STM8 devices have. FLASHER-STM8 thus does not use an STLINK/V2.

View solution in original post

9 REPLIES 9
Philipp Krause
Senior II

Does it work for you if you use different software, such as stm8flash instead of IAR?

Ted Jackson
Senior

h

Philipp Krause
Senior II

There shouldn't be much hardware required: For lots of simple boards (http://www.colecovision.eu/stm8/), I just used the STLINK/V2 and it works for me.

See e.g. http://www.colecovision.eu/stm8/STM8%20Min%20Sys%20Dev%20LED.shtml

Though I have not yet used an STM8TL.

Hi Philipp. I'm frankly unfamiliar with STM8FLASH, although I will look into it ASAP, since you mention it. But I AM trying the ST Visual Programmer (STVP) with the COSMIC compiler and have not yet had a breakthrough with that either. I'll reply as soon as I succeed in getting ANYTHING to actually communicate with the chip.

Speaking of, I perhaps foolishly bought only a naked STM8TL52F4P6 chip and thought to wire the chip to the STLINK/V2 myself without the benefit of a Discovery, Eval or Nucleo host board, having included only the recommended capacitors between the chip's VDD, VSS and PXS_VREG pins, and routing the VLINK's VDD and GND pins (Pins 1 and 3) to the chip's VDD and VSS pins (Pins 7 and 8), DATA pin (Pin 2) to the chip's BEEP/SWIM/(HS)PA0 pin (Pin 2), and its RESET pin (Pin 4) to the chip's NRST/(HS)PA5 pin (Pin 10). I have yet to encounter a technical document specifically illustrating the electronic interface between the VLINK and the chip that is presumably included upon those mentioned host boards. Proprietary? Perhaps more is necessary to a bare-bones setup for the chip than I've so far realized.

But the fact remains that the VLINK module is not showing any non-zero voltage on any of its 4 pins supplying its 4-pin SWIM ribbon cable, when the dongle is plugged into the USB, shows as evidently running and installed properly in Windows' Device Manager, and after the recommended VLINK firmware upgrades evidently installed without a hitch. So, I think the problem is prior to my actual wiring to the chip.

I'm now studying the IAR and STVP documentation to see what is needed to start talking to the chip. In IAR, I just assumed that Project>Download and Debug of the simple example project would be sufficient to get started. Evidently not. I've so far been only a relative babe in the woods, working only with very friendly Arduino Bees. Gotta grow up some time. Lol. Thanks for your reply.

Philipp, is what you're suggesting the same as this:

https://www.st.com/en/development-tools/flasher-stm8.html

I ask, because I'm reluctant to build from source and the only references I can find to STM8FLASH are at GITHUB. Thanks

I meant stm8flash from https://github.com/vdudouyt/stm8flash

The FLASHER-STM8 is something quite different: A tool to use a serial line and the integrated bootloader some STM8 devices have. FLASHER-STM8 thus does not use an STLINK/V2.

I downloaded stm8flash from the github link you provided. I'm slowly getting it compiled. You wouldn't happen to have your gcc command line still would you? Got 'libusb-1.0' pinned down. Still looking for 'stm8_devices', 'stlink_open' and other references. Thanks.

I use stm8flash on Debian GNU/Linux; to compile I just use the Makefile that comes with it; it works fine for me, and AFAIK also works on other systems. For what platform are you trying to compile stm8flash?

I finally got the STVP IDE working with a simple I/O bit toggling program. One of the things that was NOT obvious was the fact that the STLINK/V2 does NOT supply power to the chip through its 4 wire ribbon cable (VDD pin/wire) , the dongle made by ST that is, but not necessarily all clones of STLINK, which I'm told might WELL supply VDD via the USB's 5V. Never did get STM8FLASH quite working though (on Windows). When I get a chance, I'll try building it from the Makefile. Thanks for your help Philipp.