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) JLink Software GDB Start Problem on WIO Terminal (Read 3835 times)
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
JLink Software GDB Start Problem on WIO Terminal
Sep 13th, 2020 at 9:52am
Print Post  
Hello, 
with Wio Terminal,
initially I had the same error as Habib.
After adding board.txt it gone, but now I got another:
Code
Select All
Starting: "C:\ProgramData\vmicro\tools\openocd-0.10.0.20200213\bin/openocd.exe" -d2 -l ebug/Test.ino_DebugOpenOCD.log}" -s "C:\ProgramData\vmicro\tools\openocd-0.10.0.20200213/scripts/" -f "interface/jlink.cfg" -c "transport select swd" -f "target/atsame5x.cfg" -c "init"
Starting: cc\7-2017q4/bin\arm-none-eabi-gdb.exe" --interpreter=mi
"C:\ProgramData\vmicro\tools\openocd-0.10.0.20200213\bin/openocd.exe" exited with code 1 (0x1). 


I tried with J-link GDB server running or not.
« Last Edit: Sep 15th, 2020 at 8:42am by Simon@Visual Micro »  

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


Posts: 170
Joined: Nov 1st, 2015
Re: Missing openocd config
Reply #1 - Sep 13th, 2020 at 10:09am
Print Post  
Sorry,
here is my build output
  

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


Posts: 2145
Joined: Feb 13th, 2019
Re: Missing openocd config
Reply #2 - Sep 14th, 2020 at 9:03am
Print Post  
Thanks for the report.

Can you attach the below log file from your machine, as this should show more detail about what is failing:
Code
Select All
ug/Test.ino_DebugOpenOCD.log 




Normally we run OpenOCD instead of the JLink software, which requires the driver to be swapped out using Zadig for the software to interface to it:
Hardware Debugging Troubleshooter
Video: Arduino Hardware Debug Troubleshooting

This can be run using the JLink software, and we have a video walk-through guide on how to configure this below:
Video: Advanced GDB Configuration Using JLink Drivers and Software
  
Back to top
 
IP Logged
 
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
Re: Missing openocd config
Reply #3 - Sep 14th, 2020 at 11:51am
Print Post  
Thanks for answer, Simon.
Yes, you're right. I, as usual,  forget libusb.
Quote:

swd
Warn : Failed to open device: LIBUSB_ERROR_NOT_FOUND.
Error: No J-Link device found.

But it is some inconvenient to change J-link drivers back and forward, because I often use Keil.
Meanwhile,  platformio and VisualGDB, works with no problems.

So, I changed to BlackMagic and got the following messages. And VS freeze. 
Line 127 is void loop().
Again, platformio works with this project and BlackMagic.
  

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


Posts: 2145
Joined: Feb 13th, 2019
Re: Missing openocd config
Reply #4 - Sep 14th, 2020 at 12:21pm
Print Post  
You can use the JLink drivers and software to interface with the debugger, meaning you wont have to swap the driver out when switching between IDE's:-
Video: Advanced GDB Configuration Using JLink Drivers and Software

As the error states hit counts are not supported on the hardware breakpoints, but the Visual Micro Serial Debugger supports all Hit Count and Conditional features.
  
Back to top
 
