cancel
Showing results for 
Search instead for 
Did you mean: 

STM8S001J3: Unable to communicate with the device

samruddhi_daithankar
Associate II

I am trying to program the STM8S001J3 microcontroller, on a custom board. I am using ST Visual Programmer tool for flashing the program but I’m running into the following error continuously.

samruddhi_daithankar_0-1720694091131.png
I have tried using both ST-Link/V2(A) and ST-Link/V2(A) ISOL but it gives the same error. Since Reset pin is not available in this controller, connections I made are as follows:

ST-Link/V2(A)

Target MCU

VDD

Pin 4

GND

Pin 2

Data

Pin 8


And I believe the configurations I made in STVP are correct:

samruddhi_daithankar_1-1720694091159.png


So, I have these questions:
1. Are the connections with ST-Link correct? Should we be using another version of debugger/programmer? If yes, could you direct us to which device we should be using?
2. Is there any other way to simulate the reset condition other than Power-On Reset?


1 ACCEPTED SOLUTION

Accepted Solutions

**you can reprogram the device.. not able to debug.  For debugging, disable usage of SWIM pin , then debug the application and enable it later.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

5 REPLIES 5
AA1
Senior III

As this MCU doesn't have reset pin, external reset is only possible by Power-On Reset.

If SWIM pin is not used as GPIO, it should be possible to connect by SWIM even without reset. Read RM0016 pages 57 and 58, and datasheet page 12.

In my design, SWIM pin is also being used as PWM output. in that case, will I not be able to debug it at all? 
Section 4.2 of the Datasheet mentions:
As the NRST pin is not available on this device, if the SWIM pin should be used with the I/O pin functionality, it is recommended to add a ~5 seconds delay in the firmware before changing the functionality on the pin with SWIM functions. This action allows the user to set the device into SWIM mode after the device power on and to be able to reprogram the device. 

**you can reprogram the device.. not able to debug.  For debugging, disable usage of SWIM pin , then debug the application and enable it later.

If you feel a post has answered your question, please click "Accept as Solution".

Hello, I tried this, and I still was not able to flash the program. What else do you think might cause this?

You have to.have your program not to use swim pins . If you use, it has  to be enabled with a  delay as you mentioned earlier. The programmer can establish connections at the time of booting only. There is no reset pin for this processor,  so only at the time of power only you can establish connections. Anyway it's always better to avoid these pins. Use some gpio expanders etc..

If you feel a post has answered your question, please click "Accept as Solution".