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
Locked Topic Compiling 'BLINKER' with the Debugger and SoftwareSerial (Read 31703 times)
Christos
Junior Member
**
Offline


Posts: 30
Location: North Carolina
Joined: Feb 26th, 2014
Compiling 'BLINKER' with the Debugger and SoftwareSerial
Feb 26th, 2014 at 10:03pm
 
I'm testing out your software before purchasing it and get the following message:

I use Arduino 1.5.5-r2 and Atmel Studio 6 (6.1.2730 - Service Pack 2)

Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK'
Binary sketch size: 1640 bytes (used 1% of a 258048 byte maximum) (0.34 secs)
Compiling debug version of 'BLINKER' for 'Arduino Mega 2560 or Mega ADK'
SoftwareSerial.cpp:In member function 'void SoftwareSerial::begin(long int)'
SoftwareSerial.cpp:399: error: 'digitalPinToPCICR' was not declared in this scope
SoftwareSerial.cpp:401: error: 'digitalPinToPCICRbit' was not declared in this scope
SoftwareSerial.cpp:402: error: 'digitalPinToPCMSK' was not declared in this scope
SoftwareSerial.cpp:402: error: 'digitalPinToPCMSKbit' was not declared in this scope
SoftwareSerial.cpp:In member function 'void SoftwareSerial::end()'
SoftwareSerial.cpp:417: error: 'digitalPinToPCMSK' was not declared in this scope
SoftwareSerial.cpp:418: error: 'digitalPinToPCMSKbit' was not declared in this scope
Error compiling
.
.......................................................
***** Visual Micro Debugger Compiler Error Help *******
.......................................................
...

My Source Code for the test is:

int loop_cnt = 0;

void setup()
{

     /* add setup code here */
     pinMode(13, OUTPUT);
}

void loop()
{

     /* add main program code here */
     digitalWrite(13, HIGH);
     delay(100);
     loop_cnt++;
     digitalWrite(13, LOW);
     delay(1000);
     
}

Any help is greatly appreciated.

I'm able to compile using the following code in the Arduino IDE using the SoftSerial library:

#include <SoftwareSerial.h>

int loop_cnt = 0;

SoftwareSerial mySerial(68, 69); // RX, TX Analog 14 and 15.

void setup()
{
    // set the data rate for the SoftwareSerial port
    mySerial.begin(4800);
    mySerial.println("Hello, world?");

    pinMode(13, OUTPUT);

}

void loop()
{
     /* add main program code here */
     digitalWrite(13, HIGH);
     delay(250);
     digitalWrite(13, LOW);
     delay(250);
     loop_cnt++;
        if ( loop_cnt%2 == 0) mySerial.println(loop_cnt,DEC);
}
« Last Edit: Feb 27th, 2014 at 7:57pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #1 - Feb 26th, 2014 at 10:19pm
 
Hi Chris,

Thanks for the post and great detail. 

The error looks like the result of an incorrect setting in the debugger project properties or some new strange bug.

Before working through the debugger problem with you I would like to confirm that if you click "start without debugging" or select "Release"  mode you will see a successful standard Arduino compile.

This is confirmed by the first couple of lines of your report showing a successful compile in .34 of a second.

Quote:
Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK'
Binary sketch size: 1640 bytes (used 1% of a 258048 byte maximum) (0.34 secs)


By default starting an Arduino debug session will perform two compiles. 

One compile with your native sketch code and then one from a temp copy with some extra debug code. You can switch off the first if you want but it makes error messages less confusing for new users especially.

The error we see below seems to indicate that SoftwareSerial has been selected as the debugger transport method. 

Normally we use the built in Arduino serial by default, but you have probably read in the wiki that you can switch to softwareSerial and use one or two digital pins for debug?

I am hoping you say that you have switched on SoftwareSerial in the project properties but that you have not configured a PinTx or PinRx? Or as an alternative to pin specification maybe you have specified your own RemotePort "object" as well? (If so then the object must be based on SoftwareSerial)

If you did not mean to set the RemoteTransport property to SoftwareSerial then clear it or set it to HardwareSerial which is the default and caters for all types of Serial,Serial1, Serial2, etc. built in serial objects.

Quote:
Compiling debug version of 'BLINKER' for 'Arduino Mega 2560 or Mega ADK'
SoftwareSerial.cpp:In member function 'void SoftwareSerial::begin(long int)'
SoftwareSerial.cpp:399: error: 'digitalPinToPCICR' was not declared in this scope
SoftwareSerial.cpp:401: error: 'digitalPinToPCICRbit' was not declared in this scope
SoftwareSerial.cpp:402: error: 'digitalPinToPCMSK' was not declared in this scope
SoftwareSerial.cpp:402: error: 'digitalPinToPCMSKbit' was not declared in this scope
SoftwareSerial.cpp:In member function 'void SoftwareSerial::end()'
SoftwareSerial.cpp:417: error: 'digitalPinToPCMSK' was not declared in this scope
SoftwareSerial.cpp:418: error: 'digitalPinToPCMSKbit' was not declared in this scop


I hope some of this strikes a chord. If not then please zip and email the sketch along with the visual micro sub folder below the sketch.

Thanks

  
Back to top
IP Logged
 
Christos
Junior Member
**
Offline


Posts: 30
Location: North Carolina
Joined: Feb 26th, 2014
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #2 - Feb 27th, 2014 at 4:26pm
 
Thanks for the response.  This is what I have:

When I "Start without debugging" (Ctrl+Alt+F5) I get:

Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK'
Binary sketch size: 1640 bytes (used 1% of a 258048 byte maximum) (0.34 secs)
Uploading to I/O board using 'COM35'
Done uploading

When I "Start Debugging" (F5) I get the message above.

My Mega, as you may know has 4 serial ports available, but the project I'm working on (which is why I downloaded your software for) is rather substantial and requires all 4 hardware serial ports to work properly.

That's why I was trying to debug this simple sketch using a SoftwareSerial port.  As a proof of concept if you will.

The pins I'm using on the Arduino are 68 and 69 (The Analog pins A14 and A15) based on information from the SoftwareSerial documentation.

My "Micro Debug" project properties are as follows:

Enable Break/Pause: True
Hit Counters: Milliseconds
Inc. Disable Breakpoints: False
Jump To Source: False
Local Port: COM37 (using a prolific usb-to-serial adapter if that matters)
Local Speed: (blank)
Remote Pin RX: 69
Remote Pin TX: 68
Remote Port: (blank)
Remote Speed: (blank)
Remote Transport: SoftwareSerial
Startup Delay (ms): 0
Startup Delay or Dtr: True
Startup Message: Blah Blah
Startup Wait: False
Throttle Enabled: True
Validation Skip: False
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #3 - Feb 27th, 2014 at 4:31pm
 
Hi Chris,

Thanks for the message. Your use of SoftwareSerial makes perfect sense and this must be a bug. We will test later today as new release is due but let's be sure of the problem...

Would you please switch on tools>options>visual micro>compiler>verbose and compiler>show build folder.

Then run the compile and email the output to info [at] visualmicro.com

In the compiler output you will see a file:/// link to the build folder. Please zip and email the [sketchname].cpp from the build folder.

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #4 - Feb 27th, 2014 at 4:48pm
 
ps: Out of interest does it work okay if you use a couple of digital pins? Never tested with analogs but will do later.
  
Back to top
IP Logged
 
Christos
Junior Member
**
Offline


Posts: 30
Location: North Carolina
Joined: Feb 26th, 2014
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #5 - Feb 27th, 2014 at 4:53pm
 
I'll test with Digital Pins.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #6 - Feb 27th, 2014 at 4:56pm
 
Okay.

Got your email with the sketch source but I needed the verbose build output and the cpp from the build folder....

Quote:


Would you please switch on tools>options>visual micro>compiler>verbose and compiler>show build folder.

Then run the compile and email the output to info [at] visualmicro.com

In the compiler output you will see a file:/// link to the build folder. 

Please zip and email the [sketchname].cpp from the build folder.


Appreciated
« Last Edit: Feb 27th, 2014 at 4:57pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Christos
Junior Member
**
Offline


Posts: 30
Location: North Carolina
Joined: Feb 26th, 2014
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #7 - Feb 27th, 2014 at 4:57pm
 
Will Do
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #8 - Feb 27th, 2014 at 5:13pm
 
Chris,

Please confirm if you are using Arduino 1.0.5-r2 or 1.5.5-r2?

You have stated 1.5 but the output seems to suggest you have configured the 1.0.x application in Visual Micro.

Please re-check the location you have set to the Arduino Ide.

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


Posts: 30
Location: North Carolina
Joined: Feb 26th, 2014
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #9 - Feb 27th, 2014 at 5:20pm
 
Doesn't work with Digital Pins 10 and 11 either.  I'll send files to you.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #10 - Feb 27th, 2014 at 5:22pm
 
Check your ide setting as per above
  
Back to top
IP Logged
 
Christos
Junior Member
**
Offline


Posts: 30
Location: North Carolina
Joined: Feb 26th, 2014
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #11 - Feb 27th, 2014 at 5:34pm
 
When I changed to Arduino 1.5.x i not longer get a list of Devices to choose from.

When I try to create a new project I get an "Unable to Create Arduino Project" message.
  
Back to top
 
IP Logged
 
Christos
Junior Member
**
Offline


Posts: 30
Location: North Carolina
Joined: Feb 26th, 2014
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #12 - Feb 27th, 2014 at 5:35pm
 
Sorry, exact error message was:

"Unable to create an Arduino project for ATmel Studio"
  
Back to top
 
IP Logged
 
Christos
Junior Member
**
Offline


Posts: 30
Location: North Carolina
Joined: Feb 26th, 2014
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #13 - Feb 27th, 2014 at 5:39pm
 
If I create a new project with "Arduino 1.0.x" selected and switch to "Arduino 1.5.x" I get the following message when I hit F5.

Unable to locate configuration data for this hardware. Please confirm you are using the correct ide (.exe) location

I verified all the paths.

Anything else I can do for you?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #14 - Feb 27th, 2014 at 6:01pm
 
Please confirm if you have installed 1.5.5-r2 or 1.0.5-r2

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


Posts: 30
Location: North Carolina
Joined: Feb 26th, 2014
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #15 - Feb 27th, 2014 at 6:09pm
 
When I do "Help" | "About Arduino" it says "1.5.5-r2"
The "revisions.txt" file in C:\Program Files (x86)\Arduino says it's "ARDUINO 1.5.5-r2 BETA 2014.01.10"

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #16 - Feb 27th, 2014 at 7:10pm
 
Ok thanks the problem is clear now and SoftwareSerial has been retested and is working okay.

Here is a short summary of what I think will fix the problem followed by some info for you or anyone else interested to hear about the Arduino 1.5 beta

I think your Arduino 1.5 install is not clean and I am not suggesting that is your fault (see below)

1) 
Please uninstall the arduino ide and after that ensure C:\Program Files (x86)\Arduino is empty. Or just re-install 1.5.5-r2 into a clean folder.

2)
After that remove the path from the Arduino 1.0.x property in Visual Micro and configure the 1.5.x path as C:\Program Files (x86)\Arduino to the Arduino 1.5.x

Then everything should work correctly?

nb: If you also want a 1.0.x install then use a zip from the Arduino download page. Unzip into a clean folder.

Why

We probably need to re-test the Arduino Ide installer when upgrading from 1.0.x to 1.5.x. I guess this might be what you have done and is probably the cause of the problem.

The only reason why the Arduino 1.0.x setting appears to work is because Arduino are currently including 1.0.x formats with their 1.5 beta. They have a big statement on their web site explaining that it is in a state of flux at the moment.

For this reason Visual Micro allows you to point to a clean 1.0.x Arduino Ide and/or a clean Arduino 1.5.x Ide installation(s) which has so far (until now) allowed everyone to easily switch between formats.

For your info, (might not be important) most people don't realize that multiple arduino versions can be installed by using the zip files provided on their download page. 

The only useful task the Arduino Ide windows installer does is save you having to install the usb drivers from the arduinoide/drivers folder. So once the usb drivers are installed you can grab as many different Arduino versions as you want.

This is such as basic problem you are having that you can not configure the 1.5.x location. It can't really be anything other than some problem with the Arduino install. 

It's easier for the Arduino ide to get the versions right because each .exe is hard coded for a single Arduino structure where as Visual Micro has to often look at the files on disk to determine which formats to use. 

At the moment it sounds as if the -r2 beta upgrade has left behind some 1.0.x stuff that is confusing Visual Micro. We will test but should be easily avoided by keeping your Arduino 1.0.x and 1.5.x installations separate. 

Thanks for your patience, Sigh!
  
Back to top
IP Logged
 
Christos
Junior Member
**
Offline


Posts: 30
Location: North Carolina
Joined: Feb 26th, 2014
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #17 - Feb 27th, 2014 at 7:37pm
 
Thanks, I was aware of the Arduino "unzip anywhere".  I'll download and separate the two different versions into their own directory trees.

Crossing my fingers.  Thanks for your help.  I'll post my findings here.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #18 - Feb 27th, 2014 at 7:44pm
 
Thanks, I've got my fingers crossed too. I'm surprised more people haven't hit this issue.
  
Back to top
IP Logged
 
Christos
Junior Member
**
Offline


Posts: 30
Location: North Carolina
Joined: Feb 26th, 2014
Re: Compiling 'BLINKER' for 'Arduino Mega 2560 or Mega ADK' SoftwareSerial.cpp:In member function 'void
Reply #19 - Feb 27th, 2014 at 7:45pm
 
I'm just lucky that way....
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint