VS Arduino
Visual Micro >> Hardware Debugging (GDB, GDB WiFi, GDB Stub) >> Adding 3rd party hardware
https://www.visualmicro.com/forums/YaBB.pl?num=1535141147

Message started by Greg Terrell on Aug 24th, 2018 at 8:05pm

Title: Adding 3rd party hardware
Post by Greg Terrell on Aug 24th, 2018 at 8:05pm
Similar issue to AustinLindquist on his post.

Following the guidance provided on VisualMicro.com website for adding GDB 3rd party support, I have been attempting to create a GDB configuration for a Segger J-Link and an Arduino MKR1000.  While I have successfully integrated the J-Link\MKR1000 with OpenOCD, I have not been able to get Microsoft GDB Debugger to appear with any “custom” board.txt, boards.txt or platforms.txt configuration change.  So far the only way I have got the Microsoft GDB Debugger to appear is by selecting Arduino/Genuino Zero (Programming Port). 

Created a new board script (mkr1000-jlink.cfg) for OpenOCD at C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions\MH2UHNSB.YKA\Micro Platforms\default\tools\openocd-0.9.0\scripts\board.

Create a new boards.txt section (section separated as boards.mkr1000-jlink.append.txt)

Appended the following to the platforms.txt file.
# Platform external debugging
# --------------------
debug.tool=gdb
tools.gdb.pre_init.tool=openocd
tools.gdb.cmd=bin/arm-none-eabi-gdb
tools.gdb.cmd.windows=bin/arm-none-eabi-gdb.exe
tools.gdb.path= C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Linux\gcc_arm\bin
tools.gdb.pattern="{path}/{cmd}" -interpreter=mi -d {build.project_path}

tools.gdb.tcp=localhost:3333
tools.gdb.openocd.cmd=bin/openocd.exe
tools.gdb.openocd.path={runtime.vm.ide.platforms.path}/default/tools/openocd-0.9.0
tools.gdb.openocd.params.verbose=-d2
tools.gdb.openocd.params.quiet=-d0
tools.gdb.openocd.pattern="{path}/{cmd}" -s "{path}/scripts/" -f "{path}/scripts/{build.openocdscript}"

#-f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{{build.path}/{build.project_name}.bin}} verify reset 0x00002000; shutdown"

Does not appear to turn on the Microsoft GDB Debugger tool.
1.      3rd party hardware GDB guide - . https://www.visualmicro.com/post/2016/01/17/3rd-Party-Hardware-GDB-Configuration-Guide.aspx,

So I have tried…
2.      Option 1 (boards.txt) from link above
3.      Option 2 (platform.txt) from link above
4.      Adding board.txt to project (as described in link above).

None of these 3 approaches, as attempted, turn on the Microsoft GDB Debugger under vMicro > Debugger. If the Microsoft GDB Debugger is not “turned on”, how can one attempt to create a configuration for GDB debugging?

VM Team your support on this would be very much appreciated.
Greg

https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=mkr1000-jlink_cfg.txt ( 0 KB | 2 Downloads )
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=boards_mkr1000-jlink_append.txt ( 1 KB | 7 Downloads )

Title: Re: Adding 3rd party hardware
Post by Visual Micro on Aug 25th, 2018 at 11:55am
You can define an entire board in project\boards.txt you can only define extra properties or overrides.

The link you posted relates to GDB and does not relate to adding a new board to arduino.

You can follow the arduino guides to add new boards and platforms

Visual Micro does provide extra places to put boards.txt and platform.txt files but to start with just add them to whichever core you are working with.

For example if you are using the default AVR core that comes with arduino ide then add your board to the boards,txt files that is in arduinoide\hardware\arduino\avr. Same with platform.txt

Then click reload toolchains or restart the ide


Title: Re: Adding 3rd party hardware
Post by Greg Terrell on Aug 25th, 2018 at 12:09pm
I don't understand the first line of your last post. Are you saying the the local project "board.txt" can only override an existing element from a more global platform.txt or boards.txt file?

My goal is to only target the MKR1000 for now.  To get a choice of target on the Visual Studio drop-down, I duplicated the MKR1000 section from the boards.txt file to a new board name of mkr1000_jlink.name=Arduino/Genuino MKR1000 (J-Link).
This "boards.txt" is located in my C:\Users\GT\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.19 folder.

There are two installs of OpenOCD and numerous platform.txt I am likely not updating the correct file.

The only reason I was creating a new board was to add GDB functionality without breaking the original MKR1000 definition in boards.txt

Thanks,
Greg

Title: Re: Adding 3rd party hardware
Post by Visual Micro on Aug 25th, 2018 at 12:45pm
That's right local project board file just overrides properties of an existing board.

There are places to put files with additional boards.txt and platform.txt but you can just use the ones in the samd\1.6.19 folder for now.

Title: Re: Adding 3rd party hardware
Post by Greg Terrell on Aug 25th, 2018 at 1:36pm
Thanks Tim.  Your thoughts on why "Microsoft GDB Debugger" is not appearing on the vMicro>>Debugger menu?

From platform.txt (at bottom of file, if that matters)

# Platform external debugging
# --------------------
debug.tool=gdb
tools.gdb.pre_init.tool=openocd
tools.gdb.cmd=bin/arm-none-eabi-gdb
tools.gdb.cmd.windows=bin/arm-none-eabi-gdb.exe
tools.gdb.path= C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Linux\gcc_arm\bin
tools.gdb.pattern="{path}/{cmd}" -interpreter=mi -d {build.project_path}

tools.gdb.tcp=localhost:3333
tools.gdb.openocd.cmd=bin/openocd.exe
tools.gdb.openocd.path={runtime.vm.ide.platforms.path}/default/tools/openocd-0.9.0
tools.gdb.openocd.params.verbose=-d2
tools.gdb.openocd.params.quiet=-d0
tools.gdb.openocd.pattern="{path}/{cmd}" -s "{path}/scripts/" -f "{path}/scripts/{build.openocdscript}"

#-f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{{build.path}/{build.project_name}.bin}} verify reset 0x00002000; shutdown"



Title: Re: Adding 3rd party hardware
Post by Greg Terrell on Aug 25th, 2018 at 4:02pm
After some folder cleanup, I have the vMicro>>Uploader, both "Burn Bootloader" and "Upload Last Build" working successfully via the J-Link\SWD port.

Steps taken...

  • Created {scripts}\interfaces\jlink.cfg
  • Created {scripts}\boards\mkr1000-jlink.cfg
  • -where {scripts} is C:\Users\GT\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.9.0-arduino6-static\share\openocd\scripts
  • Created mkr1000_jlink.cfg in C:\Users\GT\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.19\variants\mkr1000_jlink\openocd_scripts
  • - by copying arduino_zero.cfg from ..\variants\arduino_zero and changing line 21 to source [find interface/jlink.cfg]


progress, but still no "Microsoft GDB Debugger" option and VM is trying to use the software debugger.

Title: Re: Adding 3rd party hardware
Post by Greg Terrell on Aug 27th, 2018 at 2:05pm
Is the vMicro>>Microsoft GDB Debugger option hard-coded to certain platform\board configurations, such as the Arduino Zero (Programming Port)?

If not, what is the underlying trigger to enable that option on the menu?  Simply adding "debug.tool=gdb" to the platform.txt file is insufficient, at least in certain circumstances.

I know I am being persistent here,  but getting GDB debugging operational is essential for our current project. Although I have a VM professional license, if necessary, I would consider paying for support on this.

Thanks,
Greg

Title: Re: Adding 3rd party hardware
Post by Simon Hopkinson on Aug 21st, 2019 at 10:47am
vMicro now supports a range of additional hardware debuggers out of the box - including the J-Link for the SAMD platform as needed here.

SAMD Debugging: https://www.visualmicro.com/page/SAMD-Debugging.aspx

Debugger List: https://www.visualmicro.com/page/DebuggerSupportList.aspx

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.