mikalhart / IridiumSBD

Arduino library for RockBLOCK Iridium satellite modem (http://rock7mobile.com)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GCC compiler error when trying to compile the example sketch 'PassThru'

Chase0fSpades opened this issue · comments

Arduino: 1.8.6 (Windows 10), TD: 1.44, Board: "Arduino/Genuino Uno"

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 (x86)\Arduino\hardware\tools\avr/bin/avr-gcc returned 1 exit status

compilation terminated.

c:/program files (x86)/arduino/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

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

This problem only occurs with the avr-gcc 5.4.0-atmel3.6.1-arduino2 used by Arduino AVR Boards 1.6.22 and newer. The relevant bug report is here:
arduino/ArduinoCore-avr#39
A code workaround is described in that thread.


An easier, though less desirable, workaround is to roll back Arduino AVR Boards to 1.6.21:

  1. Tools > Board > Boards Manager
  2. Wait for downloads to finish.
  3. Click on "Arduino AVR Boards".
  4. Select 1.6.21 from the dropdown menu.
  5. Click "Install".
  6. Wait for installation to finish.
  7. Click "Close".

Due to a bug, you can not do this with Arduino IDE 1.8.6 but you can with any other Arduino IDE version.

If you have File > Check for updates on startup enabled, the Arduino IDE will periodically prompt you to update Arduino AVR Boards. You must refrain from doing so, otherwise the error will come back.

So I had a thread about this issue here: https://forum.arduino.cc/index.php?topic=566280.0

internalBegin() causes the issue here

`// The usual initialization sequence
FlashString strings[3] = { F("ATE1\r"), F("AT&D0\r"), F("AT&K0\r") };
for (int i=0; i<3; ++i)
{
send(strings[i]);
if (!waitForATResponse())
return cancelled() ? ISBD_CANCELLED : ISBD_PROTOCOL_ERROR;
}

`
The solution we found was

` // The usual initialization sequence
const FlashString a = F("ATE1\r");

const FlashString b = F("AT&D0\r");
const FlashString c = F("AT&K0\r");
const FlashString strings[3] = { a, b, c };
for (int i=0; i<3; ++i)
{
send(strings[i]);
if (!waitForATResponse())
return cancelled() ? ISBD_CANCELLED : ISBD_PROTOCOL_ERROR;
}`

Hope this helps.

Outstanding analysis @stkeane1. Sorry for the abysmally slow reply. I'll incorporate a variant of this in a forthcoming update. Thanks again.

Please try new release 2.0.0 and see if this is resolved. Thanks again @stkeane1