Skip to main content
10bec062
Associate
January 24, 2013
Question

stlink v2 error

  • January 24, 2013
  • 4 replies
  • 997 views
Posted on January 24, 2013 at 16:59

hi

I am using STM32W108CB and made my own pcb. I've stlink v2 and want to use it as Serial Wire Debugger.

When I press 'connect to the target' in stlink utility I get message 'Internal command error'.

I've tried to search a lot but can't find what that error means.

I've not soldered crystal oscillator to the board yet. Does SWD needs the MCU with external clock?

I've triple check all the connection power supply. Each connection is perfect and well, don't know why SWD isn't working.

Any kind of help would be appreciated.
    This topic has been closed for replies.

    4 replies

    Tesla DeLorean
    Guru
    January 24, 2013
    Posted on January 24, 2013 at 17:30

    You don't need an external crystal for the debug interface to run, by the CPU has to function.

    Most likely a power supply issue, check the voltage on NRST. Typical failures beyond that are that it's just wired up wrong, the interface isn't correct, the chip is not correctly orientated, or you have solder shorts, or open connections.

    Post a schematic of the board, of specifically the STM32 if other stuff is sensitive.
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    10bec062
    10bec062Author
    Associate
    January 25, 2013
    Posted on January 25, 2013 at 19:22

    Thanks clive1.

    There was problem with power supply. Now stlink detects the stm32w108.

    I am right now facing another problem. I am using uvision 4 and can program stm32w108 properly, but the problem is that each time when I debug, mcu goes into NMI Handler() function.

    Is it happening due to clock issues? I think I've not properly soldered 24MHz crystal oscillator.

    Tesla DeLorean
    Guru
    January 25, 2013
    Posted on January 25, 2013 at 20:38

    Sure it's not in the Hard Fault handler?

    Suggest you turn off ''Run to main'' and debug the initial start up through SystemInit()

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    10bec062
    10bec062Author
    Associate
    January 27, 2013
    Posted on January 27, 2013 at 16:09

    Thanks clive1.

    I've soldered crystal properly and it's working fine.

    Now program doesn't go into NMI Handler()

    Thank you for your reply.