Visual Micro - Arduino for Visual Studio

Update: v26 includes enhanced serial tools and the relax patch allowing large programs to be uploaded to the arduino 2560

Update: The Arduino compiler optimisation in Visual Studio has been enhanced.

For those who don't already know, the Visual Studio plugin optimises each compile based upon source code modification dates ensuring that the end result compilation is identical to that produced by the Arduino IDE.

The optimisation means that the plugin “auto detects” changes to files such as libraries, core and code on a board by board basis.

The result is a normal speed first-time compile (of each sketch) with ultra high speed subsequent compilations improving productivity by some magnitude.

An example being a 5 second compilation might be reduced to 0.5 of a second. In the next version it should be a little bit quicker :slight_smile:

http://www.visualmicro.com/page/Arduino-Visual-Studio-Downloads.aspx

Only 1 slight problem... If you don't have the latest and greatest in computers, then Visual Studio 2010 takes all day to get anything done. It is another piece of Microsoft bloatware.(for the record - I am a VB6 and Visual Studio 2000 user) I tried running VS 2010, and AVR Studio 5 and found them both to be agonizingly slow. Visual Studio 2008 isn't much better.

I'm sorry you have to use such slow hardware. I also don't like the fact that every hardware advance is matched by even hungrier software.

On less powerful machines, VS 2010 is slow starting on first use, but then most of the time it opens really fast and other times slowly. In any event, I find VS is faster than Eclipse and the Arduino IDE. Escpecially if you have a lot of sketches in your sketch folder and the serial viewer consumes next to no cpu % whilst Arduino is so heavy it causes my cpu fan to come on.

The best option is to leave VS open (if you can). Once open it works very quickly. I also change my settings not to use the visual studio start page. It seems to connect to the internet to get news etc which slows things down even more.

I guess this plugin is really for more recent office and windows users who seem to find it very useful. The time taken to start vs is compensated some what by the ease and speed of Arduino development inside Visual Studio.

I found AVR Studio especially slow. The plugin has been designed in two parts. The arduino part and the visual studio user interface part. So I always keep a look out for something as functional as VS but faster, that would benefit from the Arduino part :slight_smile:

http://www.visualmicro.com/page/Arduino-Visual-Studio-Downloads.aspx

kf2qd:
Only 1 slight problem... If you don't have the latest and greatest in computers, then Visual Studio 2010 takes all day to get anything done. It is another piece of Microsoft bloatware.(for the record - I am a VB6 and Visual Studio 2000 user) I tried running VS 2010, and AVR Studio 5 and found them both to be agonizingly slow. Visual Studio 2008 isn't much better.

My experience with Visual Studio is that it needs LOTS of RAM.

Years ago when I upgraded from NT4 to Windows 2000 I had to upgrade my laptop's memory from 128MB to 256MB. Windows 2000 took more RAM and Visual Studio 6 no longer had enough memory to fit.

Similarly with Visual Studio 2008 I had to upgrade another laptop, from 1GB to 2GB this time, to prevent swapping and poor performance.

I found a good deal on ebay for second hand memory for my 7 year old laptop :slight_smile:

Perhaps your PC has insufficient RAM to run VS2010?

Iain

Yes I agree with sixeyes, RAM is more important than everything else

Have to say I am liking this!

I have tried other so called plugins to VS before and you end up making all sorts of changes to the config to get it to work. However, I had this up & running in 5 minutes.

I took one of my more complex Arduino 1.0 projects c/w heaps of libraries (some custom written) and it compiled and uploaded first time.

Ian.

Ian, that is good to hear thanks. We have nearly 6000 downloads since October so all functions seem to be working well with Arduino 1.0 and earlier.

For windows users, the serial tools seems to be popular due to their speed and lack of resource hogging, the super fast compile makes development much faster. Personally I like the option to include arduino core and libraries (with auto change detect) in my project(s) and like to develop more than one project within a single IDE.

http://www.visualmicro.com/

It's time for multi-mcu support! Arduino, chipKit, maple etc.

I would appreciate hearing from anyone who has any suggestions for a build.xml that would allow each mcu type to be defined more easily allowing us to support the different flavours.

Example: The xml should describe how to compile for arduino 1.0 and the locations of all 1.0 files, how to compile arduino 0023 and locations, how to compile chipKit and locations etc etc. Obviously we already have 1.0 and 0023- in Visual Studio but this would be a "step up" allowing users to define their own processor types or for the standard product to auto support other processors.

Thanks in advance

I've been working on a makefile for Xcode available at the GitHub repository rei-vilo/mpideOnXCode42.

I own an Arduino UNO board and a chipKIT UNO32 board. chipKIT provides a Processing-based IDE that can handle both platforms, AVR and PIC32.

Inside MPIDE.app, there are two series of folders: one for Arduino, another for chipKIT.

The whole trick is based on the boards.txt files. Each board has a unique tag BOARD_TAG.

The user select a board on a drop-down list: BOARD_TAG is set. This is an Xcode feature: I defined for each board a .xconfig file. For example, the chipKIT UNO32 is defined in the chipKIT_UNO32.xconfig.

The file contains only:

// board specifics defined in .xconfig file
//
BOARD_TAG    = uno_pic32
ARDUINO_PORT = /dev/tty.usbserial*

Main makefile looks on the chipKIT boards.txt first

FLAG = $(shell grep $(BOARD_TAG).name $(ARDUINO_DIR)/hardware/pic32/boards.txt)

If found, FLAG is non-empty and the board is PIC32-based. chipKIT.mk is called.

Otherwise, Arduino.mk is called.

All data are retrieved that way from the right boards.txt corresponding to the selected board.

uno_pic32.name=• chipKIT UNO32
# new items
uno_pic32.platform=pic32
uno_pic32.board=_BOARD_UNO_
uno_pic32.compiler.define=-Danything_you_want::-Danything=1
uno_pic32.ccflags=ffff
uno_pic32.ldscript=chipKIT-UNO32-application-32MX320F128L.ld
# end of new items

# Use a high -Gnum for devices that have less than 64K of data memory
# For -G1024, objects 1024 bytes or smaller will be accessed by
# gp-relative addressing
uno_pic32.compiler.c.flags=-O2::-c::-mno-smart-io::-w::-ffunction-sections::-fdata-sections::-G1024::-g::-mdebugger::-Wcast-align
uno_pic32.compiler.cpp.flags=-O2::-c::-mno-smart-io::-w::-fno-exceptions::-ffunction-sections::-fdata-sections::-G1024::-g::-mdebugger::-Wcast-align

uno_pic32.upload.protocol=stk500v2
uno_pic32.upload.maximum_size=126976
uno_pic32.upload.speed=115200

uno_pic32.bootloader.low_fuses=0xff
uno_pic32.bootloader.high_fuses=0xdd
uno_pic32.bootloader.extended_fuses=0x00
uno_pic32.bootloader.path=not-supported
uno_pic32.bootloader.file=not-supported
uno_pic32.bootloader.unlock_bits=0x3F
uno_pic32.bootloader.lock_bits=0x0F
uno_pic32.build.mcu=32MX320F128H
uno_pic32.build.f_cpu=80000000L
uno_pic32.build.core=pic32
uno_pic32.build.variant=Uno32
#uno_pic32.upload.using=

That way, there's no need to define new files.

Yes i have been looking at what chipKit does and using it a little but your information helps and saves a lot of time thanks. I have been walking the line between just doing what chipkit do or doing something slightly different.

One idea would be to do what chip kit do but with a bit more but it needs to be easy for everyone to develop.

chipKit, maple, arduino, wiring they all seem to have created their own ide based on arduino and/or processing. They all do their own development and in chipKits case are very reliant on a certain arduino format. For example at the moment chipKit doesn't work with arduino 1.0

It is also true to say that some projects are made for arduino 1.0 and others for 23 or earlier. Yes the 23 projects should be updated but why should they if they work. If it ain't broke don't fix it :slight_smile:

I would like users to be able to install the various IDEs of their choice and for Visual Studio to know about them all. So when working with an arduino board we should use the board/compiler files of the arduino ide and with chipkit the pic32 files and so on. Also to provide support for two or more arduno IDEs.

It should be a simple system that allows users to pick a manufacturers ide inside Visual Studio allowing the boards/libs lists/intellisense/compiler etc to be in context with that choice. We currently save the board selection per project now we would also save the ide selection. This would be a seemless update for existing users, no selection would simply default to arduino.

What I hope is that ide might be defined in the build.xml along with information about cores/file locations and compiler/build commands.

We already have different cores under an arduino installation so, right now, it appears that it would be too mch to ask to wait for one of the manufacturers to support all. Hence I feel that a cleaner and easier to document xml file might provide a better alternative?

Interested to hear if this makes sense or any ideas. It might be good for us all to come up with something simple that allows us to test or use plugins based on a common definition in any of our development tools.

visualmicro:
ChipKit, maple, arduino, wiring they all seem to have created their own ide based on arduino and/or processing. They all do their own development and in chipKits case are very reliant on a certain arduino format. For example at the moment chipKit doesn't work with arduino 1.0

Yes, this is really annoying. I hope MPIDE 1.0 to be released soon. As a consequence, I'm still using Arduino 0023.

Anyway, I could modify the makefile so everything related with Arduino is picked from inside Arduino.app.

visualmicro:
It should be a simple system that allows users to pick a manufacturers ide inside Visual Studio allowing the boards/libs lists/intellisense/compiler etc to be in context with that choice. We currently save the board selection per project now we would also save the ide selection. This would be a seemless update for existing users, no selection would simply default to arduino.

[...]

We already have different cores under an arduino installation so, right now, it appears that it would be too mch to ask to wait for one of the manufacturers to support all. Hence I feel that a cleaner and easier to document xml file might provide a better alternative?

I understand the goal better now.

There's a clear need for a centralised file with a list of all the IDEs installed on the computer, so board specifics could be found and loaded easily for build and upload but also for code-sense and other niceties.

Another wanted feature is some sort of debugging. There's an interesting project called Emulare based on avr-debug.

Yes, agree that the chipKit compiler is the most flexible of them all. It might be that the Visual studio plugin will support it shortly just because it's the easiest to implement. I like things that just work :slight_smile:

Debugging and emulator would also be great In visual studio as with xcode. I've been considering Emulare but I would like to look into the emulator that is supplied with the .net microframework (either it's format and/or internal workings). Also, I have had a quick look at the idea behind the processing javascript and android emulators. I am waiting for someone with the skill (or the time) to step forward and help with this :slight_smile:

In terms of debug I understand that it will be available with ARM and others but I don't think it will be available for arduino avr. So I would like a simpler optional system in Visual Studio that is more of an automated real-time reporting system. Much of my mcu stuff is time sensitive, running very fast and outputing pwm etc. in response to sensors and other input. It would be great if a project could include automated serial messages that trigger when a variable changes and/or at certain points (type of breakpoint) in the code. I want things to keep running but I want to easily see in Visual Studio what is going on. I don't want to hack my code to add the debug messages.

So I would like current Visual Studio or XCode solutions to optionally add this type of debuging at compile time based on users clicking about the code to add watches or break/summary points/conditions.

Obviously this might increase program size somewhat so it will not be a solution for everyone. There is no reason why our existing serial listeners could not detect these debug messages and update a watching variable list or provide a stack trace. This would be a high level debug system but would probably provide the information that most users need.

Visual Micro
Download Visual Studio Plugin
Tip: How to get Visual Studio Professional and MS Office for Free

One question: how strongly are you tied with Visual Studio?

The reason behind this question is most Arduino-related IDEs are available in 3 flavours: plain vanilla Windows, crunchy Apple and cold-swimming Linux.

Aside Windows-only Visual Studio or Mac-only Xcode, there are other standards IDEs like Eclipse, NetBeans and alike, which are platform-agnostic —or available in the flavours mentioned earlier.

So picking one multi-platform IDE may save a lot of resources, widen cooperation and broaden audience.

Thank you for your answer.

It's a good question. I know and use visual studio for work and play, as do many of the people who download the visual studio plugin.

