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) #if defined..... Board definitions does not work ? (Read 3250 times)
Dave_K
Junior Member
**
Offline


Posts: 24
Joined: Dec 14th, 2017
#if defined..... Board definitions does not work ?
May 31st, 2018 at 6:06pm
Print Post  
I have the same issue.
Recently it works, and suddenly stopped!

This is code that i used:

#ifdef arduino_due_x_no_USB.build.variant
#define USB_ENABLE 0
#else
#define USB_ENABLE 1
#endif

this "setup" is based on this line:

build.variant=arduino_due_x_no_USB

I use VisualMicro on Atmel Studio 7
« Last Edit: May 31st, 2018 at 6:19pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: #if defined..... Board definitions does not work ?
Reply #1 - May 31st, 2018 at 6:13pm
Print Post  
Please switch on vmicro>compiler>verbose and "show build properties"

Then build and post the output as a .txt file or email to info[at]visualmicro.com

General

That looks like a custom board so you always need to provide this info so we can see what yo have set.
We also need to see the build info because that will tell us which version of the sam toolchain you have installed
If you have downloaded that board from the internet then please also supply the url that you used

Thanks
« Last Edit: May 31st, 2018 at 6:14pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Dave_K
Junior Member
**
Offline


Posts: 24
Joined: Dec 14th, 2017
Re: #if defined..... Board definitions does not work ?
Reply #2 - May 31st, 2018 at 8:40pm
Print Post  
I found the reason, I not edited definition in variant.h. The funny thing is why this worked before? Nevermind, sorry for problems.
Thank you for fast response.

Meanwhile i found another "strange" issue, when i check "Always Export Binary" the binary is exported but it has name:

project_name.ino.arduino_due_x.bin 

why not: project_name.bin 

where can I change naming behaviour?
sorry for offtopic.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: #if defined..... Board definitions does not work ?
Reply #3 - May 31st, 2018 at 8:44pm
Print Post  
Hi,

The project_name.bin is what visual micro creates and that will be in the Intermediate folder.

The export name is governed by your platform.txt which contains a "savehex" pattern that produces the name designed by the authors of the sam toolchain that you have installed.

The platform.txt can be found with the sam hardware definition alongside boards.txt. Use the Platform Explorer to see the source path or switch on compiler>verbose to see core folders after a build.

tip: you can create a local board.txt in the project and override any platform.txt properties. Just copy a line from platform.txt such as a recipe into board.txt and change it to whatever you want. Click "Save" on board.txt before build because VS auto saves txt file changes after the build.
« Last Edit: May 31st, 2018 at 8:47pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Dave_K
Junior Member
**
Offline


Posts: 24
Joined: Dec 14th, 2017
Re: #if defined..... Board definitions does not work ?
Reply #4 - May 31st, 2018 at 10:27pm
Print Post  
Now is almost perfect, but how to get rig off "ino" part of the file name? now i've got "project_name.ino.bin" Maybe its possible to  add "variables" in code? And then use them in boards.txt ?
« Last Edit: May 31st, 2018 at 10:30pm by Dave_K »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: #if defined..... Board definitions does not work ?
Reply #5 - May 31st, 2018 at 10:34pm
Print Post  
what is your recipe/pattern?
  
Back to top
WWW  
IP Logged
 
Dave_K
Junior Member
**
Offline


Posts: 24
Joined: Dec 14th, 2017
Re: #if defined..... Board definitions does not work ?
Reply #6 - May 31st, 2018 at 10:40pm
Print Post  
I "one word" recipe is vary from board that I choose. So perfect solution will be variables, macros in code. I hope I will could change it via preprocessor statements. Now I found resolution, hardcoded filename in boards.txt
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: #if defined..... Board definitions does not work ?
Reply #7 - May 31st, 2018 at 10:42pm
Print Post  
Switch on "vmicro>compiler>show build properties" then find some variables you like.

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


Posts: 24
Joined: Dec 14th, 2017
Re: #if defined..... Board definitions does not work ?
Reply #8 - May 31st, 2018 at 10:45pm
Print Post  
I see them, but how can i add my own from code? It is possible?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: #if defined..... Board definitions does not work ?
Reply #9 - Jun 2nd, 2018 at 1:42am
Print Post  
from local board.txt as I described earlier?
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint