Skip to main content
Visitor II
November 7, 2012
Question

ST-Link V2 error on STM32L discovery

  • November 7, 2012
  • 5 replies
  • 1433 views
Posted on November 07, 2012 at 20:24

I'm trying to verify that I can program an STM32L on the Discovery board using an external ST-Link V2 debugger. As far as I know, I only need the SWDIO and SWCLK pins (7 and 9 respectively) and ground. The SWDIO line goes to PA13 and the SWCLK goes to PA14.

I have the jumpers on CN3 disconnected in hopes that cuts the built-in SWD debugger off from the STM32L. I've powered it on externally, not through USB to avoid contention. However I either get an ''Internal Command Error'' when I try to ping the STM32L or the core is stuck in reset (it depends on how I power it up).

Is there any way I can actually use an external debugger to talk to the STM32L on the Discovery board? I would like to verify I can do this before we spin a prototype CCA.

#st-link #stm32l-discovery
    This topic has been closed for replies.

    5 replies

    Graduate II
    November 7, 2012
    Posted on November 07, 2012 at 21:25

    I suspect you will need to break SB100 and SB101 on the backside so the STM32F103 (internal ST-LINK) doesn't interfere.

    If you're building a board, you'd probably want to be exposing SWO, NRST and 3V3 too. Ideally a standard ARM debug 10-pin or 20-pin header, as it opens a lot of choices later and doesn't require hacking up custom cables. If that is too big, consider the 6-pin ST header as an option.

    Being able to drive reset make automation so much easier.
    shotaroAuthor
    Visitor II
    November 7, 2012
    Posted on November 07, 2012 at 22:06

    Thanks Clive,

    I took out those jumpers and got just the MCU powered on. I have the SWDIO, SWCLK, NRST, and GND connected, but I still get an internal command error. SWO shouldn't be necessary should it?

    I'm trying use the ST-Link utility to talk to the MCU

    EDIT: Just for craps and laughs, I put the jumpers for CN3 back on, now the embedded ST Link is having the same issue. However, I do notice the MCU doesn't seem to run (the app on it just turns on the LEDs) until I try to talk to the device. If I disconnect after I get the ''Internal Command Failed'', the MCU turns off.

    EDIT 2: Ah, never mind. I have the wrong reset line hooked up. I have pin 3, not pin 15.

    EDIT 3: Which that didn't help either.

    One more thing: I looked over the ARM spec on the debug connectors and they require 100K pull ups on the debug lines ( http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka14540.html ). Though I don't know if this is on the debugger side or the target side

    shotaroAuthor
    Visitor II
    November 8, 2012
    Posted on November 08, 2012 at 19:54

    I have success! Maybe this can be useful to other people.

    • Pull out jumpers on CN3
    • Remove SMT jumpers SB100 and SB101 (on the back side)
    • Set power supply to 3V.
    • Connect the positive/hot/output power supply lead to JP1, the middle of the 3 pin header to do current measurement or not on the board. Connect the PSU COM to any of the ground pins.
    • From the ST-Link V2, connect VCC (pin 1) to JP1, SWDIO (pin 7) to PA13, SWCLK (pin 9) to PA14, NRST (pin 15) to NRST, and any of the even numbered pins to GND.

    That should do it.

    Visitor II
    August 15, 2014
    Posted on August 15, 2014 at 10:57

    Graduate II
    August 15, 2014
    Posted on August 15, 2014 at 14:17

    Hello, i have a problem with st link utility: i'm writing a bootloader for stm32l but when i'm trying to read in a mapped mode the device disconnect and when i try to write it say that there is a problem in the start address please can help me ....

    Please TOP POST responses, otherwise they are hidden.

    Your description of the problem doesn't give me enough information to work with, can you provide some more specific data and error messages, or attach a project file.