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) Can't get into the loop (Read 9762 times)
lixiaohui
Newbies
*
Offline


Posts: 4
Joined: Mar 16th, 2013
Can't get into the loop
Mar 24th, 2013 at 10:07pm
Print Post  
Hi, my team is doing a project adding more functions in the Quad-Copter with the ArduMega 2560.
Just got this great debugging tool but having some problem.

just to test the quad-copter code we got online from the Arducopter website (we tested and it can make the copter fly), 
i put a breakpoint at the first command in the main loop.(the loop in the ArduCopter.pde) and set it to show "in the loop" when it is hit, but i got nothing in the output. so it means that it has never get into the loop?

What may the reason that causes this?

I tried the sample code (blink LED, and my another simple sensor code), and all of them get the messages in the output window.

also for this complicated Arducopter code, when i put the breakpoints at the commend that are outside the loop, there will get errors.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Can't get into the loop
Reply #1 - Mar 24th, 2013 at 10:59pm
Print Post  
Hi,

Can you send a screen shot of breakpoint position please to info[at]visualmicro.com.

The debugger adds serial output to the arduino code. Putting them in a loop is okay as long as you use conditions or the hit counter system otherwise your loop will slow down. 

If too many serial messages are received then the arduino might loose some serial messages which would mean breakpoints might be lost.

Often it is a good idea to use a 2nd serial port for the debugger so that telemetry messages combined with debug messages do not overload the serial buffer.

Thanks
  
Back to top
IP Logged
 
lixiaohui
Newbies
*
Offline


Posts: 4
Joined: Mar 16th, 2013
Re: Can't get into the loop
Reply #2 - Mar 25th, 2013 at 10:25pm
Print Post  
Tim@Visual Micro wrote on Mar 24th, 2013 at 10:59pm:
2nd serial port for the debugger so that telemetry messages combined with debug messages do not overload the serial buffer


Thanks for the reply!
I just sent you an email:)
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Can't get into the loop
Reply #3 - Mar 26th, 2013 at 8:41pm
Print Post  
I should leave the hit count at 0 until you have read about it in the vm wiki. You have set a value of two which in theory will send 8 million messages per second instead of 16 million.

I am going to step back on this thread and ask if you have read about the need to ensure the debugger works at the same serial speed as the program you are using. This applies to all instances where the serial port is shared. The default speed is 115200. If you program alters the speed during the setup then breakpoints will appear to not work if the debugger LocalSpeed project property is not set to the correct value.

Is you Arduino program code using the serial port? If so at what speed?
  
Back to top
IP Logged
 
lixiaohui
Newbies
*
Offline


Posts: 4
Joined: Mar 16th, 2013
Re: Can't get into the loop
Reply #4 - Mar 27th, 2013 at 1:59am
Print Post  
Tim@Visual Micro wrote on Mar 26th, 2013 at 8:41pm:
I should leave the hit count at 0 until you have read about it in the vm wiki. You have set a value of two which in theory will send 8 million messages per second instead of 16 million.

I am going to step back on this thread and ask if you have read about the need to ensure the debugger works at the same serial speed as the program you are using. This applies to all instances where the serial port is shared. The default speed is 115200. If you program alters the speed during the setup then breakpoints will appear to not work if the debugger LocalSpeed project property is not set to the correct value.

Is you Arduino program code using the serial port? If so at what speed?


for the hit count, i left it default (which is 0)at first and it got the same thing.

For the serial speed, i set it to 115200 too (send you another email with a clearer screen shot).

kinda confused by whether the program using the serial port, I want to say yes because it prints something out in it, but maybe no because after print out the basic info,like:
Port open


Init ArduCopter V2.9.1

Free RAM: 1537
FW Ver: 120
----------------------------------------


load_all took 7104us
?3?      




It keep printing out symbols, can't copy them here, but you can see them in the screen shot.
Also i think the program is not altering the speed because It's a program which control a quad-copter,but actually i don't know. 



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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Can't get into the loop
Reply #5 - Mar 27th, 2013 at 8:24am
Print Post  
The symbols are ok and can be ignored. Your program is certainly using serial but it is sending binary hence the symbols. Have you read the wiki page on visualmicro wiki for apm? Have you set transport to fastserial in project properties?
  
Back to top
IP Logged
 
lixiaohui
Newbies
*
Offline


Posts: 4
Joined: Mar 16th, 2013
Re: Can't get into the loop
Reply #6 - Mar 27th, 2013 at 2:55pm
Print Post  
For the remote transport part, it is set to fastserial.

I can't find the apm part in the wiki, I can only find the Navigator one.

Can you give me the link to it?
  
Back to top
 
IP Logged
 
gelius59
Junior Member
**
Offline


Posts: 82
Location: Ukraine
Joined: Oct 6th, 2012
Re: Can't get into the loop
Reply #7 - Mar 27th, 2013 at 6:05pm
Print Post  
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Can't get into the loop
Reply #8 - Mar 27th, 2013 at 7:15pm
Print Post  
An apm overview is at the top of the list. But if you have fastserial set then you have done well. I assume that localport and remoteport properties are empty so you are debugging using the main arduino serial port and not xbee telem port. So the default speed is expected to be 115200 and last time I tested apm it worked at 115200. I will test again in a couple of days.

In the meantime set project property hit counter to Millis and set the breakpoint hit count to every 300. Does that make a difference? 
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Can't get into the loop
Reply #9 - Mar 28th, 2013 at 9:25am
Print Post  
As a test please also add a breakpoint to the setup and send a screenshot of the trace when the breakpoint is hit. Thanks
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint