Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • 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
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
JLink Software GDB Start Problem on WIO Terminal (Read 224 times)
Kabron
Member
***
Offline



Posts: 133
JLink Software GDB Start Problem on WIO Terminal
Sep 13th, 2020 at 10:52am
 
Hello,
with Wio Terminal,
initially I had the same error as Habib.
After adding board.txt it gone, but now I got another:
Code:
Starting: "C:\ProgramData\vmicro\tools\openocd-0.10.0.20200213\bin/openocd.exe" -d2 -l "{C:\Users\vlady\AppData\Local\Temp\VMBuilds\Test\Seeeduino_seeed_wio_terminal\Debug/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: "C:\Users\vlady\AppData\Local\arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\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.
Back to top
« Last Edit: Sep 15th, 2020 at 9:42am by Simon@Visual Micro »  

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



Posts: 133
Re: Missing openocd config
Reply #1 - Sep 13th, 2020 at 11:09am
 
Sorry,
here is my build output
Back to top
 

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



Posts: 515
Re: Missing openocd config
Reply #2 - Sep 14th, 2020 at 10:03am
 
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:
C:\Users\vlady\AppData\Local\Temp\VMBuilds\Test\Seeeduino_seeed_wio_terminal\Debug/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
Member
***
Offline



Posts: 133
Re: Missing openocd config
Reply #3 - Sep 14th, 2020 at 12:51pm
 
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.
Back to top
 

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



Posts: 515
Re: Missing openocd config
Reply #4 - Sep 14th, 2020 at 1:21pm
 
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
Member
***
Offline



Posts: 133
Re: Missing openocd config
Reply #5 - Sep 14th, 2020 at 2:27pm
 
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": "C:\\Users\\vlady\\AppData\\Local\\Temp\\VMBuilds\\WioWiFiAnalyzer\\Seeeduino_se
eed_wio_terminal\\Debug",
  "MIDebuggerPath": "C:\\Users\\vlady\\AppData\\Local\\arduino15\\packages\\Seeeduino\\tools\\arm-no
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": "C:/Users/vlady/AppData/Local/Temp/VMBuilds/WioWiFiAnalyzer/Seeeduino_seeed_wio_
terminal/Debug/WioWiFiAnalyzer.ino.elf",
  "logging": {
    "moduleLoad": false,
    "trace": false,
    "engineLogging": false,
    "programOutput": false,
    "exceptions": false,
    "traceResponse": false
  },
  "visualizerFile": "C:\\Users\\vlady\\AppData\\Local\\Temp\\VMBuilds\\WioWiFiAnalyzer\\Seeeduino_se
eed_wio_terminal\\Debug\\debugger_tmp.natvis",
  "showDisplayString": true
}
Back to top
« Last Edit: Sep 14th, 2020 at 2:28pm by Kabron »  

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



Posts: 133
Re: Missing openocd config
Reply #6 - Sep 14th, 2020 at 2:38pm
 
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: 515
Re: Missing openocd config
Reply #7 - Sep 14th, 2020 at 3:46pm
 
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
Member
***
Offline



Posts: 133
Re: Missing openocd config
Reply #8 - Sep 14th, 2020 at 3:59pm
 
Exactly as in my first picture.
Back to top
 
 
IP Logged
 
Kabron
Member
***
Offline



Posts: 133
Re: Missing openocd config
Reply #9 - Sep 14th, 2020 at 4:13pm
 
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.
Back to top
« Last Edit: Sep 14th, 2020 at 4:14pm by Kabron »  
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline



Posts: 515
Re: Missing openocd config
Reply #10 - Sep 14th, 2020 at 4:54pm
 
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
Member
***
Offline



Posts: 133
Re: Missing openocd config
Reply #11 - Sep 15th, 2020 at 6:28am
 
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: 515
Re: JLink Software GDB Start Problem on WIO Terminal
Reply #12 - Sep 15th, 2020 at 9:55am
 
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:
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
Member
***
Offline



Posts: 133
Re: JLink Software GDB Start Problem on WIO Terminal
Reply #13 - Sep 15th, 2020 at 12:30pm
 
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print