Skip to main content
jaspervandenakker
Associate III
Apr 17, 2013 6:53 AM UTC
Question

ST LINK error

Posted on April 17, 2013 at 08:53

Since yesterday, i can't establish a ST LINK connection with my STM32L1-Discovery board. I've tried it in CrossWorks on my MacBook, the error was 'ST-LINK LOG'.

After that, I've tried it on my windows 7 pc with ST LINKv2 (downloaded from ST website) and also no luck. The last try was with Keil uVision, and the error was: 'no device connected'.

Yesterday, i've tried to upload a new program into my Discovery board, after that moment, it went wrong. Probably a bad program. How can i (hard) reset my device?
    This topic has been closed for replies.

    6 replies

    frankmeyer9
    Associate III
    Apr 17, 2013 7:52 AM UTC
    Posted on April 17, 2013 at 09:52

    Well, you can try to do a mass erase with the ST Link Utility, which is a Windows software.

    Or, if that fails, start into the ROM bootloader by pulling the BOOT0/BOOT1 pins, as described here multiple times. You can use the Flash Loader Demonstrator software for a mass erase.

    I've tried it in CrossWorks on my MacBook, the error was 'ST-LINK LOG'.

     

     

    Usually, Crossworks un-defines the STARTUP_FROM_RESET macro by default in it's projects, which will make the board dependant on the debugger to startup.

    This causes some confusion in the unaware, but is a precaution exactly for those cases.

    jaspervandenakker
    Associate III
    Apr 17, 2013 11:47 AM UTC
    Posted on April 17, 2013 at 13:47

    Thank you, problem is solved on a windows machine. ST LINK didn't work, but i've used STVP.

    I also found the problem in my code that cause the problem. When i declare Port A pin 13 as a input, it goes wrong. anybody knows why?

    When i left PA13 out of my code, it is ok. (after reset my STM32L on a windows with STVP)

    Tesla DeLorean
    Guru
    Apr 17, 2013 12:03 PM UTC
    Posted on April 17, 2013 at 14:03

    PA13 = JTMS-SWDIO, ie part of the SWD / JTAG Debug interface, thus fails.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    frankmeyer9
    Associate III
    Apr 17, 2013 12:05 PM UTC
    Posted on April 17, 2013 at 14:05

    I also found the problem in my code that cause the problem. When i declare Port A pin 13 as a input, it goes wrong. anybody knows why?

     

    When i left PA13 out of my code, it is ok. (after reset my STM32L on a windows with STVP)

     

    This pin might be used for SWD, SWDIO to be precise. Just check the datasheet.

    I generally avoid to redesignate JTAG/SWD pins, if possible.

    jaspervandenakker
    Associate III
    Apr 17, 2013 12:25 PM UTC
    Posted on April 17, 2013 at 14:25

    @ clive1 and fm.

    Thank you for the info. That is the reason that my code fails. I will try to find another pin. Almost every pin is used now :)

    frankmeyer9
    Associate III
    Apr 17, 2013 12:42 PM UTC
    Posted on April 17, 2013 at 14:42

    The mentioned Crossworks method should have avoided this trouble, as it kicks in immediately at the reset handler routine, before initialising any pins. Except, of course, you have speficied ''STARTUP_FROM_RESET'' for your project, to skip waiting for the debugger.