Help with connecting a JLink EDU

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
veggie2u_cyberward
 
Posts: 43
Joined: Mon Sep 14, 2015 11:27 am

Help with connecting a JLink EDU

Post by veggie2u_cyberward »

I am wanting to learn how to debug code on device. I am familiar with debugging in java & javascript, but not in C and not on the device. I have a JLInk EDU, and I have tried with a Metro Express M0, and a Grand Central. Nothing will connect. I even just got a second JLink EDU because I thought it might not be working. I should say I am on a MacBookPro with USBC only ports and an adapter. I can load code to these and other boards just fine with Arduino and PlatformIO.

What I tried first was the article by Scott on using GDB https://learn.adafruit.com/debugging-th ... -gdb/setup. I got to the point where I type the command:

Code: Select all

JLinkGDBServer -if SWD -device ATSAMD21G18
I do get some output. It tries to connect, but always gives this

Code: Select all

2449 ~  » JLinkGDBServer -if SWD -device ATSAMD21G18
SEGGER J-Link GDB Server V7.54c Command Line Version

JLinkARM.dll V7.54c (DLL compiled Sep 20 2021 13:55:08)

Command line: -if SWD -device ATSAMD21G18
-----GDB Server start settings-----
GDBInit file:                  none
GDB Server Listening port:     2331
SWO raw output listening port: 2332
Terminal I/O port:             2333
Accept remote connection:      yes
Generate logfile:              off
Verify download:               off
Init regs on start:            off
Silent mode:                   off
Single run mode:               off
Target connection timeout:     0 ms
------J-Link related settings------
J-Link Host interface:         USB
J-Link script:                 none
J-Link settings file:          none
------Target related settings------
Target device:                 ATSAMD21G18
Target interface:              SWD
Target interface speed:        4000kHz
Target endian:                 little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link EDU Mini V1 compiled Sep 24 2021 16:44:11
Hardware: V1.00
S/N: 801035568
Feature(s): FlashBP, GDB
Checking target voltage...
Target voltage: 3.30 V
Listening on TCP/IP port 2331
Connecting to target...
ERROR: Could not connect to target.
Target connection failed. GDBServer will be closed...Restoring target state and closing J-Link connection...
Shutting down...
Could not connect to target.
Please check power, connection and settings.%
The other 2 posts I saw on the Learn site were for windows, so I have not tried them. I saw a post that says the JLink does not work with a VM.

I then saw a post here about using Ozone. So I tried that. I downloaded it and couldn't figure out how to give it a project file. I tried the wizard, and thought it was working (SWD mode???) but it also says "Connection failed" I have no idea what I am doing in that program yet though.

I am kind of at a loss. Would be grateful for any direction at this point. The end goal is probably to use JLink with PlatformIO - I have switched to it from the Arduino IDE recently, but at this point I would just like to prove that it works.

User avatar
User_UMjT7KxnxP8YN8
 
Posts: 323
Joined: Tue Jul 17, 2018 1:28 pm

Re: Help with connecting a JLink EDU

Post by User_UMjT7KxnxP8YN8 »

How are you connecting the J-Link to your board?

User avatar
veggie2u_cyberward
 
Posts: 43
Joined: Mon Sep 14, 2015 11:27 am

Re: Help with connecting a JLink EDU

Post by veggie2u_cyberward »

I am using the short micro usb cable and ribbon cables that came with the Jlink and an adapter cable that I have also used to upload to this and other devices. I have tried powering the Metro with 5v from a power adapter, not USB port at its micro USB port, and 9v via the barrel jack.
Meto Express Wires
Meto Express Wires
metrom0.jpg (615.16 KiB) Viewed 396 times

User avatar
adafruit_support_carter
 
Posts: 29159
Joined: Tue Nov 29, 2016 2:45 pm

Re: Help with connecting a JLink EDU

Post by adafruit_support_carter »

Rotate connection here 180deg.
ribbon.jpg
ribbon.jpg (22.89 KiB) Viewed 392 times
Red line on ribbon cable indicates Pin 1 location. Pin 1 on JLink:
ribbon2.jpg
ribbon2.jpg (140.56 KiB) Viewed 392 times

User avatar
veggie2u_cyberward
 
Posts: 43
Joined: Mon Sep 14, 2015 11:27 am

Re: Help with connecting a JLink EDU

Post by veggie2u_cyberward »

Well golly G willikers. That did it. I did not read that as a pin one identifier. I am not sure that there is a picture anywhere of that cable plugged in. I looked in the Segger manual and didn't see one. One on the Adafruit site would be a good idea I think. Thank you.

Any suggestions on how best to get started debugging using this tool now that I have it working?

User avatar
User_UMjT7KxnxP8YN8
 
Posts: 323
Joined: Tue Jul 17, 2018 1:28 pm

Re: Help with connecting a JLink EDU

Post by User_UMjT7KxnxP8YN8 »


Locked
Please be positive and constructive with your questions and comments.

Return to “Metro, Metro Express, and Grand Central Boards”