Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Board type for a project (Read 10723 times)
sixeyes2
Junior Member
**
Offline


Posts: 93
Location: Guildford, United Kingdom
Joined: Dec 19th, 2011
Board type for a project
Feb 16th, 2012 at 1:24pm
Print Post  
Would it be possible to associate a board type with a project?

I'm currently working with both Arduino Megas and Nanos. They need different board settings, but each project is only destined for a specific board. If I could associate this with a project (in project settings perhaps) this would save me having to flip the toolbar setting when changing projects.

Iain
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Board type for a project
Reply #1 - Feb 16th, 2012 at 2:13pm
Print Post  
It already associated the selected board with a project so we need to understand what is going wrong for you.

Test Please

Add/create two arduino projects to a single solution. Click each project then select the board. Then selected build solution. "Does this build each project for a different board?"
  
Back to top
WWW  
IP Logged
 
sixeyes2
Junior Member
**
Offline


Posts: 93
Location: Guildford, United Kingdom
Joined: Dec 19th, 2011
Re: Board type for a project
Reply #2 - Feb 16th, 2012 at 2:57pm
Print Post  
I'm currently running with one project per solution. I was hoping when loading a solution it would use the board defined when that solution was last loaded.

Iain
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Board type for a project
Reply #3 - Feb 16th, 2012 at 3:27pm
Print Post  
Yes it is supposed to be doing that. Please add a codeplex issue and i will fix for next release

Workaround

Add both projects to a single solution I think it will save and load the board correctly then. 

Right mouse click a project name and "Set as startup project" to elect the project for F5 upload (shown in bold)

Does that work for you?
  
Back to top
WWW  
IP Logged
 
sixeyes2
Junior Member
**
Offline


Posts: 93
Location: Guildford, United Kingdom
Joined: Dec 19th, 2011
Re: Board type for a project
Reply #4 - Feb 16th, 2012 at 5:00pm
Print Post  
Tim@Visual Micro wrote on Feb 16th, 2012 at 3:27pm:
Yes it is supposed to be doing that. Please add a codeplex issue and i will fix for next release

Done

Quote:

Workaround

Add both projects to a single solution I think it will save and load the board correctly then. 

Right mouse click a project name and "Set as startup project" to elect the project for F5 upload (shown in bold)

Does that work for you?

Yes it does.
  
Back to top
 
IP Logged
 
sixeyes2
Junior Member
**
Offline


Posts: 93
Location: Guildford, United Kingdom
Joined: Dec 19th, 2011
Re: Board type for a project
Reply #5 - Feb 16th, 2012 at 5:06pm
Print Post  
Interesting. After adding the Nano project to the solution, the following lines were added to my project file:
Code
Select All
		<Global
			Name="arduino.board.desc"
			Value="Arduino Nano w/ ATmega328"
		/>
		<Global
			Name="arduino.board.name"
			Value="nano328"
		/>
		<Global
			Name="arduino.board.property_bag"
			Value="nano328.name=Arduino Nano w/ puts&#x0D;&#x0A;"
		/>
		<Global
			Name="arduino.build.core"
			Value="arduino"
		/>
		<Global
			Name="arduino.build.f_cpu"
			Value="16000000L"
		/>
		<Global
			Name="arduino.build.mcu"
			Value="atmega328p"
		/>
		<Global
			Name="arduino.upload.maximum_size"
			Value="30720"
		/>
		<Global
			Name="arduino.upload.protocol"
			Value="arduino"
		/>
		<Global
			Name="arduino.upload.speed"
			Value="57600"
		/>
 



When I load this project now (even though it's on its own) it does switch the board type. I'm guessing none of my projects have these settings in their project files.

Iain
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Board type for a project
Reply #6 - Feb 16th, 2012 at 5:18pm
Print Post  
i've been thinking about this. I wonder if in a solution with a single project there is a quirk that makes things not so obvious. 

Questions

If you have a single project in a solution and change board when the SOLUTION is selected, is the board saved to the project? (sounds like not)

If you have a single project in a solution and change board when the PROJECT is selected, is the board saved to the project?

Thanks
  
Back to top
WWW  
IP Logged
 
sixeyes2
Junior Member
**
Offline


Posts: 93
Location: Guildford, United Kingdom
Joined: Dec 19th, 2011
Re: Board type for a project
Reply #7 - Feb 16th, 2012 at 5:45pm
Print Post  
Both seem to work.

Well at least I know how to get this feature to work. However it would be cool if it could work out how to update correctly without me having to click the project / solution before changing the board.

Perhaps the cause of the problem is my setup?

I have the tracking feature enabled in the solution explorer. When tracking is enabled, the active node in the solution explorer tracks the active tab. I think this pretty much ensures that the project / solution node is NEVER the active item.

Iain
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Board type for a project
Reply #8 - Feb 16th, 2012 at 6:36pm
Print Post  
Great. Yes the F5 also failed when solution is active. I also have tracking turned on which is why i never hit the problem. but I couldn't remeber what the setting was called to tell others about. so thanks for that!

these things will be fixed in the next build....

??

i think that when explorer is selected on the solution the board should be set for the current "startup project"? 

BUT, without tracking it is possible to have a document open for project x but project b (or solution) can be selected in explorer. so it's not an easy one to work out the best solution for this??

your thoughts would be appreciated
  
Back to top
WWW  
IP Logged
 
sixeyes2
Junior Member
**
Offline


Posts: 93
Location: Guildford, United Kingdom
Joined: Dec 19th, 2011
Re: Board type for a project
Reply #9 - Feb 16th, 2012 at 11:54pm
Print Post  
Tim@Visual Micro wrote on Feb 16th, 2012 at 6:36pm:

these things will be fixed in the next build....

Eagerly awaited here. I'm really keen for the error mode enhancement.

Quote:

i think that when explorer is selected on the solution the board should be set for the current "startup project"? 

BUT, without tracking it is possible to have a document open for project x but project b (or solution) can be selected in explorer. so it's not an easy one to work out the best solution for this??

I normally don't work with multiple startup projects. I only load projects when they're libraries (and that's not an option with the Arduino build model).

What happens in the example you cite if you pressed F5, which project would it build?

Could you use that logic to determine how to set the board?

Iain
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Board type for a project
Reply #10 - Feb 17th, 2012 at 12:45am
Print Post  
yes, i agree it is the same as F5. 

we can only have one startup project in a solution and all solutions will have a startup project

if there is only one project in the solution then we will just use that.

if multiple projects, it is possible to have the solution or project1 selected in the explorer while the active document window belongs to project2. so you could be looking at project2.pde yet when you pick a board it would be set for project1

we could also have some lib.h file as the active document or other files. So we can't always rely on the active document to determine the project

it messy and i gues that explains why we don't have a solution in the current builds. 

based on the above I am not sure the F5 fix is quite right however it is inline with how vs works so "startup project" seems to be the way to go for now.

in future versions i hope to extend the visual studio project property pages allowing the board to be set in a more obvious location. 



  
Back to top
WWW  
IP Logged
 
sixeyes2
Junior Member
**
Offline


Posts: 93
Location: Guildford, United Kingdom
Joined: Dec 19th, 2011
Re: Board type for a project
Reply #11 - Feb 17th, 2012 at 1:16am
Print Post  
Tim@Visual Micro wrote on Feb 17th, 2012 at 12:45am:

in future versions i hope to extend the visual studio project property pages allowing the board to be set in a more obvious location. 

That would have been my preference. I did go and look at those property pages but didn't see anything from VM so assumed you couldn't put it there.

Iain
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint