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 Code compiles cleanly but nothing gets executed - (SOLVED - USER ERROR) (Read 3794 times)
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Code compiles cleanly but nothing gets executed - (SOLVED - USER ERROR)
Jan 3rd, 2016 at 5:42am
Print Post  
My sketch calls a number of libraries. They are declared before the setup function. Each has a constructor which has been instrumented with a single statement: _enabled = true;

I have placed breakpoints on each of these statements, but they never get executed.

The first two lines of the setup function are Serial.begin(115200); Serial.println("SETUP"); 

These lines never get executed either. 

So it appears that the code is loading just fine, but never executing; however, I don't quite believe that. I saw a case yesterday where it executed two of the constructors but failed before getting to the third.

One other thing: It runs fine in release mode, but not in debug mode.

In any case, I am baffled about how to proceed. All code attached as ZIP file. Lips Sealed
« Last Edit: Jan 26th, 2016 at 2:20pm by Tim@Visual Micro »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Code compiles cleanly but nothing gets executed.
Reply #1 - Jan 3rd, 2016 at 4:11pm
Print Post  
Hi Bob,

When you zip your project you really do need to have saved it and exited visual studio otherwise the breakpoints are missing.

Visual micro issues the Serial.begin and sends some serial at the start of the setup(). Does the same problem happen with your trace off so your own serial does not get sent?

Are you breakpoints on simple code lines or on complex "if", "case" statements etc?

Can make a debug upload them zip the temp build folder so I can compare with your project and look at what debug instructions have been added to the code.

Thanks
  
Back to top
WWW  
IP Logged
 
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Re: Code compiles cleanly but nothing gets executed.
Reply #2 - Jan 4th, 2016 at 1:26am
Print Post  
Thanks for your help with this. I got it to execute then I broke it again as I try to get my conditional library inclusion code working. What I get is a list of warnings that don't tell me much. Can you tell me a bit more about what the compiler is saying so I can diagnose and fix these problems?

I have included the entire project and the output of the compile (See output.txt) and I exited from VS before building the ZIP file.

Thanks! Smiley
« Last Edit: Jan 4th, 2016 at 1:28am by Bob Jones »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Code compiles cleanly but nothing gets executed.
Reply #3 - Jan 4th, 2016 at 1:45am
Print Post  
Okay I'll take a look over the next few days.

The best place for compiler output is the output window and not the error list
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Code compiles cleanly but nothing gets executed.
Reply #4 - Jan 7th, 2016 at 2:29pm
Print Post  
Hi Bob,

I've looked at your project and see two things that might help.

The first is that your Visual Micro is probably out of date. The latest release contains a bug fix for this type of debug error which relates to multiple breakpoints in different libraries:-

Quote:
BJDualMotor.cpp.o:(.bss.__VisualMicro_GlobalLastMillis__+0x0): multiple definition of `__VisualMicro_GlobalLastMillis__
BJDetector.cpp.o:(.bss.__VisualMicro_GlobalLastMillis__+0x0): first defined here
ld.exe:Disabling relaxation: it will not work with multiple definitions
collect2.exe*:error: ld returned 1 exit status
Error creating .elf


I can also see that you have #included obstacle avoidance twice in your code which might also cause issues. The 2nd entry is here:-

Quote:
/***********************************************************
* OBSTACLE DETECTION DEFINITION
*/
#include <BJDetector.h>

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