Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) SWD for Arduino Due with Jlink EDU? (Read 308 times)
perigalacticon
Junior Member
**
Offline


Posts: 66
Location: detroit area
Joined: Nov 7th, 2016
SWD for Arduino Due with Jlink EDU?
Apr 20th, 2025 at 3:17am
Print Post  
I have an Arduino Due (SAM3X8E) and a JLink mini EDU debugger.  Can I debug Arduino sketches using VM with this hardware?  The Debugger Support Listing lists compatibility with Segger J-Link but not for Segger JLink (SWD).
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: SWD for Arduino Due with Jlink EDU?
Reply #1 - Apr 20th, 2025 at 12:04pm
Print Post  
We have amended the listing page, and the SWD protocol is used for the DUE as this is the protocol it supports.

We will add the wiring diagram to the below page in the coming few days:
https://www.visualmicro.com/page/SAM-Debugging.aspx
  
Back to top
IP Logged
 
perigalacticon
Junior Member
**
Offline


Posts: 66
Location: detroit area
Joined: Nov 7th, 2016
Re: SWD for Arduino Due with Jlink EDU?
Reply #2 - Apr 20th, 2025 at 11:45pm
Print Post  
Thanks.  Sorry to bother you on Easter Sunday, please don't bother to respond today!  However, I have an issue when trying to start debugging with the Due using the Jlink mini EDU programmer.  In the output window I get:  

Code (C++)
Select All
Compiling 'Blink_with_Serial' for 'Arduino Due (Programming Port) (arduino_due_x_dbg)'
Build Folder: rduino_due_x_dbg/Debug"

Program size: 11360 bytes (used 2% of a 524288 byte maximum) (1.47 secs)

Uploading 'Blink_with_Serial' to 'Arduino Due (Programming Port) (arduino_due_x_dbg)' using 'JLink'
Open On-Chip Debugger 0.10.0+dev-01058-g853a05287 (2020-02-13-16:41)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
debug_level: 0
at91sam3X8E
****[vMicro]**** Uploading ELF :Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error during upload using programmer
The uploader process failed

The uploader process failed
The uploader returned an error
Error: at91sam3X8E.cpu: IR capture error; saw 0x0f not 0x01
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR 


... and then
Code (C++)
Select All
in procedure 'program'
** OpenOCD init failed **
shutdown command invoked 



I included a screenshot of my VM setup:

FYI I am using the "DEBUG SWD" group of 4x 0.1" header pins on the Due and not the 10-pin 0.05" spaced header because my due doesn't have these header pins.  I do have an adapter to 0.1" pin spacing I am using and I've many times checked the connections, including all GND pins are attached to GND, the only one not connected being labeled "Key" and I don't know what that pin is for.

P.S. I did use the Zadig tool to update the JLink driver.
« Last Edit: Apr 21st, 2025 at 12:23am by perigalacticon »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: SWD for Arduino Due with Jlink EDU?
Reply #3 - Apr 22nd, 2025 at 12:01pm
Print Post  
Thanks for the update.

There is a correction to the upload pattern (in the attached file) which can be added to the project in a Local Board.txt file (vMicro > Add Code > Add Local Board.txt).  This ensures the SWD Transport is forced (even though it is in the board.cfg), and will be included in the next release.

Quote:
I am using the "DEBUG SWD" group of 4x 0.1" header pins on the Due and not the 10-pin 0.05" spaced header because my due doesn't have these header pins.


I have wired my board here up the same (and wired the Vcc pin to the JLinks VRef Pin from the SPI header so the JLink detects the correct voltage), and it all works as expected with the override in the attached file.

Let us know if you still have any issues.
  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: SWD for Arduino Due with Jlink EDU?
Reply #4 - Apr 23rd, 2025 at 1:42pm
Print Post  
The latest build (2025.0423.0) has the amended configuration included, so the override in the local board.txt from the previous post won't be needed once this is installed.

It can be downloaded from the top of the below board:
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES
  
Back to top
IP Logged
 
perigalacticon
Junior Member
**
Offline


Posts: 66
Location: detroit area
Joined: Nov 7th, 2016
Re: SWD for Arduino Due with Jlink EDU?
Reply #5 - Apr 24th, 2025 at 1:07am
Print Post  
Thanks for the support.

I updated the VM extension and tried again, got a different result:

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
perigalacticon
Junior Member
**
Offline


Posts: 66
Location: detroit area
Joined: Nov 7th, 2016
Re: SWD for Arduino Due with Jlink EDU?
Reply #6 - Apr 24th, 2025 at 1:11am
Print Post  
I checked the configuration manager and set it to build and deploy the current project.  For some reason these return to being unchecked after the Start debugging is attempted.  BTW is there any way to resize pictures or add more than 2 at a time?  Thanks.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
perigalacticon
Junior Member
**
Offline


Posts: 66
Location: detroit area
Joined: Nov 7th, 2016
Re: SWD for Arduino Due with Jlink EDU?
Reply #7 - Apr 24th, 2025 at 1:13am
Print Post  
I have posted to the Segger forum to get assistance as their own software does not recognize the Jlink, however it is found in Device Manager.  You can see the post here:  https://forum.segger.com/index.php/Thread/9800-J-Link-EDU-Mini-not-recognized/
  
Back to top
 
IP Logged
 
perigalacticon
Junior Member
**
Offline


Posts: 66
Location: detroit area
Joined: Nov 7th, 2016
Re: SWD for Arduino Due with Jlink EDU?
Reply #8 - Apr 24th, 2025 at 1:20am
Print Post  
One more update, I tried holding the erase button for 2 seconds and then pressing the reset button.  When Starting debugging there is a different output now (see below), regardless if I press erase or reset or neither or if I power cycle the board.  For all previous tries I was not pressing erase or reset.  

« Last Edit: Apr 24th, 2025 at 6:49pm by perigalacticon »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
perigalacticon
Junior Member
**
Offline


Posts: 66
Location: detroit area
Joined: Nov 7th, 2016
Re: SWD for Arduino Due with Jlink EDU?
Reply #9 - Apr 24th, 2025 at 2:47am
Print Post  
Sorry for the flood of giant screenshots but there is more.  I updated the driver using Windows and pointed it to the SEGGER directory and it installed it.  Then the JLink software recognized it and worked correctly.  With Jlink Configurator I updated the Jlink firmware.  After powercycling the PC I attempted debug in VM and got the same result.  In Jlink Configurator there is an option to change the driver from SEGGER to WinUSB, so I tried that, and now it will successfully program with the JLink but not start debugging, giving the same "Project not selected to build for this solution configuration".   

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
perigalacticon
Junior Member
**
Offline


Posts: 66
Location: detroit area
Joined: Nov 7th, 2016
Re: SWD for Arduino Due with Jlink EDU?
Reply #10 - Apr 24th, 2025 at 3:10am
Print Post  
I went into Build / Configuration manager and selected 'Build' and 'Deploy' for 'Debug' and 'Arm' configuration for the sketch.  I got a different output:

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: SWD for Arduino Due with Jlink EDU?
Reply #11 - Apr 24th, 2025 at 8:49am
Print Post  
Thanks for the updates and information.

Can you attach the New_Blank_Sketch_V1.ino_DebugOpenOCD.log, which can be found in the build folder for your project?

This should show why OpenOCD has exited with an error.
  
Back to top
IP Logged
 
perigalacticon
Junior Member
**
Offline


Posts: 66
Location: detroit area
Joined: Nov 7th, 2016
Re: SWD for Arduino Due with Jlink EDU?
Reply #12 - Apr 24th, 2025 at 12:07pm
Print Post  
I didn't find "New_Blank_Sketch_V1.ino_DebugOpenOCD.log" but I found "New_Blank_Sketch_V1.log":

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
perigalacticon
Junior Member
**
Offline


Posts: 66
Location: detroit area
Joined: Nov 7th, 2016
Re: SWD for Arduino Due with Jlink EDU?
Reply #13 - Apr 24th, 2025 at 12:20pm
Print Post  
In case you're interested I made a new sketch "test2.ino", blank with no code and it has the same result.  I attached the project files:

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
perigalacticon
Junior Member
**
Offline


Posts: 66
Location: detroit area
Joined: Nov 7th, 2016
Re: SWD for Arduino Due with Jlink EDU?
Reply #14 - Apr 24th, 2025 at 12:26pm
Print Post  
Here are the files from the __vm dir:

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: SWD for Arduino Due with Jlink EDU?
Reply #15 - Apr 24th, 2025 at 12:29pm
Print Post  
Thanks for the log.

The project needs the Build Checkbox to be unchecked to ensure the vMicro Build and Debugging is not affected by the standard VS Linux Tools.

Can you change that option and try starting the debugging session again?

The output shown in the Output > Debug window shows the commands which are being run, and within that the full location to the OpenOCD.log is shown.
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: SWD for Arduino Due with Jlink EDU?
Reply #16 - Apr 24th, 2025 at 1:02pm
Print Post  
As discussed:

1) There is an additional override required it seems to make this work on your setup (though worked without this for me, so we will investigate why and resolve).  Both overrides required are in the attached file.

2) The General Hardware Debugging walkthrough Video on YouTube is useful if you are not ofay with the Debugging in Visual Studio:
https://www.youtube.com/watch?v=tkG5MvyEurI

Let us know if you have any further issues, and we will update when the fix version is available to download.
  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint