VS Arduino | |
Visual Micro >> Other Hardware >> APM 2.9 and the build process
https://www.visualmicro.com/forums/YaBB.pl?num=1367522586 Message started by Visual Micro on May 2nd, 2013 at 7:23pm |
Title: APM 2.9 and the build process Post by Visual Micro on May 2nd, 2013 at 7:23pm
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 |
Title: Re: APM 2.9 and the build process Post by andrewf on May 11th, 2013 at 10:17pm
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 |
Title: Re: APM 2.9 and the build process Post by Visual Micro on May 12th, 2013 at 2:23am
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 |
Title: Re: APM 2.9 and the build process Post by andrewf on May 12th, 2013 at 12:54pm
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 |
Title: Re: APM 2.9 and the build process Post by Visual Micro on May 12th, 2013 at 8:06pm
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 (]apm_SITL.build.nocore=true apm_SITL.build.noarchive=true [/code):
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). |
Title: Re: APM 2.9 and the build process Post by andrewf on May 12th, 2013 at 8:39pm
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 |
Title: Re: APM 2.9 and the build process Post by Visual Micro on May 12th, 2013 at 8:56pm
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. |
Title: Re: APM 2.9 and the build process Post by Thomas3 on May 22nd, 2013 at 3:40pm
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 |
Title: Re: APM 2.9 and the build process Post by Visual Micro on May 22nd, 2013 at 3:50pm
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 |
Title: Re: APM 2.9 and the build process Post by Thomas3 on May 22nd, 2013 at 4:05pm
yes, sketchbook folder is set
|
Title: Re: APM 2.9 and the build process Post by Visual Micro on May 22nd, 2013 at 4:54pm
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 |
Title: Re: APM 2.9 and the build process Post by Thomas3 on May 22nd, 2013 at 5:07pm
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= compiler.path=C:\Users\Thomas\Documents\ArduPilot-Arduino-1.0.3-windows\hardware\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" build.path=C:\Users\Thomas\AppData\Local\VMicro\Arduino\Builds\ArduCopter\apm2_2560HAL build.project_name=ArduCopter build.variant.path= archive_file=core.a object_file="C:\Users\Thomas\AppData\Local\VMicro\Arduino\Builds\ArduCopter\apm2_2560HAL\ArduCopter.cpp.o" source_file="C:\Users\Thomas\AppData\Local\VMicro\Arduino\Builds\ArduCopter\apm2_2560HAL\ArduCopter.cpp" Compiling 'ArduCopter' for 'Arduino Mega 2560 HAL (Apm 2)' Build folder: file://C:\Users\Thomas\AppData\Local\VMicro\Arduino\Builds\ArduCopter\apm2_2560HAL SketchLibFolders ;C:\Users\Thomas\Documents\Arduino\libraries\FastSerial;C:\Users\Thomas\Documents\Arduino\l |
Title: Re: APM 2.9 and the build process Post by Visual Micro on May 22nd, 2013 at 5:13pm
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 |
Title: Re: APM 2.9 and the build process Post by Visual Micro on May 22nd, 2013 at 5:15pm
ps:
you can install the arduino ide anywhere on your pc you do not need to alter the sketchbook location setting |
Title: Re: APM 2.9 and the build process Post by Thomas3 on May 22nd, 2013 at 6:02pm
Tim,
sent you 3 emails, maybe they are in your spam filter Installed 1.0.4. Still compile errors, but result changed completely. Thomas |
Title: Re: APM 2.9 and the build process Post by Visual Micro on May 22nd, 2013 at 6:47pm
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 |
Title: Re: APM 2.9 and the build process Post by Thomas3 on May 22nd, 2013 at 7:37pm
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 |
Title: Re: APM 2.9 and the build process Post by Thomas3 on May 22nd, 2013 at 7:38pm
I meant V3.0-rc2 doesn't yet compile with arduino 1.0.4
|
Title: Re: APM 2.9 and the build process Post by Visual Micro on May 22nd, 2013 at 7:57pm
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 |
Title: Re: APM 2.9 and the build process Post by Visual Micro on Jun 2nd, 2013 at 7:30pm
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 |
Title: Re: APM 2.9 and the build process Post by Visual Micro on Jun 2nd, 2013 at 7:42pm
Off-Topic replies have been moved to this Topic.
admin edit: These replies were not off topics but the system generated message always says they were! Sorry, these replies have been moved to a new valid discussion :) |
VS Arduino » Powered by YaBB 2.6.12! YaBB Forum Software © 2000-2024. All Rights Reserved. |