Hi all, I bought st-link\v2, but I can't connect to stm8, to stm32 on jtag it connect without problem.
Same device on stm8 perfect connect by stm8l152C6T6_discovery_board.
What do I do wrong?
ST-LINK/V2 is a programming/debugging tool for two MCUs families: STM32 and STM8. Both of them use different interface (STM32: JTAG or SWD; STM8: SWIM) and as a result ST-LINK/V2 provides two connectors, one for each family.
To use ST-LINK/V2 with STM8 you need to use 4-pin connector named STM8. These four pins are: VDD, GND, SWIM and Reset. If you connect these pins (at least VDD, GND and SWIM, because Reset is optional) to relevant STM8 pins, then you are ready to debug and program the MCU. Please find below a photo showing ST-Link/V2 connected with STM8L052:
If you want to use ST-LINK/V2 with STM8 Discovery kit, then first you need to connect ST-LINK/V2 pins to MCU pins and second you need to disconnect ST-LINK embedded on Discovery kit by opening jumpers on CN3. Please find below a photo showing this:
Yess!! Working. I all did the right, but I did not know one nuance, my ST-LINK don't powered my device.You helped find error in st-link.And now new question: How I can powered programmed my target device via ST-Link\V2?
I am glad that you solved the issue.
Indeed SWIM connector can't supply the MCU. This connector provides a VDD pin, but its purpose is not to supply the MCU, only to verify if MCU is already supplied.
Typically MCU should be supplied from its own supply source, not from ST-LINK. However I believe that you can use ST-LINK for this purpose. Based on UM1075 it looks that second connnector (JTAG/SWD connector for STM32) provides both 3.3V and GND (pins 19 and 20).
Retrieving data ...