IP Logged
 
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
Re: Missing openocd config
Reply #5 - Sep 14th, 2020 at 1:27pm
Print Post  
I made all recommendation as in your video, but still got error.  
JLinkGDBServer started, connected to target, waits for connection some seconds and gone.
My WIO_TERMINAL.Debug.debugger_launch.json is 
Quote:
{
  "serverLaunchTimeout": 5000,
  "filterStdout": false,
  "filterStderr": true,
  "targetArchitecture": "arm",
  "stopAtEntry": false,
  "externalConsole": false,
  "MIMode": "gdb",
  "MIDebuggerServerAddress": "localhost:2331",
  "cwd": eed_wio_terminal\\Debug",
  "MIDebuggerPath": ne-eabi-gcc\\7-2017q4/bin\\arm-none-eabi-gdb.exe",
  "MIDebuggerArgs": "",
  "debugServerPath": "d:\\arm\\SEGGER\\JLink_V620b\\JLinkGDBServer.exe",
  "debugServerArgs": "-select USB -device ATSAMD51P19 -if SWD -speed 4000 -noir",
  "program": terminal/Debug/WioWiFiAnalyzer.ino.elf",
  "logging": {
    "moduleLoad": false,
    "trace": false,
    "engineLogging": false,
    "programOutput": false,
    "exceptions": false,
    "traceResponse": false
  },
  "visualizerFile": eed_wio_terminal\\Debug\\debugger_tmp.natvis",
  "showDisplayString": true
}
« Last Edit: Sep 14th, 2020 at 1:28pm by Kabron »  

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


Posts: 170
Joined: Nov 1st, 2015
Re: Missing openocd config
Reply #6 - Sep 14th, 2020 at 1:38pm
Print Post  
If I comment strings:
//  "debugServerPath": "d:\\arm\\SEGGER\\JLink_V620b\\JLinkGDBServer.exe",
//  "debugServerArgs": "-select USB -device ATSAMD51P19 -if SWD -speed 4000 -noir",
, then manually start JLinkGDBServer and then attach to process, debug started OK. 
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: Missing openocd config
Reply #7 - Sep 14th, 2020 at 2:46pm
Print Post  
Thanks for the detail around this, and updates. 

I can't replicate on my machine at present, though not sure why the J-Link software would be closing... as the command line is generated in the J-Link software itself....

What does the JLink software shown in the log window when running from VS?
  
Back to top
 
IP Logged
 
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
Re: Missing openocd config
Reply #8 - Sep 14th, 2020 at 2:59pm
Print Post  
Exactly as in my first picture.
  
Back to top
 
IP Logged
 
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
Re: Missing openocd config
Reply #9 - Sep 14th, 2020 at 3:13pm
Print Post  
It has something to do with connection timeouts. I get a firmware update messageб because I have an old one and could not update it.
When I started JLinkGDBServer version 656a (before that it was 620b), if I can hit No button very quickly, then debugging starts normally. And serverLaunchTimeout does not matter.
With 620b this trick does not work.
« Last Edit: Sep 14th, 2020 at 3:14pm by Kabron »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: Missing openocd config
Reply #10 - Sep 14th, 2020 at 3:54pm
Print Post  
Thanks, I didn't realise there was the firmware update dialog popping up as well, and there may be a command line switch to suppress this 
(discussed on this thread on Segger forum).

It would seem if firmware update is not an option other users have simply kept using the older software package to avoid the popup.
  
Back to top
 
IP Logged
 
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
Re: Missing openocd config
Reply #11 - Sep 15th, 2020 at 5:28am
Print Post  
Quote:
 
It would seem if firmware update is not an option other users have simply kept using the older software package to avoid the popup.

ATSAMD51 appeared only since 620
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: JLink Software GDB Start Problem on WIO Terminal
Reply #12 - Sep 15th, 2020 at 8:55am
Print Post  
Thanks for the clarification, and the only solutions I know of are to either:-

(a) Update the JLink Firmware to the version compatible with the software version
(b) Add a JLinkScriptFile, which from their documentation would look similar to the below
(Section 7.14.1.83 SuppressInfoUpdateFW of JLink User Guide)
Code
Select All
void InitTarget(void) {
 JLINK_SYS_Report("J-Link script example.");
 SuppressInfoUpdateFW
 } 



This needs adding to the command line parameters, see the JLink Script file information.
  
Back to top
 
IP Logged
 
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
Re: JLink Software GDB Start Problem on WIO Terminal
Reply #13 - Sep 15th, 2020 at 11:30am
Print Post  
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint