Arduino Custom Build Events

by Visual Micro 20. March 2017 04:37

Arduino supports many different build events. Visual Micro supports the same events and more. If you can't find an event that meets your needs then please make a request to our forum. Build events are normally placed in the arduino platform.txt system which can be quite convoluted and difficult to test. Licensed users of Visual Micro can opt to use  local project board.txt instead of the usual Arduino locations. The advantage is easier development and testing along with events that are specific to a single project. When making changes to a local board.txt click the "Save" button pior to testing a new build.

The full Arduino build specification is listed here. Visual Micro also provides the following additionl events:-

  • Pre upload event
  • Error during upload event
  • Post upload event (only executes if no error was encountered)

Paste the following into a board.txt to see an attempt to run events. Obviously the example will produce an error because the .bat file will be missing but you will see how it works :)

# before upload event - example

recipe.hooks.deploy.preupload.pattern=cmd.exe /c "c:\hooks_test\test_pre.bat" "{build.path}"  "{build.project_name}" "{build.project_path}"

# upload failed event - example

recipe.hooks.deploy.errorupload.pattern=cmd.exe /c "c:\hooks_test\test_error.bat" "{build.path}"  "{build.project_name}" "{build.project_path}"

# upload complete event - example

recipe.hooks.deploy.postupload.pattern=cmd.exe /c "c:\hooks_test\test_post.bat" "{build.path}"  "{build.project_name}" "{build.project_path}"

Arduino Cross-Platform Library Development

by Visual Micro 16. January 2017 14:09

related: shared project code between projects

draft Jan 16 2017

Visual Micro makes special use of Visual Studio C++ Shared Projects for both project and library development. C++ shared projects were released in Visual Studio 2015 and are improved in the soon to be released Visual Studio 2017.

Shared projects can be created using the standard Visual Studio tool. Visual Micro also provides a simple way to create a shared project for an existing Arduino library.

Shared projects that contain an Arduino library.properties in the root folder are considered to be Arduino Libraries. If the library.properties file does not exist the shared project is considered part of the main project.

The "References" node of a Visual Studio project enables shared projects to be referenced by a master project.

Some of the magic of shared projects is that they do not have a specific architecture. Instead the architecture (intellisense etc) is taken from the "Startup project" of the current Visual Studio solution.

This enables us to develop cross-platform code whilst benefiting from intellisense for a specifc architecture. in fact VS2017RC takes this a step further but that's for another blog.

Using a shared library project is no different to using normal Arduino libraries. In fact they are normal arduino libraries except they also have a .vcxitems file in the library root which simply allows Visual Studio to show the source code during development (in a solution).

Shared library projects must be #included in the code in the same way as a normal Arduino library. The fact that we are using a shared project for development has no bearing on the compilation. The compliation works as normal and compiles the library as it does for all other libraries.

A useful difference between a shared library project and a normal library is that Visual Micro can find the library in any location, not just the published known Arduino library locations. This has many benefits for source control and also versioning.

If you have the paid version of Visual Micro, it is possible to create a shared library project and add it to a solution with a single click.

If you do not have the paid version then do it the long way. Create an empty vcxitems project using "File>New>Project>C++>Misc>Shared Project" and then copy the vcxproj into the required library folder. Click "File>Add>Existing Project" to add the new .vcxitems projects to the current solution.

All users must add a reference to the shared project to the master project(s). Right click the "References" node of a master project in the solution explorer to add the reference to the Shared Project (library). This ensure the intellisense of the shared project will know the correct architecture.

Below are the images of the steps for paid Visual Micro users:-

1) Paid users should switch on "Create a project when adding libraries

 

2) Add a library to a project in the usual manner.

If the project already uses the library it will not cause an issue. If the lib headers are not required in the .ino file you can remove them.

3) After adding a library, the headers will be inserted into the .ino code as usual. In addition, a new project (with the same name of the library) will be added to the currently open solution (if the library project does not already exists in the solution)

So that intellisense can detect the correct platform, a reference is added to all master projects in the solution that use the library.

Right click the References node of a master project and then click "Add Reference"

4) When the Add Reference window opens, cick the "Shared Projects" tab and put a check mark against the library project(s) you want to use in the current master project.

 

Sharing code between projects

by Visual Micro 27. May 2016 18:15

related: share, edit and debug libraries between projects

It's a popular request to share code between Arduino projects. To share code just as if it has been added directly to the project as opposed to using a seperate library.

In Visual Studio use the "Add Existing" options to add existing code from an alternative location. NOTE: Click the "Add as link" option when adding the code.

You should see a link to the source is added to the current project. #include linked code as if it exists in the project folder (without path qualifier).

Below shows #include "UID_DS2401.h" has been included in the sketch code although it exists in an entirely different location ('up two parent folders\Test2').

Note: When the project is compiled any linked sources are copied into the hidden build folder along with the other project sources. This means that a name conflict could occurr therefore all the project sources should have unique names. This method of compile keeps things as close to normal "Arduino code" as possible and should future need arise, the linked sources can be copied locally and then compiled with the Arduino Ide without modifiying the source code.


Tags:

CC3200 SimpleLink Wifi

by Visual Micro 20. January 2016 19:04

Beta notes

The upload failed and was unable to "trigger the bootloader" after n retries

Moving the jumper from Pin 58 Vcc to SOP2 fixed the problem.

This suggestion was from the CC3200 getting started guide

http://www.ti.com/lit/ug/swru376c/swru376c.pdf

Tags:

Arduino 3rd Party Hardware GDB Configuration Guide

by Visual Micro 17. January 2016 17:40

Overview

 

Note: This solution uses the Microsoft MI (gdb) debugger that is installed with the Andoid tools for Visual Studio

 

Visual Micro supports the standard hardware definitions defined by each Ide version. These definitions are usually included in a board.txt and/or boards.txt and/or platform.txt.

 

note: The openOCD path is populated automatically by Visual MIcro and does not need to be installed. Additonal .cfg files can be posted to the forum for inclusion in the releases or added to the "visual micro install path\default\tools\openOCD" folder structure. The install path can be viewed via tools>options>visual micro>version.

 

Please see problem solving tips for developers below.

All PropertiesExample (OpenOCD is installed with Visual Micro)

#boards.txt

[board_name].build.openocdscript=board/[open ocd config file name].cfg

#board.txt

build.openocdscript=board/[open ocd config file name].cfg

#board.txt or platform.txt

debug.tool=gdb

tools.gdb.pre_init.tool=openocd

tools.gdb.cmd=[hardware tool chain gdb.exe]

tools.gdb.path={runtime.tools.[hardware tool chain path}/bin

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.params.verbose=­d2

tools.gdb.openocd.params.quiet=­d0

 

tools.gdb.openocd.pattern="{path}/{cmd}" ­s "{path}/scripts/" ­f "{path}/scripts/{build.openocdscript}" 


The following example is the definition of GDB debugging with OpenOCD for the Texas Instruments Stellaris LM4F/120

 

1) Boards.txt - Provide the name of the OpenOcd .cfg script for the lm4f120

 

# Boards.txt - LaunchPad (Stellaris) w/ lm4f120 (80MHz)

# ------------------------------------------


lplm4f120h5qr.build.openocdscript=board/ek-lm4f120xl.cfg


 

2) Platform.txt - Configure all boards to use OpenOCD+GDB  

 

# Platform.txt - LMF4

# ------------------------------------------

 

# master switch to enable the gdb debug tool

debug.tool=gdb

 

tools.gdb.cmd=arm-none-eabi-gdb.exe

tools.gdb.path={runtime.ide.path}/hardware/tools/lm4f/bin

tools.gdb.pattern="{path}/{cmd}" -interpreter=mi -d {build.project_path}

 

tools.gdb.pre_init.tool=openocd

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.pattern="{path}/{cmd}" -s "{path}/scripts/" -f "{path}/scripts/{build.openocdscript}"


#
# --------------------------------------

note: OpenOCD is optional. v9.0 is currently installed with Visual Micro spo the location will always be the same (as shown below).

Attachment: The attached platform.txt and boards.txt files are the Arduino 1.5 style definitons used by Visual Studio to compile the Energia Stellaris lmf4 core. Both files are optional and are used in combination with the "actual" defintions that might be installed with each Ide.

boards.append.txt (419.00 bytes)

Please submit new defintions that your would like to be distributed with Visual Micro via email or our forum. Arduino 1.0, 1.5, 1.6 formats are supported, all three can be installed at the same time.

GDB and OpenOCD - Problem solving tips - GDB attempts to start but fails with error

Visual Micro installs a small program called MicroGDB.exe. When a Visual Studio GDB session runs it is the MicroGDB.exe program that is loaded/executed.

 

