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] 2  Send TopicPrint
Hot Topic (More than 8 Replies) APM 2.9 and the build process (Read 30069 times)
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
APM 2.9 and the build process
May 2nd, 2013 at 7:23pm
Print Post  
There has been a lot of work to support different build processes. One example being the APM project from diydrones which requires different arduino compiler syntax. The APM project also includes code to support HAL and SITL compilations. SITL results in a windows command window running the apm Software In The Loop.

Basic Guide

APM/VM Install Guide

The above install guide should result in APM boards appearing at the bottom of the boards list in visual Micro.

Advanced Options

Custom Build Example (Advanced Users)

Cygwin Install Guide (SITL)

Using FastSerial for Debug

Debug using a different serial port/digital pins

ps: Don't forget to set your sketchbook folder either in the arduino ide or in "tools>options>visual micro>locations", the latter is recommended
« Last Edit: May 22nd, 2013 at 3:51pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
andrewf
Newbies
*
Offline


Posts: 6
Joined: Oct 23rd, 2011
Re: APM 2.9 and the build process
Reply #1 - May 11th, 2013 at 10:17pm
Print Post  
I have been using Visual Micro for my APM work for quite a while now. It sure makes working on the code much easier, so thank you.   

The latest HAL versions stopped it working but then I noticed this topic, so downloaded the "hardware" folder, and installed the latest build (1.1305.09), but still get errors (although different from before).

Compiling 'ArduPlane' for 'Arduino Mega 2560 HAL (Apm 2)'
ArduPlane.pde : No such file or directory
AP_Menu.cpp : : In member function 'void Menu::run()':
AP_Menu.cpp : 'FPSTR' was not declared in this scope
AP_Menu.cpp : : In member function 'void Menu::_help()':
AP_Menu.cpp : 'FPSTR' was not declared in this scope
AP_ADC.cpp : In file included from
AP_ADC.h : 'uint8_t' has not been declared
AP_ADC.h : 'uint32_t' does not name a type
AP_ADC.h : expected ',' or '...' before '*' token
AP_ADC.h : ISO C++ forbids declaration of 'uint8_t' with no type
AP_ADC.h : 'uint16_t' does not name a type
AP_ADC_AnalogSource.h : In file included from
AP_ADC_AnalogSource.cpp : from
AP_ADC.h : 'uint8_t' has not been declared
AP_ADC.h : 'uint32_t' does not name a type
AP_ADC.h : expected ',' or '...' before '*' token
AP_ADC.h : ISO C++ forbids declaration of 'uint8_t' with no type
AP_ADC.h : 'uint16_t' does not name a type
AP_InertialSensor.cpp : : In member function 'virtual void AP_InertialSensor::_init_gyro(void (*)(bool))':
AP_InertialSensor.cpp : 'ToRad' was not declared in this scope
AP_InertialSensor.cpp : 'ToDeg' was not declared in this scope
SITL.cpp : : In member function 'void SITL::simstate_send(mavlink_channel_t)':
SITL.cpp : 'ToRad' was not declared in this scope
SITL.cpp : : In static member function 'static void SITL::convert_body_frame(double, double, double, double, double, double*, double*, double*)':
SITL.cpp : 'ToRad' was not declared in this scope
Error compiling


This was with Arduplane 2.72, but get the same set of messages with Arducopter 3.0 RC1. Any ideas?

Thank you,
Andrew
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: APM 2.9 and the build process
Reply #2 - May 12th, 2013 at 2:23am
Print Post  
Yes I think it broke because of the 1.5 changes.

What if you uninstall via add or remove programs (visual micro) and then install 1305.01?

Hopefully that will work, I'll take a look at it when I get a mo
  
Back to top
WWW  
IP Logged
 
andrewf
Newbies
*
Offline


Posts: 6
Joined: Oct 23rd, 2011
Re: APM 2.9 and the build process
Reply #3 - May 12th, 2013 at 12:54pm
Print Post  
I uninstalled visualmicro, ran Visual Studio (I am on 2012) to confirm it was really gone, then reinstalled visualmicro. Same error messages as before.

