Using Arduino for STM32 with Visual Studio 2013

Windows XP,Vista,7,8 and 8.1 etc
skyng22003
Posts: 9
Joined: Wed Apr 29, 2015 9:49 pm

Using Arduino for STM32 with Visual Studio 2013

Post by skyng22003 » Tue May 05, 2015 10:30 am

Arduino for STM32 can be used with Visual Studio 2013,

You will have to download this plugin http://www.visualmicro.com/ for Visual Studio 2013.

If you have Arduino for STM32 working on the Arduino IDE, all you need to do is configure the Visual Micro plugin to point to your Arduino IDE installation folder.

To upload from Visual Studio 2013 you may have to change {runtime.hardware.path} under the Uploading Tools section in the platform.txt which is located in under Arduino_STM32/STM32F"X" directory (X which can be 1, 3 or 4 depending on which processor you are using) to {runtime.ide.path}hardware/Arduino_STM32/tools/win as for some reason {runtime.hardware.path} does not get resolved and thus returns "The system cannot find the file specified"

User avatar
RogerClark
Posts: 7185
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Using Arduino for STM32 with Visual Studio 2013

Post by RogerClark » Wed May 06, 2015 11:14 am

Thanks Sky

I'll take a look.

I'm not sure why you had to change the path, but all will become clear after I've installed VS 2013 community edition etc etc

User avatar
RogerClark
Posts: 7185
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Using Arduino for STM32 with Visual Studio 2013

Post by RogerClark » Thu May 07, 2015 1:52 am

@sky

I did a clean install of VS2013 community edition and installed it, and then downloaded and installed visual micro

However even an empty sketch won't compile

The reason for this is a bug in VisualMicro because they don't support the platform.rewrite.keys function which was added in 1.6.3

The purpose of the platform.rewrite.keys is because the IDE moved where the compiler was located in 1.6.2 and its no longer in program files (x86) its in %appdata% somewhere

what you have done manually is what the IDE does automatically

If you are subscribed to the Visual Micro forum, perhaps you can post to them an issue a bug notification, and get them to read the docs on this, or just send them the platform.rewrite.keys file so that they can see an example of it


The other problem with Visual MIcro for VS is that it doesnt seem to support the sub-menus that are used to select the processor variant or the upload method, and other similar things

Also, I can't see how to upload at all to my STLink adaptor,

Also, it doesn't seem to do code completion for some built in functions like Serial ??


Overall, unless you are a developer that normally uses Visual Studio, that I'd not use this at the moment, as its more trouble than its worth

I think getting Eclipse CDT to work with the Arduino files is probably a better option if you want to use a full featured modern IDE, as Eclipse will give you in-circuit debugging via STLink and GDB

Ps. I copied the compiler to the location visual micro expected it to be, but I now get
Compiling 'Test1' for 'Generic STM32F103C series'
stm32.h:255:2: error: #error "Bad STM32F1 configuration. Check STM32F1 <series\stm32.h> header."
stm32.h:85:2: error: #error "Bad STM32F1 configuration. Check <series\stm32.h> header for your MCU."
stm32.h:255:2: error: #error "Bad STM32F1 configuration. Check STM32F1 <series\stm32.h> header."
stm32.h:85:2: error: #error "Bad STM32F1 configuration. Check <series\stm32.h> header for your MCU."
Error compiling
So I really don't think this one is ready for prime time ;-)

skyng22003
Posts: 9
Joined: Wed Apr 29, 2015 9:49 pm

Re: Using Arduino for STM32 with Visual Studio 2013

Post by skyng22003 » Thu May 07, 2015 10:08 am

Hi Roger, I am still using 1.6.0 that may explain why it still works, I agree with you, if it does not work with 1.6.3 then is probably better to go with eclipse, I never used eclipse before, Visual Studio was just more familiar, any ways, I'll have a go at the eclipse setup.

Thanks!

User avatar
RogerClark
Posts: 7185
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Using Arduino for STM32 with Visual Studio 2013

Post by RogerClark » Thu May 07, 2015 10:29 am

Sky

Ah OK

Yes, it may work with 1.6.0, I don't have that version, and even 1.6.3 has been superseded and I think 1.6.4 is released and 1.6.5 is soon (arrgggh)

If you want to have a go with Eclipse try PM'ing @Rick Kimball as I think he is using Eclipse albeit on Linux

I did install Eclipse on my Windows 7 machine today, but had issues because it needs JDK not just JRE :-(

And I have not managed to work out how to add include paths etc etc

I think there is an Eclipse plugin for Arduino, but I have not investigated it. There is also another Arduino like IDE (but I forget what its called, PM @madias, he knows what the other one is called, but I think its very much like the Arduino IDE and doesnt have the facilities of VS or Eclipse)

PS. If you don't have one already, I'd recommend you get a STLink clone. I'm sure that fairly soon we will sort out in circuit debugging using Eclipse using STLink or perhaps Black Magic Probe (cloned onto a STM32F103C8 board)

Cheers

Roger

mrbwa1
Posts: 91
Joined: Mon Apr 27, 2015 3:36 pm
Location: Buhl, ID
Contact:

Re: Using Arduino for STM32 with Visual Studio 2013

Post by mrbwa1 » Fri May 08, 2015 12:44 am

Have you tried the Preview of Vs Code?

I'm not sure if Arduino support is in the preview, but I am guessing that the final version will have support based on the official partnership.

User avatar
RogerClark
Posts: 7185
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Using Arduino for STM32 with Visual Studio 2013

Post by RogerClark » Fri May 08, 2015 1:02 am

I thought I was using the preview

I've also been contacted one of the guys that has a repo for ESP8266, and Visual Micro doesnt work for that repo either
I posted 2 issues on their forum

But there are loads and loads of problems already

see

http://www.visualmicro.com/forums/YaBB. ... alStudio10

visual_micro
Posts: 2
Joined: Mon May 11, 2015 10:25 am

Re: Using Arduino for STM32 with Visual Studio 2013

Post by visual_micro » Mon May 11, 2015 10:32 am

http://www.visualmicro.com

Visual Micro should now be stable with the new Arduino 1.6.2+ build chain. Unfortunately Arduino did not give prior notice or beta opportunity for some significant changes in 1.6.2 so it was always going to take a few weeks for us to add support.

I am not sure what Roger means by lots of problems? We have an active forum, lots of users and plenty of people attempting to push the limits of non-standard Arduino hardware. http://www.visualmicro.com/forums/

We have not yet tested stm32 but 8266 is working okay so as long at Stm32 sticks to the official Arduino build process it should work okay. Any problems please report in the Visual Micro forum. Thanks

I also urge people to follow the Arduino press and avoid trying to re-invent the wheel. Arduino has a really great Boards Manager and Library Manager, I see Adafruit have not included the 8266 but it would be really great to see Stm32 in the list.

Image

Image

Image

http://www.visualmicro.com

User avatar
RogerClark
Posts: 7185
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Using Arduino for STM32 with Visual Studio 2013

Post by RogerClark » Mon May 11, 2015 10:40 am

@VIsualMicro

Thanks for the update.

I will retest, and perhsps @skyng22003 can also retest if he is still reading this thread.


PS. I know what you mean about the Arduino team making significant changes in 1.6.2 - it caught a lot of people by surprise and should have been released as 1.7 rather than a minor revision.

stuartw
Posts: 36
Joined: Mon Jun 01, 2015 8:57 am

Re: Using Arduino for STM32 with Visual Studio 2013

Post by stuartw » Sun Jun 14, 2015 11:02 am

I have been giving this system a bit of a tire-kicking also..

The roadblock I currently have trouble with is programming.
The STM type programmers dont seem to be supported (st-link, segger j-link), and I cannot
seem to find anyway to even hook the DFU programming.

Perhaps thats just a terminology/setup thing, however I see most of what I would expect otherwise.
I can happily link to my default fastblink and build it (Arduino 1.6), I can select boards, bootloaders, etc
so it does seem to be seeing the STM32duino extensions installed into Arduino, however it wants me to
select use an AVR programmer to program them from what I can tell.

Any thoughts from visual_micro?

Post Reply