VS Arduino
Visual Micro >> Ideas, Suggestions and Related Tools >> Can we save settings for each board?
https://www.visualmicro.com/forums/YaBB.pl?num=1565167340

Message started by carnı on Aug 7th, 2019 at 8:42am

Title: Can we save settings for each board?
Post by carnı on Aug 7th, 2019 at 8:42am
Just another question connected with PlatformIO, I used it for some time now, but want to switch over to VM.

I mostly connect several different Arduinos and the like with each other, so I need a
Project Configuration File for every Device and Project, to share their specific settings more easily (like baud rate, IC Type, com Port ect.)
https://docs.platformio.org/en/latest/projectconf.html

I couldn't find an equivalent platformio.ini a file or documentation for it in VM. Can I write the same settings for my devices and their code solutions in their respective "Header Files" folder? Or would that be somewhere else?

Of course is just want the switch to the project code with their respective device settings and just click upload and not set up the respective device settings every time I upload code to a different device.

Title: Re: Can we save settings for each board?
Post by Visual Micro on Aug 7th, 2019 at 10:20am
Visual Micro automatically stores many settings per board and project. This includes the board options and selected programmer. The debugger selection is stored per board/project and configuration.

You should try this and let us know anything that is not retained per board that you need.

There is also a menu item vMicro>General>Save board. port, programmer per configuration. You should also try this out.

A configuration is the Release/Debug drop down list. You can add new configurations by clicking the <New> in the list. This makes it possible to create a configuration called, for example, "My AVR 2" and then all the options are saved as above but also for "My AVR 2". This means that instead of altering a configuration file you simply switch to the configuration name you have created in the drop down list.

There are also the F4 project options which allow you to specify your own defines and compiler flags globally for the project or for the currently selected configuration.




Title: Re: Can we save settings for each board?
Post by carnı on Aug 7th, 2019 at 11:54am
Thank you for the very quick answer and sorry for not creating a new forum thread first.

And thanks for the suggestions, Ill try them out and update how things went here .

Title: Re: Can we save settings for each board?
Post by carnı on Aug 7th, 2019 at 1:12pm
Ok, so I tried it and it does not seem to work, I probably miss something here.

Even though I have "Save Board, Port and Programmer for Each Configuration" active, it does not change the board when I click on another *.ino file to upload it to its respective board. The Upload message also indicates it loads to the wrong board (for example, it seems upload to a Nano even though it should upload to an Uno)

F4 Project options do not seem to have any board selection. Also if I select A port here, and another one for the other .ino file, it just overwrites the different port on the first project. I want them to have/use different ports.

Does the boards.txt may be provide a solution for this?

Also on some .*ino files it just closes the VM toolbars. When I try to get them back they just show up for a second and disappear again.

Title: Re: Can we save settings for each board?
Post by Visual Micro on Aug 7th, 2019 at 1:23pm
I think you just need to step back slightly and first study how the ide works.

It sounds like you are just opening random .ino files and not allowing a visual studio project to be created for each sketch.

In Visual Studio we have a Solution that can contain one or more projects. We can have as many solutions as we like. In your case I suggest you just have one Solution but add two projects to it...

I suggest you click "File>Close Solution" to have empty IDE or the default Solution with nothing in it.

Then click File>New>Arduino project. There are lots of ways to create an arduino project but this is good for our test.

Now you have a Solution with one project in it.

Next, click File>New>Project again and make a second project in the solution.

You now see two projects in your Solution each with one .ino file.

Clicking one .ino file so that it appears in the editor and setting the board (you must select the board in a project to fix it to the project, otherwise we always use the last selected board which can change)

Click the other .ino file so that is appears in the editor, select the desired board.

Now click between the two .ino files and you see the board change.

Do the same for the port. Open/activate the code from different projects and select your port.

Now you should have a board and port saved per project.

If you want to create a project for an existing arduino project then click File>Open>Arduino project. This automatically creates a visual studio project is needed, adds the .ino and other code to the project and then adds the project to the current Solution (or creates a solution for you)

For more information please follow the first steps in our document here https://www.visualmicro.com/page/User-Guide.aspx?doc=index


In Visual Studio do not use "file>open file" to open an .ino unless you just want to view or edit it as a simple text file, without visul micro help.

The rules are that the project, an .ino and the containing folder all have the same name for visual micro to be active. This ensures you have an arduino ide compatible structure to your code. The .ino files can be on the project\sketch folder or in a sub folder calledd \src (same as arduino ide rules)



Title: Re: Can we save settings for each board?
Post by carnı on Aug 7th, 2019 at 1:58pm
Great, everything works, it changes now to the right board, when I click on another .ino file.

Thank you for the quick support, we are considering 3 licenses now for the company I work for.

Title: Re: Can we save settings for each board?
Post by Visual Micro on Aug 7th, 2019 at 4:07pm
Great, thank you.

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.