Thank you,
Andrew
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: APM 2.9 and the build process
Reply #4 - May 12th, 2013 at 8:06pm
Print Post  
Sorry to mess you around, you can use the latest version it was a problem in the boards.txt and the wiki page showing the custom build properties (boards.txt):

Both the apm1 and apm2 HAL boards have the same mistake.

Please change this text for the apm2_2560HAL board as follows. After making changes to the boards.txt, if VS is open then click "Tools>Arduino>Reload Tool Chain" and the compile should work.

from:

Code
Select All
apm_SITL.build.nocore=true
apm_SITL.build.noarchive=true
 


to:

Code
Select All
apm2_2560HAL.build.nocore=true
apm2_2560HAL.build.noarchive=true
 



above we see that two apm_SITL properties are wrongly named in the 2560 apm2 HAL board section.

I have replaced the zip on the web with a fixed boards.txt in  sketchbook\hardware\apm\boards.txt". 

I suggest you use 1305.09 because it reads the -D compiler params from boards.txt and forces them into the the VS intellisense system. The effect, in VS, will be that HAL code will appear enabled and non-HAL code will appear disabled (without the need to set any special project properties for your apm project).
« Last Edit: May 12th, 2013 at 8:26pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
andrewf
Newbies
*
Offline


Posts: 6
Joined: Oct 23rd, 2011
Re: APM 2.9 and the build process
Reply #5 - May 12th, 2013 at 8:39pm
Print Post  
That did it. 

It looks like the same issue applies to the APM1/1280 section - couldn't test it as I don't have a project small enough to fit, but I changed a total of six lines. (three sets of the two lines shown above).

Thanks very much for the fast response,
Andrew
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: APM 2.9 and the build process
Reply #6 - May 12th, 2013 at 8:56pm
Print Post  
Great, yes the same issue. I noticed you were using the 2560 so didn't bother mentioning it but I have now updated all of the notes and also tested with arduino 1.5 and all apm builds work. 

SITL working too. I changed the SITL output setting in the boards.txt from .elf to .exe and it runs nicely so you can add a windows shortcut to the .exe if required. 

Switch on "Tools>Options>Compiler>Show Build Folder" if you need to dip in and out of the compiler outputs. CTRL+Enter when you click the link in the output to open the build folder


Apm General

If you find yourself modifying library code instead of sketch code let me know. 

I noticed that with so many libs in the apm project it would be nice to have an OPTION to just build the libs that have changed. 

Currently if Visual Micro detects that any single lib source has altered it re-builds them all (because they might be (and some apm ones are) intertwined). 

Depending on which library you are altering that might be overkill. For example. It is important the default compiler cache works as it does, however this option, if viable, would bring down the compile time (when lib source has changed) enormously.
« Last Edit: May 12th, 2013 at 9:01pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Thomas3
Junior Member
**
Offline


Posts: 11
Location: Munich
Joined: Feb 1st, 2013
Re: APM 2.9 and the build process
Reply #7 - May 22nd, 2013 at 3:40pm
Print Post  
Hi,
I have a problem with the build process.

Installed:
1. Atmel Studio
2. VisualMicro Plugin
3. hardware folder

I have ArduCopter V2.9.1b

Everything seemed to work fine. Opened Arduino project, added all *.ino.

Selected Apm 2 board (last one), selected ATmega2560.

Started build.

First lines of error: 

Compiling 'ArduCopter' for 'Arduino Mega 2560 HAL (Apm 2)'
BetterStream.h : In file included from
FastSerial.h : from
ArduCopter.ino : from
AP_Common.h : No such file or directory
FastSerial.h : In file included from
ArduCopter.ino : from
BetterStream.h : expected class-name before '{' token
BetterStream.h : 'va_list' has not been declared
BetterStream.h : 'va_list' has not been declared
ArduCopter.ino : In file included from
FastSerial.h : write' in 'class BetterStream'
AP_GPS_NMEA.h : In file included from
AP_GPS.h : from
ArduCopter.ino : from
GPS.h : ISO C++ forbids declaration of 'Stream' with no type
GPS.h : expected ';' before '*' token
GPS.h : expected `)' before '*' token
GPS.h : 'Stream' has not been declared
GPS.h : 'Stream' has not been declared
AP_GPS.h : In file included from
ArduCopter.ino : from
AP_GPS_NMEA.h : expected `)' before '*' token
AP_GPS.h : In file included from
ArduCopter.ino : from
AP_GPS_SIRF.h : expected `)' before '*' token
AP_GPS.h : In file included from
ArduCopter.ino : from
AP_GPS_406.h : expected `)' before '*' token
AP_GPS.h : In file included from
ArduCopter.ino : from
AP_GPS_UBLOX.h : expected `)' before '*' token
AP_GPS.h : In file included from


It seems like that it doesn't find the libraries folder (AP_...). What can I do ?
Thanks
Thomas
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: APM 2.9 and the build process
Reply #8 - May 22nd, 2013 at 3:50pm
Print Post  
Did you set the sketchbook folder?

Either using the arduino ide or in atmel Tools>Options>Visual Micro>Locations>Arduno Sketchbook Folder


It is best to use "Tools>Options", otherwise you need to click "Tools>Reload Tool Chain" (or restart atmel) after changing the path in the arduino ide
  
Back to top
WWW  
IP Logged
 
Thomas3
Junior Member
**
Offline


Posts: 11
Location: Munich
Joined: Feb 1st, 2013
Re: APM 2.9 and the build process
Reply #9 - May 22nd, 2013 at 4:05pm
Print Post  
yes, sketchbook folder is set
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: APM 2.9 and the build process
Reply #10 - May 22nd, 2013 at 4:54pm
Print Post  
Is the "libraries" folder under where you have set the sketchbook folder?

Do the libraries show up on the "Project>Add Arduino Library>User" list?

Can you confirm that apm libs do not show on the "Project>Add Arduino Library>Core" list?

Please switch on Tools>Options>Visual Micro.Compiler>Verbose rebuild and email the output to info [at] visualmicro.com

Thanks

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


Posts: 11
Location: Munich
Joined: Feb 1st, 2013
Re: APM 2.9 and the build process
Reply #11 - May 22nd, 2013 at 5:07pm
Print Post  
May be this helps:

oard Properties
name=Arduino Mega 2560 HAL (Apm 2)
upload.protocol=wiring
upload.maximum_size=258048
upload.speed=115200
bootloader.low_fuses=0xFF
bootloader.high_fuses=0xD8
bootloader.extended_fuses=0xFD
bootloader.path=stk500v2
bootloader.file=stk500boot_v2_mega2560.hex
bootloader.unlock_bits=0x3F
bootloader.lock_bits=0x0F
build.mcu=atmega2560
build.f_cpu=16000000L
build.nocore=true
build.noarchive=true
build.option1=-mcall-prologues
build.option2=-DCONFIG_HAL_BOARD=HAL_BOARD_APM2
build.option3=-DEXCLUDECORE
build.linkoption1=-mcall-prologues
runtime.ide.path=C:\Users\Thomas\Documents\ArduPilot-Arduino-1.0.3-windows
build.system.path=C:\Users\Thomas\Documents\Arduino\hardware\apm\system
software=ARDUINO
runtime.ide.version=101
vm.core.include=wprogram.h
vm.boardsource.path=C:\Users\Thomas\Documents\Arduino\hardware\apm
vm.boardsource.name=boards.txt
vm.platformname.name=
\tools\avr\bin\
includes= -I"C:\Users\Thomas\Documents\Arduino\libraries\FastSerial"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_Common"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_Menu"  -I"C:\Users\Thomas\Documents\Arduino\libraries\Arduino_Mega_ISR_Registry"  -I"C:\Users\Thomas\Documents\Arduino\libraries\APM_RC"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_GPS"  -I"C:\Users\Thomas\Documents\Arduino\libraries\I2C"  -I"C:\Users\Thomas\Documents\ArduPilot-Arduino-1.0.3-windows\libraries\SPI"  -I"C:\Users\Thomas\Documents\Arduino\libraries\SPI3"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_Semaphore"  -I"C:\Users\Thomas\Documents\Arduino\libraries\DataFlash"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_ADC"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_AnalogSource"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_Baro"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_Compass"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_Math"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_InertialSensor"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_PeriodicProcess"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_AHRS"  -I"C:\Users\Thomas\Documents\Arduino\libraries\APM_PI"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AC_PID"  -I"C:\Users\Thomas\Documents\Arduino\libraries\RC_Channel"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_Motors"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_RangeFinder"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_OpticalFlow"  -I"C:\Users\Thomas\Documents\Arduino\libraries\Filter"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_Buffer"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_LeadFilter"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_Relay"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_Camera"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_Mount"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_Airspeed"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_InertialNav"  -I"C:\Users\Thomas\Documents\Arduino\libraries\DigitalWriteFast"  -I"C:\Users\Thomas\Documents\Arduino\libraries\memcheck"  -I"C:\Users\Thomas\Documents\Arduino\libraries\GCS_MAVLink"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_Declination"  -I"C:\Users\Thomas\Documents\Arduino\libraries\AP_Limits"  -I"C:\Users\Thomas\Documents\Arduino\libraries\SITL" 
560HAL
build.project_name=ArduCopter
build.variant.path=
archive_file=core.a
_2560HAL\ArduCopter.cpp.o"
_2560HAL\ArduCopter.cpp"

Compiling 'ArduCopter' for 'Arduino Mega 2560 HAL (Apm 2)'
Build folder: AL
SketchLibFolders
s\Arduino\l
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: APM 2.9 and the build process
Reply #12 - May 22nd, 2013 at 5:13pm
Print Post  
Please download arduino 1.0.4 from arduino.cc and change your Tools>Options>Visual Micro>Application Locations>Arduino path

You can also download arduino 1.0.5 but you will need to delete two libraries (robot_motor, robot_control) from the 1.0.5 install (idePath\Libraries) 

Don't bother with the modified apm ide you don't need it for vm!

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: APM 2.9 and the build process
Reply #13 - May 22nd, 2013 at 5:15pm
Print Post  
ps: 

you can install the arduino ide anywhere on your pc

you do not need to alter the sketchbook location setting
  
Back to top
WWW  
IP Logged
 
Thomas3
Junior Member
**
Offline


Posts: 11
Location: Munich
Joined: Feb 1st, 2013
Re: APM 2.9 and the build process
Reply #14 - May 22nd, 2013 at 6:02pm
Print Post  
Tim,
sent you 3 emails, maybe they are in your spam filter

Installed 1.0.4. 

Still compile errors, but result changed completely.

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: APM 2.9 and the build process
Reply #15 - May 22nd, 2013 at 6:47pm
Print Post  
Okay so I see you are using the default arduino sketchbook location which is not as per the apm install guide on diydrones but should work okay.

I can also see that we now have the correct arduino core being used so 1.0.4 has fixed that problem

However the board you have selected is the Arduino Uno, please select an apm board and try the compile

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


Posts: 11
Location: Munich
Joined: Feb 1st, 2013
Re: APM 2.9 and the build process
Reply #16 - May 22nd, 2013 at 7:37pm
Print Post  
Hi Tim,

I did a bit more testing. I always used the apm2 board and the ATmega2560.

The built doesn't work with V2.9.1b, but it works with V3.0-rc2.

But it doen't (yet) compile with arduino 1.0.4

Thomas
  
Back to top
 
IP Logged
 
Thomas3
Junior Member
**
Offline


Posts: 11
Location: Munich
Joined: Feb 1st, 2013
Re: APM 2.9 and the build process
Reply #17 - May 22nd, 2013 at 7:38pm
Print Post  
I meant  V3.0-rc2 doesn't yet compile with arduino 1.0.4
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: APM 2.9 and the build process
Reply #18 - May 22nd, 2013 at 7:57pm
Print Post  
2.9 compiles with arduino 1.0.4 when using Visual Micro and not the Arduino ide. Are you saying that 3.0 is different.

You emailed me compile result but for Uno, please email verbose output for one of the apm boards. Thanks
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: APM 2.9 and the build process
Reply #19 - Jun 2nd, 2013 at 7:30pm
Print Post  
Hi Thomas,

Sorry for the delay, other users report the 2.9 and 3.0 builds work so we might need to re-look at your config.

However one problem has surfaced when switching between 2.9 and 3.0, you should click "Project>Build>Clean"

This will remove previous build cache which becomes confused when you move between different apm builds of projects with the same name.

Thanks
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint