[SOLVED] JLink: Error connecting to device over SWD

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] JLink: Error connecting to device over SWD

    This is a problem I've been having for a while now, any help would be greatly appreciated! I'm trying to program a Trinket M0 using a j-link mini, following this guide learn.adafruit.com/how-to-prog…loaders/trinket-m0-wiring

    Once in atmel studio with a device programming window up, I am able to Read target voltage just fine (3.3V). However when I click read signature, after a few seconds the following error is thrown (attached) The log file the J-Link generates is available here: pastebin.com/4LimdSu6


    I have also tried (unsuccessfully) to connect to the device using J-link commander, the result of which is below



    What I have also tried:
    • Running on another computer (win10 vmware on a mac)
    • Using a different ribbon cable (tried 3)
    • Using a different j-link mini
    • Using a different Trinket to try and program
    • updating the j-link's firmware
    • Using a different USB cable/port


    Given this is not working, even after I try on another pc and with another j-link surely this must be a software setup issue. Perhaps there's something I'm missing or adafruit's guide is incomplete? Also I should mention when I try using the SEGGER JLink DLL Updater to update Atmel Studio's DLL, the program closes as soon as I press 'OK' to update the DLL, it does not look like the DLL updates (however of course this doesn't explain why J-link commander won't work)
  • Hi,
    Thank you for your inquiry.

    I gave this a quick try on the "RobotDyn SAMD21 M0" evalboard and everything works as expected:


    Were you able able to connect to the device before?
    Are you using an erased chip or is there an application running on it?
    As far as I can see in the guide, the reset pin is not connected to the interface.
    You could try to connect the reset pin to the debug port, so that the "connect under reset" can be executed.

    Best regards,
    Fabian
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • SEGGER - Fabian wrote:

    Hi,
    Thank you for your inquiry.

    I gave this a quick try on the "RobotDyn SAMD21 M0" evalboard and everything works as expected:


    Were you able able to connect to the device before?
    Are you using an erased chip or is there an application running on it?
    As far as I can see in the guide, the reset pin is not connected to the interface.
    You could try to connect the reset pin to the debug port, so that the "connect under reset" can be executed.

    Best regards,
    Fabian
    Thanks for your response, I haven't been able to connect to it before, this is my first time giving the j-link a go. The chip does currently have a program running on it. I tried connecting the reset pin, it is triggered by the j-link, however I still get the same issue.
  • Hi,
    1) So you were able to connect to the device with another debug probe?
    1.1) If so, which one?
    2) Did you you set the device into any low-power mode or did you lock the device in any way?
    3) Could you provide us a datafile (e.h. .hex) of the application running on the target?

    Best regards,
    Fabian
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • SEGGER - Fabian wrote:

    Hi,
    1) So you were able to connect to the device with another debug probe?
    1.1) If so, which one?
    2) Did you you set the device into any low-power mode or did you lock the device in any way?
    3) Could you provide us a datafile (e.h. .hex) of the application running on the target?

    Best regards,
    Fabian
    I haven't tried with another debug probe, the j-link is all I have to hand. Both devices (the jlink and trinket) are stock, I haven't loaded anything on to them or changed any of their settings. The trinket it running the default program is came with (the blink sketch I believe). Thanks for your help Fabian - I do appreciate your time.
  • Hi,

    Do you have the possibility to test the J-Link EDU Mini on another board or another J-Link you can connect to the board with?

    Unfortunately, there is not much more we can do for you, as long as we are not able to reproduce this.

    Best regards,
    Fabian
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.