Compiler Errors Have My Head Spinning

I am running Arduino 1.9.8 on Windows 10. I have a Pro Micro 5V/16MHz (ATmega32U4) and a RockBLOCK Iridium modem (9602). This modem is LVTTL but 5V tolerant so, for now, I have directly connected the TXO and RXI pins of the Pro Micro to the TX and RX of the modem. This means that the modem is on Serial1. Using a small program, I can type into my terminal emulator, have it go into the Pro Micro via USB, out on Serial 1, and into the modem. The response from the modem takes the reverse path. So there is no question that the hardware works.

My problem is that when I try to run basicSendTest.ino I get the errors shown in the file "compiler errors". I figured out that if I comment out err = modem.begin(); the code compiles without errors. I believe I found this function defined in IridiumSBD.ccp int IridiumSBD::begin(). I commented out all of the code in this subroutine and still get the compiler errors. So if I prevent the compiler from seeing the call to modem.begin(), it compiles. But if I give it nothing to see in the subroutine, it generates the errors.

I'm guessing that either I am not modifying the correct subroutine or somewhere in there the code is trying to access a hardware register that does not exist on the ATmega32U4. In any event, I'm stumped.

Thanks for your help,

Rick

IridiumSBD.cpp (25.1 KB)

IridiumSBD.h (5.91 KB)

basicSendTest.ino (2.9 KB)

compiler errors.txt (828 Bytes)

You should at least post the compiler errors and .ino file here as text (in Code Tags), they are small enough.

I am running Arduino 1.9.8 on Windows 10.

The latest version from the Arduino team (arduino.cc) is 1.8.9. Where did you get that version? Wherever is was, that is where you should be asking questions about it, not here.

PaulS:
The latest version from the Arduino team (arduino.cc) is 1.8.9. Where did you get that version? Wherever is was, that is where you should be asking questions about it, not here.

My mistake. I should have written 1.8.9 and not 1.9.8.

Rick

gfvalvo:
You should at least post the compiler errors and .ino file here as text (in Code Tags), they are small enough.

I don't understand what you are asking for. All of these files can be opened as text.

Rick

rgsparber:
I don't understand what you are asking for. All of these files can be opened as text.

Well, when you're asking people to help you (for free), you should make it as easy as possible for them to do so. One way to do that is to not make them down download files (that may or may not be suspect) onto their computer and open them when you can post them in-line instead. And when you post them in-line on the forum, using Code Tags makes them even easy to read and copy / paste. To learn how to use Code Tags, see Item #7 here: Read this before posting a programming question ... (note the title).

gfvalvo:
Well, when you're asking people to help you (for free), you should make it as easy as possible for them to do so. One way to do that is to not make them download files (that may or may not be suspect) onto their computer and open them when you can post them in-line instead. And when you post them in-line on the forum, using Code Tags makes them even easy to read and copy / paste. To learn how to use Code Tags, see Item #7 here: Read this before posting a programming question ... (note the title).

Thanks for the guidance. I'll attempt to clean this up.

The files basicSendTest.ino, IridiumSBD.h, and IridiumSBD.cpp come from Mikal Hart (IridiumSBD | Arduiniana) and have been used by others for at least a few years. I did send an email to Mikal but have not heard back. The last response on this site was 2 years ago.

I'm looking for debugging pointers and insights because the error messages from the compiler don't give me any hints. It took me a while to isolate the problem down to the modem.begin() line in basicSendTest.ino. I can reliably make the errors come and go by commenting out this line and then removing the comments. Clearly, there is more going on here than I currently understand. I have uploaded all involved files since I don't know what is important.

In basicSendTest.ino, line 41 is

 err = modem.begin();

I believe it is defined in IridiumSBD.cpp, starting on line 29

int IridiumSBD::begin()
{
   if (this->reentrant)
      return ISBD_REENTRANT;

   this->reentrant = true;

   int ret = internalBegin();

   this->reentrant = false;

   // Absent a successful startup, keep the device turned off
   if (ret != ISBD_SUCCESS)
   power(false);
   return ret;
}

I do hope the above is useful.

Thanks for your help,

Rick

I do hope the above is useful.

No. To make sense of it, ALL the code in the .ino file is needed.

Here is how to properly post the compiler error messages:

lto1.exe: internal compiler error: in lto_output_varpool_node, at lto-cgraph.c:624

Please submit a full bug report,

with preprocessed source if appropriate.

See <http://gcc.gnu.org/bugs.html> for instructions.

lto-wrapper.exe: fatal error: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr/bin/avr-gcc returned 1 exit status

compilation terminated.

c:/program files/windowsapps/arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld.exe: error: lto-wrapper failed

collect2.exe: error: ld returned 1 exit status

Using library Iridium_SBD at version 1.0.0 in folder: C:\Users\Owner\Arduino\arduinosketchfolder\libraries\Iridium_SBD 
exit status 1
Error compiling for board SparkFun Pro Micro.

Well, I didn't find any code on that web site, but I did Google and find the GitHub Page which is more useful. There is no "basicSendTest.ino" in the examples, but there is a "BasicSend.ino" That gave a similar error when I tried to compile it for a Mega:

Build options changed, rebuilding all
Archiving built core (caching) in: C:\Users\GFV\AppData\Local\Temp\arduino_cache_714955\core\core_arduino_avr_mega_cpu_atmega2560_7e2b8c854850764f47be5e7ab493f1da.a
lto1.exe: internal compiler error: in lto_output_varpool_node, at lto-cgraph.c:624

Please submit a full bug report,

with preprocessed source if appropriate.

See <http://gcc.gnu.org/bugs.html> for instructions.

lto-wrapper.exe: fatal error: D:\arduino-1.8.5\portable\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2/bin/avr-gcc returned 1 exit status

compilation terminated.

d:/arduino-1.8.5/portable/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld.exe: error: lto-wrapper failed

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

Looks like a tool chain problem, not a coding issue.

Looks similar to this problem, a known compiler bug:

Topic: Code that worked under 1.8.5 will not compile under 1.8.6 or 1.8.7.

Edit:
I tried changing to Arduino Avr Boards version 1.6.21, gives a segmentation fault error. Possibly compiling on an earlier version of the IDE might work, doubt the error is in the code itself.

Thanks to all for your help. Knowing that others can reproduce the error and that it is not in the code is very helpful.

Rick

david_2018:
I tried changing to Arduino Avr Boards version 1.6.21, gives a segmentation fault error. Possibly compiling on an earlier version of the IDE might work, doubt the error is in the code itself.

That is very strange. I've never heard of a segmentation fault error with Arduino AVR Boards 1.6.21. I just gave it a try with Arduino AVR Boards installed on Arduino IDE 1.6.9 and it compiled fine. I would recommend that rgsparber have a try with Arduino AVR Boards 1.6.21 to see if it doesn't solve the problem.