I agree that Eclipse and others have the flexibility to run on multiple platforms other than microsoft and believe that those tools appeal to the wider, more experienced and/or more technically capable audience. The Eclipse plugin looks like it's coming along nicely.

Whilst I love Visual Studio, I always have an open mind and as a community it would be great if we could come together and create some better tools.

Whatever gets the job done the easiest, with the most flexibility and that runs the quickest on my computer gets my vote :slight_smile:

ps: It's also a matter of time to learn new tools and how good they really are. It would be nice to focus on one tool but Visual Studio users are difficult users to move!

This may be slightly OT but maybe not.

I'm designing a SAM3U board at present and am adding hardware to allow non-intrusive debugging for time-critical code. Currently I have two pulse outputs and the ability to write eight bits to special header pins. This is all memory mapped so in theory you could output a 32-bit variable in just a few nS with a single assignment using a pointer. The pulse OPs are for critical timing measurements.

At present I intend for this data to be read by a logic analyser and that may be the only option short of also building a hardware debugging device but is there anything I could do to make it more Visual Micro friendly? I doubt it as I guess you really only have access to a serial/USB port but maybe there's something I haven't thought of.

There is JTAG of course, I think you can set data watch points etc with that but what I don't know is if you have to break at that point which is not good for real time code.


Rob

visualmicro:
It would be nice to focus on one tool but Visual Studio users are difficult users to move!

I agree with you. After starting with Turbo Pascal up to release 7 (DOS era, 80's- early 90's), I switched to Visual Basic from release 3 up to release 6 (Windows 95 to NT era, late 90's-early 2000) then went on Xcode (Mac era since 2005).

Although Visual Basic was credited with forging bad programming habits, I get used at all the niceties and comfort that made developper's work easier.

I'm just missing those tools when I use the Processing-based IDEs.

I used Eclipse as I tried to avoid any Microsoft stuff as far as I could. However, all my work is on Windows and I dont jump from OS to OS, It gets confusing for normal people. I did a lot of Linux development but never used it as a desktop.I looked for avery possible alternative IDE just to get my work done without having to fight the tools. When the VS plugin came along, I dumped all the other IDE's (PN, Arduino IDE, Eclipse, UltraEdit, AS5 ). It makes sense to stick to familiar ground and get the job out the door.

@avenue33 Agree, fully!

This may be slightly OT but maybe not.

I'm designing a SAM3U board at present and am adding hardware to allow non-intrusive debugging for time-critical code. Currently I have two pulse outputs and the ability to write eight bits to special header pins. This is all memory mapped so in theory you could output a 32-bit variable in just a few nS with a single assignment using a pointer. The pulse OPs are for critical timing measurements.

At present I intend for this data to be read by a logic analyser and that may be the only option short of also building a hardware debugging device but is there anything I could do to make it more Visual Micro friendly? I doubt it as I guess you really only have access to a serial/USB port but maybe there's something I haven't thought of.

There is JTAG of course, I think you can set data watch points etc with that but what I don't know is if you have to break at that point which is not good for real time code.

That's an interesting one. Would your code be able to send a non blocking serial message at the place where you would put a data watch point? I know you mention serial so maybe not. In that case I can't really think of anything other than using another chip to collect data and forward summary reports as serial messages. but then that's your own data debugger you mention above.

Interesting food for thought, how a plugin or a library might help implement a hardware debugger

At the JTAG data watch point would you be able to send a non blocking serial message?

I don't think so but I know bugger all about JTAG. There is a TRACESWO pin that I think allows you to spit out data but you can only use it by disabling JTAG and using single wire debug (AFIAK).

I think the TRACESWO output can output in standard serial serial format but of course you still have to level shift etc. If you have a SAM-ICE I guess that would handle all that but they are a $100. Pretty cheap but still another $100.

My design should output a byte in < 100nS (whatever the external memory access time will be) so for example a 10-byte a string may take about 1uS to output. That's about as non-blocking as you can get.

Of course this needs a LA to see it but if you are into this sort of debugging you should have one anyway. OTOH a small plug in board could be made to read this data and spit it out a USB port, that would be a $10 high-speed debugging option.


Rob