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
Very Hot Topic (More than 25 Replies) problems making debug work with ArduPilot (APM:Plane) (Read 28045 times)
Clayton
Junior Member
**
Offline


Posts: 19
Joined: Oct 29th, 2012
problems making debug work with ArduPilot (APM:Plane)
Sep 7th, 2013 at 3:25pm
Print Post  
Hi all, I've got some problems compiling for APM:Plane.  I think I've checked & double-checked all the common goofs, but still getting these errors.  The youtube video shows all my settings, hopefully you see something I've got set wrong!?

http://www.youtube.com/watch?v=2SWFV3ksAdQ&feature=youtube_gdata_player

Probably should include the error messages so this will show up in others' searches:
Code
Select All
Compiling 'ArduPlane' for 'Arduino Mega 2560 HAL (Apm 2)'
Build folder: HAL
Binary sketch size: 232590 bytes (used 90% of a 258048 byte maximum) (163.84 secs)
.
The usb debugger has been activated using global options
To prevent this message switch on the (Micro Debug) project properties (click the ? on the toolbar to view the properties)
Alternatively set 'Micro Debug - General>Always Use Debugger' = False in 'Tools>Options>Visual Micro'
.
Compiling debug version of 'ArduPlane' for 'Arduino Mega 2560 HAL (Apm 2)'
Build folder: HAL
ArduPlane.pde : In file included from
VM_DBG.h : 'byte' does not name a type
VM_DBG.h : ISO C++ forbids declaration of 'HardwareSerial' with no type
VM_DBG.h : expected ';' before '*' token
VM_DBG.h : 'HardwareSerial' has not been declared
VM_DBG.h : 'HardwareSerial' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' does not name a type
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : : In member function 'void VisualMicroDebug::setVariable(T&, int, int)':
VM_DBG.h : 'byte' was not declared in this scope
VM_DBG.h : 'transport' was not declared in this scope
VM_DBG.h : : In member function 'void VisualMicroDebug::setVariable(T&, int)':
VM_DBG.h : 'byte' was not declared in this scope
ArduPlane.pde : : In function 'void setup()':
ArduPlane.pde : 'Serial' was not declared in this scope
ArduPlane.pde : 'class VisualMicroDebug' has no member named 'transport'
ArduPlane.pde : : In function 'void loop()':
ArduPlane.pde : 'class VisualMicroDebug' has no member named 'transport'
ArduPlane.pde : 'class VisualMicroDebug' has no member named 'transport'
ArduPlane.pde : 'class VisualMicroDebug' has no member named 'transport'
ArduPlane.pde : 'class VisualMicroDebug' has no member named 'transport'
Error compiling
. 

« Last Edit: Sep 14th, 2013 at 4:47pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: problems with vm upgrade and ArduPilot (APM:Plane)
Reply #1 - Sep 7th, 2013 at 3:37pm
Print Post  
Hi Clayton,

Thanks for the post.

1)

The first problem is caused by a new feature in Visual Micro for novice users which won't work for ArduPlane projects without altering one of the project properties.

However, you can switch off all new Visual Micro features and the error messages explains how to do this using the "Tools>Options" menu

Code
Select All
 set 'Micro Debug - General>Always Use Debugger' = False in 'Tools>Options>Visual Micro' 



The message is not very clear when displayed in a mass of other messages, it will be improved for the next release

2)

The debugger changes of the last few months have not yet been tested. 

If you would like to use the debugger with ArduPilot you will certainly need to alter the Project Property (click project then press F4) called "RemoteTransport" to "FastSerial"

The ArduPilot project that you are working with does not support "Serial" which is the debugger default, instead it uses FastSerial which is a debugger option.

This is actually the main reason for the error you have received which is an error during debug compile. 

3)

Finally, if you do want to try debug sometime, once you have set the "RemoteTransport" as explained above you might hit some compile errors due to an unsupported "byte" data type in the ArduPilot project. When someone is ready I can provide a new file for Visual Micro that should fix this problem but I am holding off for someone who can test that is interested and has time to test Smiley

Thanks again
« Last Edit: Sep 7th, 2013 at 3:39pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Clayton
Junior Member
**
Offline


Posts: 19
Joined: Oct 29th, 2012
Re: problems with vm upgrade and ArduPilot (APM:Plane)
Reply #2 - Sep 7th, 2013 at 5:01pm
Print Post  
Great - I can compile APM:Plane now (without debug) and the 'byte' errors do show up when I enable debug. 

I'd be happy to test the debug fix ASAP. I'm held up until I can get the debugger working and I'd rather not mess with downgrading. 
Upload the file as soon as you can and I'll give it a try.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: problems with vm upgrade and ArduPilot (APM:Plane)
Reply #3 - Sep 7th, 2013 at 5:18pm
Print Post  
1)
That sounds promising. Any errors will be easily fixed.

Thanks very much for the feed back.

2)
I've just remembered about a new facility to default the RemoteTransport for a board. This means we can change the apm definitions accessed via our wiki to automatically enable FastSerial for other apm users.

This means that the moment visual micro for arduplane is installed the debugger will work out of the box.

For reference the setting in the boards.txt for the apm boards for apm would be:-

Code
Select All
[boardName].vm.debug.class_type=FASTSERIAL 

« Last Edit: Sep 7th, 2013 at 5:19pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Clayton
Junior Member
**
Offline


Posts: 19
Joined: Oct 29th, 2012
Re: problems with vm upgrade and ArduPilot (APM:Plane)
Reply #4 - Sep 7th, 2013 at 9:07pm
Print Post  
I set the RemoteTransport = FastSerial, but still get compile errors.  More 'byte' errors actually.  Here's a link (too many characters to paste here).

https://www.dropbox.com/s/rlmoyav83a1rt4y/vmicro.log
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: problems with vm upgrade and ArduPilot (APM:Plane)
Reply #5 - Sep 7th, 2013 at 9:43pm
Print Post  
Hi Clayton, the log looks empty to me Smiley

I'll try to post an update with a debugger tweak for you to try. Hopefully in a few hours or tomorrow.

Thanks for being in a position to test it.

T
  
Back to top
IP Logged
 
Clayton
Junior Member
**
Offline


Posts: 19
Joined: Oct 29th, 2012
Re: problems with vm upgrade and ArduPilot (APM:Plane)
Reply #6 - Sep 8th, 2013 at 11:32am
Print Post  
Oop - the log file is populated now.  Thanks for taking a look!
  
Back to top
 
IP Logged
 
josefk
Newbies
*
Offline


Posts: 1
Location: Austria
Joined: Aug 22nd, 2013
Re: problems making debug work with ArduPilot (APM:Plane)
Reply #7 - Sep 13th, 2013 at 7:43am
Print Post  
Hi Clayton!

The reason I would like to use VM ist the same. I would use it for APM developement. I have similar problems. VM works great with small Arduino Projects.

On the web VM shows  the APM Project files as sample. What has to be done that Arduflyer ist working in ATMEL Studio together with VM? This is more a question to the VM admin even that they are not responsible for c++ incompatibility of Arduflyer. 

I would buy VM right now if I could debug APM 2. I am sure there are lot more users with the same demand.
BR Josef
« Last Edit: Sep 14th, 2013 at 4:49pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: problems with vm upgrade and ArduPilot (APM:Plane)
Reply #8 - Sep 13th, 2013 at 12:05pm
Print Post  
Hi All,

I looked at the APM project over the last few days because it changes so rapidly.

The compile and upload should work in all Visual Studio Pro versions and with Atmel.

The debug will work with a bit of tweaking for a couple of data types that are no longer available in the apm project however the biggest concern is that I looked at APM 2.9 and  it no longer uses FastSerial. I noted that it uses some sort of native UART code. Further more it appeared that none of the serial ports were available as normal serial ports, furthermore it seemed to be geared for mavlink comms.

I might be wrong, it is a big project to review however we would need to understand how the transport of debug messages is going to work.

If your projects support FastSerial we can make debug work easily, otherwise we have some dev to do or some info I need to understand how to send messages via the main serial or another serial port.

Visual Micro also supports SoftwareSerial on any one or two digital pins for debug but because APM is so clever with interrupts/timers etc I suspect this might not be a workable solution.

Finally I noticed recently that APM has consumed almost all of the 250k of program ram on the mega. This might also cause a problem for the debugger.

Can you please confirm which versions of APM you are using with links to the source or download.

Thanks
  
Back to top
IP Logged
 
Clayton
Junior Member
**
Offline


Posts: 19
Joined: Oct 29th, 2012
Re: problems making debug work with ArduPilot (APM:Plane)
Reply #9 - Sep 14th, 2013 at 2:30am
Print Post  
Hi Tim,
I'm using the most recent github version of ArduPlane (i'm not really a copter guy), so you'll want to look at https://github.com/diydrones/ardupilot/.  ;

We could also ask some of the devs who are craftier than me (doesn't take much).  I'm sure they'd be willing to comment on  your findings if they use VS & vmicro.  Although, I think most of them use simpler IDE's to avoid stuff like this.
« Last Edit: Sep 14th, 2013 at 4:48pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: problems with vm upgrade and ArduPilot (APM:Plane)
Reply #10 - Sep 14th, 2013 at 3:08am
Print Post  
Hi Clayton,

The link doesn't work Smiley

I understand that some people are happy with simpler ides and some with more complex like Eclipse. We sit in the middle I hope, basic config is simple but with some extra power.

What do you mean to avoid stuff like this? Is the standard compile and upload working okay or have I missed the point? 

We are just talking about making the debug work aren't we? You've got me worried now  Undecided
  
Back to top
IP Logged
 
Clayton
Junior Member
**
Offline


Posts: 19
Joined: Oct 29th, 2012
Re: problems making debug work with ArduPilot (APM:Plane)
Reply #11 - Sep 14th, 2013 at 3:23am
Print Post  
Oh, the compile & upload works fine.  

I use linux & mac more than windows, but I keep a windows VM for visual micro and debugging.  I don't know of anything else available (especially linux or Mac) with good debugging.  So here I am... stuck again  Smiley
« Last Edit: Sep 14th, 2013 at 4:48pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: problems making debug work with ArduPilot (APM:Plane)
Reply #12 - Sep 14th, 2013 at 2:35pm
Print Post  
Makes sense, I think most people benefit from the standard features of Visual Studio such as intellisense and "go to definition". These are great features for huge projects.

Only about 1% of people use the debugger at the moment. I think this is mainly due to the fact that Visual Studio offers such a massive contrast to the Arduino Ide that it is enough. I know that is was I felt when I was first able to use VS after hacking away in the Arduino Ide.

Questions

So can you post that source code link again please. It didn't work for me?

What program size does the apm compile to?

Does it still use FastSerial?

Thanks
« Last Edit: Sep 14th, 2013 at 4:47pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Clayton
Junior Member
**
Offline


Posts: 19
Joined: Oct 29th, 2012
Re: problems making debug work with ArduPilot (APM:Plane)
Reply #13 - Sep 14th, 2013 at 3:46pm
Print Post  
I'm using ArduPlane, located at https://github.com/diydrones/ardupilot/ .  It compiles to 233160 bytes.

I just compiled without debug, and it works nicely.  Then I turn on micro debug and get:
Compiling 'ArduPlane' for 'Arduino Mega 2560 HAL (Apm 2)'
Build folder: HAL
Binary sketch size: 233160 bytes (used 90% of a 258048 byte maximum) (6.50 secs)
Compiling debug version of 'ArduPlane' for 'Arduino Mega 2560 HAL (Apm 2)'
Build folder: HAL
ArduPlane.pde : In file included from
VM_DBG.h : 'byte' does not name a type
VM_DBG.h : ISO C++ forbids declaration of 'HardwareSerial' with no type
VM_DBG.h : expected ';' before '*' token
VM_DBG.h : 'HardwareSerial' has not been declared
VM_DBG.h : 'HardwareSerial' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' does not name a type
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : : In member function 'void VisualMicroDebug::setVariable(T&, int, int)':
VM_DBG.h : 'byte' was not declared in this scope
VM_DBG.h : 'transport' was not declared in this scope
VM_DBG.h : : In member function 'void VisualMicroDebug::setVariable(T&, int)':
VM_DBG.h : 'byte' was not declared in this scope
ArduPlane.pde : : In function 'void setup()':
ArduPlane.pde : 'Serial' was not declared in this scope
ArduPlane.pde : 'class VisualMicroDebug' has no member named 'transport'
ArduPlane.pde : : In function 'void loop()':
ArduPlane.pde : 'class VisualMicroDebug' has no member named 'transport'
ArduPlane.pde : 'class VisualMicroDebug' has no member named 'transport'
ArduPlane.pde : 'class VisualMicroDebug' has no member named 'transport'
ArduPlane.pde : 'class VisualMicroDebug' has no member named 'transport'
Error compiling
« Last Edit: Sep 14th, 2013 at 4:47pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: problems making debug work with ArduPilot (APM:Plane)
Reply #14 - Sep 14th, 2013 at 3:52pm
Print Post  
@Clayton Can you set the RemoteTransport property to fastSerial and run the debug compile again please
« Last Edit: Sep 14th, 2013 at 4:51pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: problems making debug work with ArduPilot (APM:Plane)
Reply #15 - Sep 14th, 2013 at 4:51pm
Print Post  
@josefk would you please start a new thread stating which version of arduplane you are using. The arduplane project changes quickly. Please also confirm in the new thread if you have installed the apm files from our wiki that provide the APM entries in the boards lists?
  
Back to top
IP Logged
 
Clayton
Junior Member
**
Offline


Posts: 19
Joined: Oct 29th, 2012
Re: problems making debug work with ArduPilot (APM:Plane)
Reply #16 - Sep 14th, 2013 at 10:27pm
Print Post  
Sure thing, here we are:  http://www.youtube.com/watch?v=UvLq3qb5nkM&feature=youtube_gdata_player


Compiling 'ArduPlane' for 'Arduino Mega 2560 HAL (Apm 2)'
Build folder: HAL
Binary sketch size: 233160 bytes (used 90% of a 258048 byte maximum) (8.21 secs)
Compiling debug version of 'ArduPlane' for 'Arduino Mega 2560 HAL (Apm 2)'
Build folder: HAL
ArduPlane.pde : In file included from
VM_DBG.h : 'byte' does not name a type
VM_DBG.h : ISO C++ forbids declaration of 'FastSerial' with no type
VM_DBG.h : expected ';' before '*' token
VM_DBG.h : 'FastSerial' has not been declared
VM_DBG.h : 'FastSerial' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' does not name a type
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : 'byte' has not been declared
VM_DBG.h : : In member function 'void VisualMicroDebug::setVariable(T&, int, int)':
VM_DBG.h : 'byte' was not declared in this scope
VM_DBG.h : 'transport' was not declared in this scope
VM_DBG.h : : In member function 'void VisualMicroDebug::setVariable(T&, int)':
VM_DBG.h : 'byte' was not declared in this scope
ArduPlane.pde : : In function 'void setup()':
ArduPlane.pde : 'Serial' was not declared in this scope
ArduPlane.pde : 'class VisualMicroDebug' has no member named 'transport'
ArduPlane.pde : : In function 'void loop()':
ArduPlane.pde : 'class VisualMicroDebug' has no member named 'transport'
ArduPlane.pde : 'class VisualMicroDebug' has no member named 'transport'
ArduPlane.pde : 'class VisualMicroDebug' has no member named 'transport'
ArduPlane.pde : 'class VisualMicroDebug' has no member named 'transport'
Error compiling
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: problems making debug work with ArduPilot (APM:Plane)
Reply #17 - Sep 14th, 2013 at 10:41pm
Print Post  
First off I have just reaslized that we probably look at different parts of the error. Sorry....

The error we need to understand and resolve first is:-
Code
Select All
ArduPlane.pde : 'Serial' was not declared in this scope 



This might suggest a radical change in the ArduPilot code which I will try to look into with the source code from the link you have provided (thanks) but the following info might help you get some questions answered.

The APM (arduino mega 2560) has a number of Serial ports which should show up when you type the word "Serial" into the code and press CTRL+J in VS 2010. Do you see any Serial ports? Serial1, Serial2, Serial3 etc? 

Serial ports are standard Arduino stuff and in previous versions of APM serial ports were re-defined to use something called FastSerial. 

Visual Micro doesn't care what actually sends the data over serial just as long as it can call functions to send data. For the debugger to work it will need to be able to use something on the arduino to send serial messages to the pc. 

Maybe we can also look at how the ArduPilot gps is being read, there should be a serial option for that? It might give us some clues.

Ideally we need an object to provide .print(anyvar) and .println(anyvar) to a serial stream at any speed you like.  However, if we have to look at f_print or something we can but it will take longer to fix this issue.

Did the debugger work with HAL in previous versions?

Thanks for all this feedback
  
Back to top
IP Logged
 
Clayton
Junior Member
**
Offline


Posts: 19
Joined: Oct 29th, 2012
Re: problems making debug work with ArduPilot (APM:Plane)
Reply #18 - Sep 14th, 2013 at 11:36pm
Print Post  

I see that the serial is defined by 
Code
Select All
cliSerial = hal.console; 


and then calls to it are done with
Code
Select All
cliSerial->println(); 



I searched all files for "serial" and dumped the results here:
https://www.dropbox.com/s/ww55s4xvwz82168/APM-find-serial.txt
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: problems making debug work with ArduPilot (APM:Plane)
Reply #19 - Sep 15th, 2013 at 12:03am
Print Post  
Okay that is a great start!! 

The debugger can use a different serial object name such as cliSerial, however we need to determine what cliSerial is based on otherwise you will still get a compile error in this area. 

Anyway, regardless of the fact that debug compile will still fail you can configure the debugger to use an object named cliSerial by entering cliSerial into the RemotePort project property. nb: It will fail because the object is not currently derived from a supported type ( which are HardwareSerial, USBSerial, CDC, FastSerial, SoftwareSerial and a few others)


So the next question I guess is what happens if you press F12 on the .console of HAL.console ? This should show us the definition of cliSerial 

Can you drill down to the base object. I suspect it will be HAL::Stream or something? in which case we can add a custom debugger definition so that it knows about it. 

EDIT: i see in the dopbox listing (thanks). Can you drill down into BetterStream? Is there a non-hal generic versions we can use?
Code
Select All
AP_HAL::BetterStream 



We might also need to work out  the bare minimum of #includes to use a HAL Stream. Which will also probably resolve the data type errors.

Is there an example project that simply tests a  cliSerial connection and simple println()? This might give us an easier view of what we need to include to support this serial transport type.
« Last Edit: Sep 15th, 2013 at 12:08am by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint