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
Normal Topic Changing compile options/flags (Read 1029 times)
David-II
Newbies
*
Offline


Posts: 2
Joined: Sep 9th, 2020
Changing compile options/flags
Sep 10th, 2020 at 5:54am
Print Post  
I feel kind of stupid about this one, but I can't find a way in Visual Micro to change the compilation flags. In particular, the compiler is currently using the flag "-mfpu=fpv4-sp-d16" whereas it should be using "-mfpu=fpv5-d16" for my board. (It's an STM32 board and the STM32 tool uses -mfpu=fpv5-d16, so I know it is supported)

Can anyone tell me where the option to change this compilation flag is located (VS2019Community w/ Visual Micro)? 

Thanks
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2174
Joined: Feb 13th, 2019
Re: Changing compile options/flags
Reply #1 - Sep 10th, 2020 at 8:39am
Print Post  
For the STM32 (Official Core from Boards Manager), these flags are set in the boards.txt in the package 
Code
Select All
ards.txt 



In here you will see this being defined for each board - e.g.
Code
Select All
Nucleo_144.menu.pnum.NUCLEO_F429ZI.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard 



To alter this within your project (and keep this change even if the core updates), Right click the project in Solution Explorer > Add > Local Board.txt

Then you can add the below line (based on the example above) to override this for your project, and then save and build your project to use the override:
Code
Select All
build.flags.fp=-mfpu=fpv5-sp-d16 -mfloat-abi=hard 



Let us know if this works as you need, and if you need further assistance please attach a build log as shown in the yellow box at the top so we can see more about your specific environment.
  
Back to top
 
IP Logged
 
David-II
Newbies
*
Offline


Posts: 2
Joined: Sep 9th, 2020
Re: Changing compile options/flags
Reply #2 - Sep 10th, 2020 at 5:01pm
Print Post  
That worked perfectly, at least once I realized that I had to put the entire prefix for my board into the board.txt file, i.e.

menu.pnum.NUCLEO_H743ZI2.build.flags.fp=-mfpu=fpv5-d16 -mfloat-abi=hard

Also, for anyone else reading this thread with the same or a similar problem, don't forget to set Compiler->Verbose and Compiler->Build Properties in the vMicro menu and look at the beginning of the Micro Build output to see exactly to what the build properties are currently set and the names to use in board.txt to override.

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