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....
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
Adding 3rd party hardware (Read 958 times)
Greg Terrell
Junior Member
**
Offline



Posts: 22
Adding 3rd party hardware
Aug 24th, 2018 at 9: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...,

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
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10143
United Kingdom
Re: Adding 3rd party hardware
Reply #1 - Aug 25th, 2018 at 12:55pm
 
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

Back to top
 
WWW  
IP Logged
 
Greg Terrell
Junior Member
**
Offline



Posts: 22
Re: Adding 3rd party hardware
Reply #2 - Aug 25th, 2018 at 1: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
Back to top
« Last Edit: Aug 25th, 2018 at 1:15pm by Greg Terrell »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10143
United Kingdom
Re: Adding 3rd party hardware
Reply #3 - Aug 25th, 2018 at 1: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.
Back to top
 
WWW  
IP Logged
 
Greg Terrell
Junior Member
**
Offline



Posts: 22
Re: Adding 3rd party hardware
Reply #4 - Aug 25th, 2018 at 2: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"


Back to top
 
 
IP Logged
 
Greg Terrell
Junior Member
**
Offline



Posts: 22
Re: Adding 3rd party hardware
Reply #5 - Aug 25th, 2018 at 5: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-arduino
    6-static\share\openocd\scripts
  • Created mkr1000_jlink.cfg in C:\Users\GT\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.19\varian
    ts\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.
Back to top
 
 
IP Logged
 
Greg Terrell
Junior Member
**
Offline



Posts: 22
Re: Adding 3rd party hardware
Reply #6 - Aug 27th, 2018 at 3: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
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print