The MicroGDB.exe attempts to run GDB and OpenOCD (when applicable). Theh MicroGDB creates trace files of the various conversations between gdb/microgdb and visual studio. MicroGDb also writes an error trace.


There will be trace files for gdb in the local vs project temp build folder:-

[configuration name]\logs\gdb

which means

debug\logs\gdb

or

release\logs\gdb


If you click Project>Build you will see build without attempt to launch gdb. The start commands will attempt to run GDB.

 

Sometimes after errors configuration errors the OpenOCD, MicroGDB.exe or gdb processes will remain running (see task manager). In this case they need to be manually terminated before a new gdb session can be established.


GDB and OpenOCD - Problem solving tips - GDB running but behaving badly

If the debugger is running but code can not be found or behvour is not as expected.
Use vMicro>Toggle Hidden Files to ensure all sources are available to the debugger
Ensure Gcc optimization is set to the correct value for the code you are trying to debug
Ensure the correct compiler switches for the hadarware being used
Discuss in the visualmicro.com form



Tags:

Energia IDE Stellaris LM4F Hardware Debugging

by Visual Micro 17. January 2016 17:04

18th January 2016 - Draft - GDB Tested with Stellaris Launchpad LM4F 3rd Party hardware authors please read how to add support for more boards here

This initial beta is the first of a new range of Visual Micro GDB debuggers for micro-controllers like Arduino.

This beta still has a few rough edges so please be patient.

Better documentation will follow shortly. Please read the following information before testing. Final release will be simpler and more standard configure.

With this release an "Arduino GDB - beta" project must be created using "File>New>Project>C++>Cross Platform".

Visual Micro must already be installed along with the Microsoft tools described below. Please use the forum for assistance and feedback.

Key features

  • Comatible with .ino source code
  • Debug sketch, libraries and core
  • Step by Line or Instruction
  • Step Over, Step Out
  • Move instruction pointer
  • Set/move breakpoints (3 max)
  • Inspect memory, locals, call stack
  • Disassembly or source navigation
  • Immediate expression evaluator
  • Watch expressions, local expressions, auto expressions
  • Breakpoints, trace points, conditional breakpoin expressions
  • Pin variables during debug sessions. Easily see values. Add notes/comment.
  • Drill down into variables
  • Gdb command tool - optional manual interaction with the debugger (limited testing)
  • Toolchain, ocd and gdb automatic configuration based on the selected Arduino board
  • Automatic/background conversion between cpp and Arduino format .ino source code
  • Auto highlight changed data - Easily see which registers and variables have changed.
  • One button click: Build>Upload>Debug

Overview and Install Instructions

The intial instructions explain how to alpha test the gdb-ino debug tools in Visual Studio 2015.

VS 2015 Community Edition is a free Ide for everyone, except large organizations. Large organizations can use for free for open source projects.

  • Visual Micro uses the standard C++ tools of Visual Studio to provide Arduino programming. The C++ tools are a custom option durng install or at a later date via Control Panel>Add or remove programs.
  • Last year Microsoft added support for Crosss Platform C++ projects in addition to tools for Andoid. The Android tools must be installed in the same way as the C++ tools described above. 
  • In November 2015 Microsoft released the "Microsoft Gdb Debugger" extension into the Visual Studio gallery. The Microsoft Gdb extension is a free download from within the Ide. Click "Tools>Extensions & Updates>Online>Visual Studio Gdb Debugger (by Microsoft)". Or intall from this gallery link
  • Visual Micro is also a free install from within the Ide using "Tools>Extensions & Updates>Online"
  • The Arduino Ide can be downloaded from the respective hardware vendor such as arduino.cc and arduino.org

 

Installing all of the tools descrived above is currently a requirement for the beta gdb tools in Visual Micro. 

Visual Micro is also an extension and can be installed/uninstalled via the Gallery in the same way as the Gdb debugger.

After install a new project template will be available under the "File>New>Project>Cross Platform" and a template called "Arduino Gdb".

You can also create a standard Gdb make project then add an .ino source file of the same name.

Visual Micro should now be managing the project. Select the Energia Ide and Stellaris board in Visual Micro and then test upload.

Uncheck the project from the "Build>Configuration manager" build list. We don't want VS to build just to debug :) Vm will buidl when required.

That is all the setup. The last point must be done once for each new project.

To run the gdb debug use any of the standard Visual Studio "Debug" commands (not the Visual Micro tool bar or menu commands)

Do not use more than 3 breakpoints!! 4 are supported but stepping runs out of steam with 4 and the debug stops responding.

If the debugger locks up then kill the openOCD.exe process in task manager. If it is not loaded then kill the MicroGdb.exe process.

If you can't upload or the board is in a bad state after debug discopnnect and reconnect or kill the OpenOCD.exe windows process if it has remained open.

Know lock up causes are:- 1) Source code out of date 2) Optimization prevents all breakpoints from being recognized 3) The odd strange quirk :)

Known issues

  • Some source code paths are incorrect causing temp folder sources instead of local project sources to open during debug.
  • With "Debug" configuration, .ino line numbers are out by 1. Please use "Release" configuration for the beta
  • Stepping line position a little erratic sometimes see instruction stepping when line stepping was selected.
  • Microsoft are working on a new release with improved visual display and better support for mcu's

Which backend Ide?

Energia 15 or 17

 

Tags:

Arduino.org is now supported

by Visual Micro 16. January 2016 06:30

Announcing Support for yet another Arduino "compatible" Ide, Arduino.org

In some ways the arduino.org ide is slightly behind the arduino.cc ide. This can mean that some newer libraries might fail when you try to use them.

If a library (downloaded from the internet) is not compatible with the arduino.org ide then it will also not be compatible with Visual Micro when the Arduino.org ide is selected.

You will find the arduino.org ide in the Visual Micro <Configuration Manager>. If arduino.cc is already installed on a computer then the .zip download from arduino.org will suffice.

With Visual Micro you can install all Ide's at the same time. It will automatically read and use the configuration of each ide and present the appropriate options.

Tags:

Improve Intellisense Library Discovery And Build Speed

by Visual Micro 14. January 2016 23:32

Jan 2017 - Licenced users have a new Parallel Build option. The option builds all files in each folder at the same time (as usual, only when they need to be built). 

Feb 2017 - All users now benefit from intelligent caching of the library discovery mechanisim described below. The 2nd time a project is compiled will be much faster and even faster the third time. Release compilation is always 1-1.5 seconds faster than debug.

15th January 2016 Visual Micro adopted (optional/default) the Arduino 1.6.6 + gcc based library discovery system.

  • This feature does not assist with intellisense, only with compile. Please read the important note at the bottom of this page about intellisense for Arduino libraries

Overview

The new system allows library authors to reference other libraries without need to #include those libraries in the project_name.ino

An example is the Microsoft AzureIoT Arduino Library that reference the SPI, RTCZero and WiFi libraries.

This new automatic discovery of related libraries is a useful feature for new users but causes significant delay during compilation.

Experienced users can switch off the "library in library" includes discovery by unchecking the "Visual Micro>Deep Library Search" menu item.

The setting is per project. A global setting might be implement in future versions based on user feedback.

The difference in compile time between an empty AzureIot library project 1) with the new Arduino 1.6.6+ system is 7 seconds and 2) without the new system using the older Arduino rexex system.

Using the older system by unticking the "Deep Library search" menu item and then adding #includes for the required libs (to the project_name.ino) will compile in less than 1 second.

 

The following applies to versions of Visual Micro older than 1607.7

Important: Intellisense does NOT use the deep search facility. ALL libraries that are used by the .ino or .cpp code must be #included in the project_name.ino

Viual Micro uses the older regex system to determine includes for intellisense purposes. This is because it can take many seconds to scan library sources which would disrupt the Ide during code writing.

Hopefully as the next few months progress we manage to optimize and add intelligence to the "deep scan" enabling its use for intellisense.

In the meantime, if intellisense is not discovering libraries, please #include any required libraries directly into the project_name.ino code. (Then click Save or Build to force an intellisense refresh)

 

Arduino Zero/M0 Build, Upload and GDB Debugger

by Visual Micro 3. January 2016 19:32

26 July 2016 - New version of Visual Micro Gdb for .ino and .cpp is released - Tested with Arduino ZeroM0 Pro and LM4F

tip: Follow the standard Visual Micro documentation to create new or open existing Arduino projects. Please use the forum for assistance and feedback. Requires the free Android Tools for Visual Studio to also be installed. You can also use board.txt or boards/platform.txt to add new gdb definitions.

Overview

Any visual micro project, with the android tools installed, can now run gdb debug without need for the cross platform projects used previously (still supported). For Gdb, automatic debugging can remain at default state (on).

Selecting the Arduino Zero/M0 (or board with debug.tool defined) and clicking "Debug>Start debugging" will start a GDB debug session. "Debug>Attach To Process" will start gdb without build/upload.


Existing users please note - Older project need a minor update

The Visual Micro new project templates now contain two new properties in the .vcproj files. However existing visual micro .vcxproj files currently need to be updated manually (or deleted and re-created using "file>open>arduino project") before GDB will work.

To edit a .vcproj users can right click a project in the solution explorer then click Unload. Then right click again and click "Edit project.vcxproj". Adding the ItemGroup and PropertyGroup shown below will allow gdb to work. fyi: I added them just prior to the existing <ItemGroup> entries.

Right click the project in the solution tree and select Reload project to reload the project again.

Old .vcxproj update to support gdb. Add the following xml:-
  <ItemGroup>
    <ProjectCapability Include="VisualMicro" />
  </ItemGroup>
  <PropertyGroup>
    <DebuggerFlavor>VisualMicroDebugger</DebuggerFlavor>
  </PropertyGroup>

The gdb docs are out of date and being reworked. This document is currently the most up to date.

  • Visual Micro uses the standard C++ tools of Visual Studio to provide Arduino programming. The C++ tools are a custom option durng install or at a later date via Control Panel>Add or remove programs.
  • To keep the Visual Micro install small we currently use the Microsoft MI debugger that is installed with the Android tools for Visual Studio. If you are unsure how to install Android >>> Control panel>add or remove programs>visual studio 
  • Visual Micro is installed from within the Ide using "Tools>Extensions & Updates>Online"
  • The Arduino Ide can be downloaded from the respective hardware vendor such as arduino.cc and arduino.org
  • Visual Micro no longer expects a special cross platform project type for gdb. Any Visual Studio Arduino project will use gdb debugging if a debug capable (known) board is used. New gdb boards can be added to the config so ask in the forum for more info. 
  • Visual Micro will default to Serial/Usb debugging if a non-gdb compatible board is selected or if Andoid is not installed
  • To compile, upload and start gdb debug click F5 or "Debug>Start Debugging". To start gdb debugging without compile and upload click "Debug>Attach To Process" (ensure a valid arduino sketch program is already loaded on the board)
  • Sometimes debug might fail with an error about a missing or busy "port". To resolve this issue open Task Manager and terminate the OpenOCD process if it exists.
  • Having more than 3 breakpoints can be a problem for many gdb boards so don't use more than 3 otherwise debug will be unstable.
  • We found that every so often gdb doesn't start. It just shows a windows "connecting to localhost:3333". To resolve click cancel and then start the debug again.
  • The reason for requiring the Android tools is because the tools installer also installs the "Microsoft MI Debug Engine". Visual Micro actually only needs the debug engine but currently checks for "Java" debug support to determine if it can run Gdb. In the future we will provide an MI Debug Engine installer that doesn't require Android and at that time the check to determine if GDB can be used will be changed from "Java" to some other check.

Key features

  • Comatible with .ino source code
  • Debug sketch, libraries and core
  • Step by Line or Instruction
  • Step Over, Step Out
  • Move instruction pointer
  • Set/move breakpoints (3 max)
  • Inspect memory, locals, call stack
  • Disassembly or source navigation
  • Immediate expression evaluator
  • Watch expressions, local expressions, auto expressions
  • Breakpoints, trace points, conditional breakpoin expressions
  • Pin variables during debug sessions. Easily see values. Add notes/comment.
  • Drill down into variables
  • Gdb command tool - optional manual interaction with the debugger (limited testing)
  • Toolchain, ocd and gdb automatic configuration based on the selected Arduino board
  • Automatic/background conversion between cpp and Arduino format .ino source code
  • Auto highlight changed data - Easily see which registers and variables have changed.
  • One button click: Build>Upload>Debug

 

NOTE: Compiler optimization can prevent breakpoints from becoming active.

Do not use more than 3 breakpoints!! 4 are supported but stepping runs out of steam with 4 and the debug stops responding.

If the debugger locks up then kill the openOCD.exe process in task manager. If it is not loaded then kill the MicroGdb.exe process.

If you can't upload or the board is in a bad state after debug discopnnect and reconnect or kill the OpenOCD.exe windows process if it has remained open.

Know lock up causes are:- 1) Source code out of date 2) Optimization prevents all breakpoints from being recognized 3) The odd strange quirk :)

Known issues

  • Some source code paths are incorrect causing temp folder sources instead of local project sources to open during debug.
  • Stepping line position a little erratic sometimes see instruction stepping when line stepping was selected (maybe resolved in latest android tools dist).

Which backend Ide?

Use arduino.cc Ide for the Zero and use arduino.org for M0 Pro. You can experiment with burning new bootloader onto M0 board but it's not tested so at your own risk (see www public blogs for more info)

Please note: The IoT and Wifi examples mentioned in this document do not currently (15th Jan 2015) work with the Arduino.org backend ide.

 

How to change Arduino code fonts and colors

by Visual Micro 2. December 2015 12:17

Visual Studio provides a large list of syntax color and font choices. This document is an example of how to configure these options. This document is work in progress so please help and submit your syntax color schemes to the forum

The "Tools>Options" menu allow current settings to be exported (and imported) which is a good way to backup your settings and to try different collections of settings :) Please see the example below of your to backup your settings.

download this example

note: the prototype in the above code example is not valid for standard users!

note: Commonly only the following options are not within of the C++ options list:-

  • Keyword
  • Preprocessor Keyword

Tools>Options

How to backup your Visual Studio Settings

Use the "Tools>Import and Export Settings" menu to access the wizzard. Save where prompted or in some other location that can be easily found in the future.

 

Tags:

Advanced Arduino - Local Libraries and Sub Folders Structure

by Visual Micro 24. October 2015 17:17

This is intial document providing example of the different source code folder structures that can be applied to Arduino projects

The only rule concerning structure is that the master .ino source code must reside in the project folder. Both must have the same name.

Linked source code files are also support. Project referenced are not yet supported.

.ino code file names do not need to be #included in any source files

.ino files are combined into a single temp folder .cpp during compile, prototypes are automatically created for .ino code unless "auto prototypes" =False in the project properties.

If .ino files are "linked" from other projects they must not contain duplicate method names such as "setup()" and "loop()"

Source from outside of the project can not be debugged (yet)

Local libraies override all other library repositories. For example copying the EEPROM library to a local sketch libarary will ensure the local version is always compiled.

Known issue: Click build clean after moving files or folders within the solution explorer.

Arduino.org in Visual Studio and Atmel Studio

by Visual Micro 17. October 2015 20:38

Support for Arduino.org in Visual Studio and Atmel Studio

Arduino.org maintain a single Ide installation for all current Arduino boards, so its easy get up and running and it makes sense for Visual Micro to support it.

Visual Micro also provides simple tools enabling Libraries to be create or installed.

Tip: If the arduino.org ide is not installed, the Visual Micro "Configure Ide Location" dialog provides a link to the following ide download page


note: Visual Micro enables both the arduino.cc and the arduino.org Ide's to be configured at the same time allowing users to switch between the different features and tools provided by each Ide.

Tags:

Three new useful things in Visual Studio 2015

by Visual Micro 6. October 2015 06:09

Visual Studio 2015 comes with many new features and improvements in the IDE, the debugger or language compilers. Obviously, there are more than three things I like in the new IDE, but three things have caught my attention from the very beginning.

The Error Window

vs2015error1
One of the things that bothered me the most about the error window was the mixture of errors/warnings/messages from both MSBuild and IntelliSense. But I don’t usually care about the later and their presence in the error window is usually annoying me. This is now fixed and you can select to see messages from Build, IntelliSense or both.
vs2015error2
In addition to this you can apply even more filtering:

  • You can select the source of the messages: Entire Solution, Current Project, Open Documents or Current Document.
    vs2015error3
  • You can search the error list, and the search includes the text in all the output list columns (Code, Description, Project, File or Line).
    vs2015error4
  • You can individually show or hide Errors, Warnings and Message (but this feature has been available for many years).

The Find in Files Append

I’m working with large source bases and I often need to do find in files, usually going from search to search until I find what I need. The problem was there were only two output windows for the search results and when you need to do a 3rd you had to discard one of the previous searches while you might still needed the results. I have requested for many years that Visual Studio should support more than two find results windows. I actually created a User Voice request a few years ago.

In Visual Studio 2015 they have implemented an append feature, were you could append your search results to one of the existing two windows.

vs2015find1

As a result the old search results are not discarded, but aggregated in a the form of a tree list in the search results window.

vs2015find2
vs2015find3

Though this is not what exactly I was expecting it provides the feature I was looking for with probably minimal changes to the Visual Studio IDE.

The Inline Create Definition (for C++)

I’m not sure how this feature is actually called, but what it does is creating a definition for a function in the source file from the declaration in the header and displays it in a boxed document inside the header document. Here is an example:

You declare a function/method in a header file. Visual Studio figures out the definition is missing.
vs2015inline1
Use the Quick Actions (CTRL + .) to create a definition of the symbol in the source file.
vs2015inline2
The definition is added to the source file that is opened as a document in a box just below the function declaration.
vs2015inline3
I find this very useful to get going with a new function. Of course for writing larger functions you’ll probably switch to the actual document tab where the source file is opened.

With these new features only Visual Studio has become much more productive for me. And there are plenty more.

 

source: http://mariusbancila.ro/blog/

Arduino Debug With Charts and Graphs

by Visual Micro 16. August 2015 02:17
Breakpoint support for the @Plot command is available in the Pro version of Visual Micro. The Arduino program code does not need to be edited simply add a {@Plot} instruction to the break/trace point "action" message.

Multiple Arduino plot with tick marks

breakpoint action message to plot variables l1 and l2:- {@Plot.Thunderbird-4.SeaLevel.Diamond l1}{@Plot.Thunderbird-4.Atitude.VDash l2}

  • New Breakpoint Command language, free upgrade for Pro users
  • Arduino code does not change
  • Simple tracepoint command syntax
  • @Create your own commands and open source visualizations or use the provided @Plot example ...
  • @Plot to a single graph per window or multiple graphs per window.
  • @Plot single or unlimited windows.
  • @Plot in colors of choice or that make sense (eg: same as wiring colors)
  • @Plot with tick marks or without
  • @Plot with labels
  • @Plot also includes automatic sliding time window and automatic min/max Y axis
  • Open source examples, easy to extend and create new graphical control types
  • Freeze display
  • Easily see current values
The example below shows the Breakpoint "When Hit" syntax required to display a graph or Motor1 and Motor2 in a "Motors" window and a single @Plot into a window called MyAnalog
Plot unlimited graphs without hacking any Arduino code. Add graphs names, single or multiple plots per window, unlimited windows


 

Tags:

Arduino for Visual Studio 2015

by Visual Micro 3. August 2015 10:35

news 3rd August - Visual Micro BETA for Visual Studio 2015 has been released as an Extension in the Visual Studio Gallery

This is initial draft documentation for the Visual Micro beta extension. This version of Visual Micro has been changed from add-in to extension.

The Visual Micro main menu provides quick access to most Arduino features in Visual Studio

Please download from the extension downloads page. It is currently a zip containing a .vsix file. Double click the vsix to install Visual Micro into Visual Studio.

After installation "Tools>Extensions and Updates..." can be used to update or uninstall Visual Micro

In this version tool bars are not shown by default. There are also more bars available in the Visual Micro extension than in previous releases.

Tip: Right click the tool bar area to see the "Arduino" tool bars.

Multiple tool bars can be controller by users for an ideal Arduino programming environment

please note: the 'Standard' bar shown as the lowest bar in the image above is not included in the current beta

In this Extension version of Visual Micro the visibility of tool bars can be specified in two modes.

1) With no projects open

2) With one or more projects open

All primary features are available on tool bars and the "Visual Micro" top menu. The "Visual Micro" menu replaces and extends the functinality found on the "Tools>Visual Micro" menu of previous releases.

The "Add Library" tool bar is available when Arduino project(s) are open

Arduino libraries are easily used in a Arduino project

New Projects can be created using various templates in the Visual Studio "New Project" wizard.

New templates can be added to the list simply by clicking "Add Template" in any Arduino project.

Ready to use project templates provide quick ways to create and test new Arduino projects

 

A Windows 10 IoT project template is installed and "ready to go".

Create a new project based on this template. Upload to your board and you have a Window IoT device!!

A ready to use Windows 10 IoT for Arduino is included with the Visual Studio extension

 

Tags:

Install Arduino DUE and Arduino ZERO in Visual Studio or Atmel Studio

by Visual Micro 25. July 2015 08:06

Since the release of Arduino 1.6.2 the 32 bit boards mnuch be installed using the Arduino Board Manager tool. The Arduino Board Manager will download and install the relevent sources enabling compile and upload to an Arduino Due or Arduno Zero using Visual Studio or Atmel Studio.

The Arduino Board Manager tool allows new hardware to be installed into the Ide such as 32 bit Arduino Due and Zero boards

 

Arduino Community Joins Visual Studio Community

by Visual Micro 30. May 2015 16:44

Micro-controller circuit board manufacturers Arduino, Sparkfun, Adafruit and the entire community have joined together to make installing and programming micro-controllers much simpler. Previously different files and instructions had to be discovered from various places on the web, then downloaded and installed.

Arduino.cc have designed and included a tool in their development software called a 'Boards Manager'. The Boards Manager provides a simple way to see and install available hardware. The hardware is discovered from .json file(s) that are located under the arduino ide folder. The files contain definitions for avr and sam (arduino uno, arduino due boards)

The Boards Manager is supported with a free respository (managed by arduino.cc) that enables any software author to register (and make available for programming) packages of hardware and software tools.

Arduino have been bold and allowed competitive hardware manufacturers to also use the system, this provides a great facilioty for us all! Therefore, the facility also exists to add additional urls of package.json files that contain the software tools to build programs for different types of Arduino compatible hardware. This can be Arduno clones or entirely different hardware. For example sparkfun boards, adafruit boards, intel boards or the new esp8266 $5 programmable wifi server.

For more information about how to add your own .json urls please see the viaual micro "Ide locations configuration window" or the "arduino ide" file>preferences window. Both Visual Studio, with Visual Micro installed, and the arduino ide use the same system. Some arduino.cc approved thrird party urls are located on ths page

The list of urls shown at the bottom of this page result in the ability to install any of the hardware (and more) shown below. A clever design by Arduino.ccFederico Fissore and the community.

Microsoft Visual Studio management tool for Arduino Community hardware

 

Arduino 1.6.5 AVR Package Released

by Visual Micro 25. April 2015 19:07

News: The Arduino 1.6.5 Avr core has been released and is available in the Boards Manager

note: old image shows 1.6.3 but when you open the Boards Manager in Visual Micro you can also choose later Arduino versions such as 1.6.4 and 1.6.5

Tags:

Visual Micro for Arduino 1.6.3

by Visual Micro 19. April 2015 23:33

The latest Arduino Ide for Visual Studio (v1504.20) contains support for Arduino 1.6.2+. This includes integration to the new Arduino Boards and Library Management System which provides access to various hardware cores and third party libraries.

Boards Manager read more


Library Manager read more

Global library keyword filtering with statistics

Useful information panel with links and status reporting

Visual Micro's implementation of the Arduino Boards and Library Management System is delivered through a new updated "Visual Micro Explorer" tool. The tool is, as with previous releases, accessed using the yellow question mark to the right of the boards tool bar list or the "Tools>Visual Micro" menu.

The existing elements of the Visual Micro Explorer provides a number of other new features such as one click switch board or import library to the currently open sketch. 

Search for boards by name, register new IDE locations, view the documentation and other useful features such as more informative tool tips.

The Micro Explorer also now includes information and short-cuts to important Arduino configuration and source folders via windows explorer. This is useful for advanced users but also for new users to confirm the correct locations.

Aside form the hardware and library download and version management system, it is also now possible to install both libraries and boards directly from Zip files. Links are provides in the Visual Micro Explorer to these features and also from the standard "Project>Add/Import Sketch" Library menu available when editing an open sketch.

Installation for new users is easier. The prompt to start a debugger trial has been removed, instead a trial is automatically started. Invalid IDE location config data is more easily identified in both the tool bar and the Visual Micro Explorer.

 

Tags:

How to create collapsible regions in Arduino code

by Visual Micro 8. April 2015 15:02
#pragma region lets you specify a block of code that you can expand or collapse when using the outlining feature of the Visual Studio Code Editor
#pragma region name
#pragma endregion comment

Parameters

comment(optional)

A comment that will display in the code editor.

name(optional)

The name of the region. This name will display in the code editor.

Remarks

#pragma endregion marks the end of a #pragma region block.

#region block must be terminated with #pragma endregion.

Example

// pragma_directives_region.cpp
#pragma region Region_1
void Test() {}
void Test2() {}
void Test3() {}
#pragma endregion Region_1

int main() {}