Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Adding custom board support (Read 1201 times)
AustinLindquist
Junior Member
**
Offline



Posts: 5
Adding custom board support
Aug 1st, 2018 at 12:25am
 
I'm trying to follow the tutorial here but have some questions
https://www.visualmicro.com/post/2016/01/17/3rd-Party-Hardware-GDB-Configuration...

I modified my boards.txt and platform.txt for my board package. On compiling I get this error:
Quote:
dsfafdsaafdsafsd.ino: In function void setup()
   void setup()
dsfafdsaafdsafsd.ino:8: note  candidates are
Error compiling project sources

   Debug Build Error: This hardware might not support the default Visual Micro Debugger.
     If this project is using OTA/WiFi upload then please use the vMicro>Debugger menu to set the Serial COM and Remote port for the debugger.
     Otherwise switch the toolbar from 'Debug' to 'Release' and build again.
           or switch off Automatic Debugging
           or configure the SoftwareSerial debugger option.
Debug build failed for project 'dsfafdsaafdsafsd'
dsfafdsaafdsafsd.ino:8: In file included from
   void begin(Serial_ *theSerial)
   void begin(Serial_ *theSerial, unsigned long baud)


This is a new project with empty setup() and loop() functions.
Back to top
« Last Edit: Aug 1st, 2018 at 1:11am by AustinLindquist »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 9560
United Kingdom
Re: Adding custom board support
Reply #1 - Aug 1st, 2018 at 4:15pm
 
Gdb is in beta/preview so might be hard work for most. If you have installed and configured then you should have a "vmicro>debugger>use gdb" which will cause the "Automatic Debugger" to be disabled.

The errors you see are the standard visual micro serial debugger attempting to load which is not what you want.
Back to top
 
WWW  
IP Logged
 
AustinLindquist
Junior Member
**
Offline



Posts: 5
Re: Adding custom board support
Reply #2 - Aug 1st, 2018 at 8:33pm
 
I have the GDB extension installed as well as the android tools. I don't have "Use GDB" as a menu option, what should I check?
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 9560
United Kingdom
Re: Adding custom board support
Reply #3 - Aug 3rd, 2018 at 8:25pm
 
Sorry the menu item is "vMicro>Debugger>Microsoft GDB Debugger"

If you switch the board to "Arduino Zero (Native)" does the menu item appear?
Back to top
 
WWW  
IP Logged
 
AustinLindquist
Junior Member
**
Offline



Posts: 5
Re: Adding custom board support
Reply #4 - Aug 14th, 2018 at 8:50pm
 
It appears for the (Programming Port) variant.

My config file is located in: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\mh2uhnsb.yka\Micro Platforms\default\tools\openocd-0.9.0\scripts\board

My gdb client is located in C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\mh2uhnsb.yka\Micro Platforms\default\tools\arm-none-eabi-gcc\4.8.3-2014q1\bin

fx450_gdb.cfg:
Code:
source [find interface/cmsis-dap.cfg]
set CHIPNAME at91samd21g18
set ENDIAN little
source [find target/at91samdXX.cfg]
 



boards.txt:
Code:
ae_fx450_gdb.name=FX450 (GDB)
ae_fx450_gdb.vid.0=0x239A
ae_fx450_gdb.pid.0=0x800B
ae_fx450_gdb.vid.1=0x239C
ae_fx450_gdb.pid.1=0x000D
ae_fx450_gdb.upload.tool=openocd
ae_fx450_gdb.upload.protocol=sam-ba
ae_fx450_gdb.upload.maximum_size=262144
ae_fx450_gdb.upload.use_1200bps_touch=true
ae_fx450_gdb.upload.wait_for_upload_port=true
ae_fx450_gdb.upload.native_usb=true
ae_fx450_gdb.build.mcu=cortex-m0plus
ae_fx450_gdb.build.f_cpu=48000000L
ae_fx450_gdb.build.usb_product="FX450"
ae_fx450_gdb.build.board=FX450
ae_fx450_gdb.build.core=fx450
ae_fx450_gdb.build.extra_flags=-DARDUINO_SAMD_ZERO -D__SAMD21G18A__ -mthumb {build.usb_flags}
ae_fx450_gdb.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
ae_fx450_gdb.build.openocdscript=board/fx450_gdb.cfg
ae_fx450_gdb.build.variant=fx450
ae_fx450_gdb.build.variant_system_lib=
ae_fx450_gdb.build.vid=0x239E
ae_fx450_gdb.build.pid=0x800E
ae_fx450_gdb.bootloader.tool=openocd
ae_fx450_gdb.bootloader.file=fx450/samd21_sam_ba.bin 



platforms.txt:
Code:
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={runtime.vm.ide.platforms.path}/default/tools/arm-none-eabi-gcc/4.8.3-2014q1
tools.gdb.pattern="{path}/{cmd}" ­interpreter=mi ­d "{build.project_path}"
tools.gdb.openocd.cmd=bin/openocd.exe
tools.gdb.tcp=localhost:3333
tools.gdb.openocd.path={runtime.vm.ide.platforms.path}/default/tools/openocd­0.9.0
tools.gdb.openocd.pattern="{path}/{cmd}" -s "{path}/scripts/" -f "{path}/scripts/{build.openocdscript}"
tools.gdb.openocd.params.verbose=­d2
tools.gdb.openocd.params.quiet=­d0

tools.gdb.tcp=localhost:3333
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 

Back to top
« Last Edit: Aug 15th, 2018 at 11:06pm by AustinLindquist »  
 
IP Logged
 
Greg Terrell
Full Member
***
Offline



Posts: 22
Re: Adding custom board support
Reply #5 - Aug 16th, 2018 at 8:51pm
 
Visual Micro wrote on Aug 3rd, 2018 at 8:25pm:
Sorry the menu item is "vMicro>Debugger>Microsoft GDB Debugger"

If you switch the board to "Arduino Zero (Native)" does the menu item appear?


Tim, where in the configuration path does the above setting trigger Microsoft GDB Debugger to turn on (enable)?

I am working on enabling GDB via a Segger J-LINK for a MKR1000 (initially), step 2 is an Adafruit M0.  So far I have cloned the MKR1000 section from boards.txt (board code "mkr1000_jlink" for new config section Arduino/Genuino MKR1000 (w/ J-Link)).  But as you suggest, the Microsoft GDB Debugger only appears when the target board is Arduino/Genuino Zero (Programming Port).

I see our steps as...
  • Enable Microsoft GDB Debugger with our new boards.txt section
  • Connect to Segger via OpenOCD (learned how yesterday)
  • Retarget the Segger GDB server (instead of OpenOCD, for additional logging features)
  • Test, fix, test, fix, etc.


But the critical 1st step is identifying where in the config structures the Microsoft GDB Debugger is enabled.
Back to top
« Last Edit: Aug 17th, 2018 at 1:32pm by Greg Terrell »  
 
IP Logged
 
AustinLindquist
Junior Member
**
Offline



Posts: 5
Re: Adding custom board support
Reply #6 - Sep 6th, 2018 at 10:12pm
 
Bump!
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 9560
United Kingdom
Re: Adding custom board support
Reply #7 - Sep 7th, 2018 at 11:35am
 
Sorry I have been busy. Will try to look at this asap. Gdb always takes a lot of time to look at so it can't be priority right now
Back to top
 
WWW  
IP Logged
 
Greg Terrell
Full Member
***
Offline



Posts: 22
Re: Adding custom board support
Reply #8 - Sep 13th, 2018 at 3:54pm
 
Tim, is GDB a lower priority or unsupported? 

I understand, as a small organization, support resources being stretched and responses will not be immediate.  But I am seeing threads just end abruptly on this topic and in another thread your statement...

Visual Micro wrote on Sep 8th, 2018 at 12:12pm:
Hi,

There has been a lot of changes in the IDE's in relation to GDB. It will be re-done over the coming months.

In the meantime I am sorry that there is no support time available to help people with GDB .

I suggest looking for an alternative or use the serial debugger

Thanks



The VM software-based debugging is not cutting it for our needs as we support our customers using our libraries. We have invested quite a few hours over the last several weeks getting openOCD functional with our Segger hardware and the target boards. We have used the VM burn bootloader functionality (via the J-Link) and the last hurdle is simply why VM won't recognize the settings as spelled out in your documentation to enable vMicro>>Debugging>>Microsoft GDB Debugger.

#board.txt or platform.txt
debug.tool=gdb


If there is no support for GDB with Visual Micro, I regrettably will have to migrate off of Visual Micro to another toolset, most likely Platform IO. Given that we have been using VM for two years and built processes around Visual Micro this is not something I am looking forward to but I can't wait months.

Sorry to be so direct,
Greg
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 9560
United Kingdom
Re: Adding custom board support
Reply #9 - Nov 17th, 2018 at 5:02pm
 
Hi,

Sorry for the delay, i missed this post for some reason. Library debug is available in the next release but GDB has been a lower priority.

GDB is difficult to implement as a common solution in older visual studio versions which we still support (such as vs2012 and 2013).

It has been announced over the past few months that support for the older ide versions will end then we will re-look at supporting GDB.

It's being considered to support PlatformIO in addition to Arduino in the future so it makes sense to go whatever way works best for you.
Back to top
« Last Edit: Nov 17th, 2018 at 5:03pm by Visual Micro »  
WWW  
IP Logged
 
AustinLindquist
Junior Member
**
Offline



Posts: 5
Re: Adding custom board support
Reply #10 - Jan 10th, 2019 at 5:34pm
 
Any news on this?
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 9560
United Kingdom
Re: Adding custom board support
Reply #11 - Jan 11th, 2019 at 5:29pm
 
There is some news. Visual Studio 2019 SP2 will break compatibility with VS2012 and VS2013. This forces us to either drop support for the older IDE's or create a 2nd slightly different version of Visual Micro to cater for both IDE types.

It has been VS2012 and VS2013 that has held back the ability for Visual Micro to integrate a simple and tightly integrated GDB solution.

Therefore, time allowing, over the next few months we should see some leaps in Visual Micro.

Back to top
 
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print