Skip to main content
MZaqu.1
Associate
January 28, 2020
Question

STM8L001J3 and SWIM pin

  • January 28, 2020
  • 2 replies
  • 1413 views

I was using STM8SVLDISCOVERY in a small project because it was the evaluation board that I had, but in a more final stage I would like to use an stm8sl001j3 as uC.

For that, I got a STM8-SO8-DISCO to be able to use the same uC that I want in the final product. After "converting" my project to use stm8l instead of stm8s, I tried to deploy it in the new board but something looked strange.

After looking at the documentation I realized I should have put a 5s delay in the beginning of the code as I was using SWIM pin as an IO too, otherwise I would brick the CPU.

As I am getting SWIM errors in the IDE, I suppose I already bricked the CPU, and after some research I couldn't find if there is a way to undo this situation.

That's why I'm here, is there any way to do that or I lost the uC?

    This topic has been closed for replies.

    2 replies

    Philipp Krause
    Senior II
    January 29, 2020

    Same happened to me using a different board (http://www.colecovision.eu/stm8/STM8S001J3%20Reference%20Serial.shtml) when I first targeted the STM8S001.

    I'd recommend to keep a few spare chips around, just in case. At least it doesn't take much time to desolder and replace an 8-pin device on a dev board.

    MZaqu.1
    MZaqu.1Author
    Associate
    January 30, 2020

    Thanks for sharing!

    I just changed the uC and by putting this delay I'm not bricking the CPU anymore (at least I can deploy the code now).

    I'm still having some errors. Even now that I'm waiting for 5 seconds, when I try to change pin 1 (PC3/SWIM) to use as an output for PC3 I start to get SWIM errors (30004 timeout). I followed this exact logical sequence (https://www.st.com/content/ccc/resource/technical/document/application_note/group0/f0/a0/b1/90/65/14/42/ca/DM00422107/files/DM00422107.pdf/jcr:content/translations/en.DM00422107.pdf) which I use the delay, then configure GPIOs and just after that configure clock settings and so on, but still getting errors. By debbuging I can see that the problem happens when I try to configure PC3 (same pin as SWIM) as an output.

    Any toughts?