Visual Micro
https://www.visualmicro.com/forums/YaBB.pl
Visual Micro >> Hardware Debugging (GDB, GDB WiFi, GDB Stub) >> JLink Software GDB Start Problem on WIO Terminal
https://www.visualmicro.com/forums/YaBB.pl?num=1599990754

Message started by Kabron on Sep 13th, 2020 at 10:52am

Title: JLink Software GDB Start Problem on WIO Terminal
Post by Kabron on 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).[/code]
I tried with J-link GDB server running or not.
2020-09-13_124951.jpg (103 KB | 0 )

Title: Re: Missing openocd config
Post by Kabron on Sep 13th, 2020 at 11:09am
Sorry,
here is my build output
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=build_011.txt (56 KB | 3 )

Title: Re: Missing openocd config
Post by Simon@Visual Micro on 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[/code]


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

Title: Re: Missing openocd config
Post by Kabron on 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.
Errors_004.jpg (50 KB | 0 )

Title: Re: Missing openocd config
Post by Simon@Visual Micro on 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.

Title: Re: Missing openocd config
Post by Kabron on 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_seeed_wio_terminal\\Debug",
  "MIDebuggerPath": "C:\\Users\\vlady\\AppData\\Local\\arduino15\\packages\\Seeeduino\\tools\\arm-none-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_seeed_wio_terminal\\Debug\\debugger_tmp.natvis",
  "showDisplayString": true
}

Errors1.jpg (14 KB | 0 )

Title: Re: Missing openocd config
Post by Kabron on 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.

Title: Re: Missing openocd config
Post by Simon@Visual Micro on 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?

Title: Re: Missing openocd config
Post by Kabron on Sep 14th, 2020 at 3:59pm
Exactly as in my first picture.

Title: Re: Missing openocd config
Post by Kabron on 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.

Title: Re: Missing openocd config
Post by Simon@Visual Micro on 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.

Title: Re: Missing openocd config
Post by Kabron on 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

Title: Re: JLink Software GDB Start Problem on WIO Terminal
Post by Simon@Visual Micro on 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
}[/code]

This needs adding to the command line parameters, see the JLink Script file information.

Title: Re: JLink Software GDB Start Problem on WIO Terminal
Post by Kabron on Sep 15th, 2020 at 12:30pm
With
https://www.raymond.cc/blog/auto-click-annoying-confirmation-buttons-clickoff/
works fine!

Visual Micro » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2020. All Rights Reserved.