2019-08-06 10:59 PM
Hello everyone.
I am in trouble with the SWIM pin of STM8S.
According to the data sheet, unused pins should be set to OUTPUT.
However, I would like to keep SWIM pins in a state where they are normally unused and can be debugged only when necessary.
How can this be achieved?
Thank you for your advice.
�?Postscript】
I supplement my questions.
UM0470 has the following description.
Perhaps I think that I can switch between SWIM function and I / O function with a jumper, but I don't know the internal settings to achieve this.
In addition, when I / O is used, I want to apply unused-pin processing such as pull-up to the SWIM pin.
(In normal times, I / O is used to perform unused processing such as pull-up, and I want to be able to debug when there is an error.)
In summary, I have two questions.
・ How can I implement a specific method to switch between SWIM function and I / O as in the above example?
・ How to perform unused processing when SWIM is in I / O mode ?
Thank you.
2019-09-05 04:15 AM
we have the same problem. We are using STM8L050J3 and we need to include one delay of 5 secons in our program.
How can I erase program?
2019-09-08 12:05 PM
Hello Ota-s!
If you use the SWIM pin in your application, you will have to disable the SWIM interface from within the application. After it's disabled, only a MCU reset can re-enable the SWIM interface to do debugging (if you activate the SWIM interface before you disable it from within the aplication). So, it cannot do 2 functions at once.
And, if you don't use the SWIM pin, you don't have to set it as output, it has an active pull-up by default after reset.
2021-01-29 04:42 AM
@Cristian Gyorgy You stated
"After it's disabled, only a MCU reset can re-enable the SWIM interface to do debugging"
Did you get this info from a datasheet? If so which one?
or
Is this from gained experience?
It's just that in our product we disable the swim pin as a safety precaution and enable the swim via CFG->GCR&=~(CFG_GCR_SWD); triggered via specific message through a uart interface. But this does not re-enable the swim and I cannot find any reference, apart from you comment, as to why.
Any info would be appreciated.
Cheers
2021-02-16 07:24 AM
If I remember well is was from experience, and then, searching for an explanation I found the activation sequence below. The one way arrows confirmed it for me.
Not sure if it applies to all SWIM revisions and devices.