Menu

Focuserv175_DRV8825_HW203 fails to compile

Jon Garrod
2019-03-13
2019-03-17
  • Jon Garrod

    Jon Garrod - 2019-03-13

    Hi All

    I was doing a bit of optimising and I noticed that if I undefine TEMPERATUREPROBE the code will no longer compile. I have narrowed it down to the section with the header file includes.

    // FIRMWARE START
    #include <Arduino.h>
    #include <myQueue.h>                    // By Steven de Salas
    #include <myEEPROM.h>                   // needed for EEPROM
    #include <myeepromanything.h>           // needed for EEPROM
    #ifdef TEMPERATUREPROBE
    #include <OneWire.h>                    // needed for DS18B20 temperature probe, see https://github.com/PaulStoffregen/OneWire
    #include <myDallasTemperature.h>        // needed for DS18B20 temperature probe, see https://github.com/milesburton/Arduino-Temperature-Control-Library
    #endif
    

    If TEMPERATUREPROBE is defined there is no issue.
    However when I undefine it I can only get it to compile if I change it to:

    // FIRMWARE START
    #include <Arduino.h>
    #include <myQueue.h>                    // By Steven de Salas
    #include <myEEPROM.h>                   // needed for EEPROM
    #include <myeepromanything.h>           // needed for EEPROM
    //#ifdef TEMPERATUREPROBE
    //#include <OneWire.h>                    // needed for DS18B20 temperature probe, see https://github.com/PaulStoffregen/OneWire
    #include <myDallasTemperature.h>        // needed for DS18B20 temperature probe, see https://github.com/milesburton/Arduino-Temperature-Control-Library
    //#endif
    
    For some reason it seems that you need to #include myDallasTemperature.h if you undefine TEMPERATUREPROBE.
    
    This is the actual error I get from the compiler:
    

    Arduino: 1.8.8 (Windows Store 1.8.19.0) (Windows 10), Board: "Arduino Nano, ATmega328P (Old Bootloader)"

    \vmware-host\Shared Folders\Documents\Arduino\libraries\myEEPROM/myeepromanything.h: In function 'EEPROM_writeAnything.constprop':

    \vmware-host\Shared Folders\Documents\Arduino\libraries\myEEPROM/myeepromanything.h:11:1: internal compiler error: Segmentation fault

    }

    ^

    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.19.0_x86__mdqgnx93n4wtt\hardware\tools\avr/bin/avr-gcc returned 1 exit status

    compilation terminated.

    c:/program files/windowsapps/arduinollc.arduinoide_1.8.19.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

    exit status 1
    Error compiling for board Arduino Nano.

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

    ~~~
    I have searched for a possible orphaned '}' but can't find it yet.

    Not critical but would be nice to fix it.

    Cheers

    Rishi

     
  • brownrb

    brownrb - 2019-03-14

    Focuserv175_DRV8825_HW203.ino

    I change line 43 to read
    //#define TEMPERATUREPROBE 1

    then I recompile. No errors. I am using the recommended Arduino IDE for this project of 1.6.8

    Sketch uses 21,362 bytes (69%) of program storage space. Maximum is 30,720 bytes.
    Global variables use 748 bytes (36%) of dynamic memory, leaving 1,300 bytes for local variables. Maximum is 2,048 bytes.

     
  • Jon Garrod

    Jon Garrod - 2019-03-15

    I am using a slightly later version (1.8.8) of the compiler so I guess thats it.

     
  • brownrb

    brownrb - 2019-03-15

    Hi Jon
    Nope that is not it. It compiles fine with 1.8.8 - see attached. Please post your ino file here and I will take a look at it,

     
  • brownrb

    brownrb - 2019-03-15

    What is \vmware-host\ There is something you have not said about your setup. Is this a standard Windows installation. Your error messages seem to point to am issue wth your installation

     
  • Jon Garrod

    Jon Garrod - 2019-03-16

    Bizar! I just tried it again and it now it works fine with 1.8.8 of the IDE. The VM it runs on was rebooted and patched in the meantime but anyway now it compiles fine with or without the TEMPERATUREPROBE.

     
  • Jon Garrod

    Jon Garrod - 2019-03-16

    I run the IDE in a virtual machine. The host machine is a Mac but in order to run your test program I run the IDE in a VM. I guess there was some file sharing issue and after everything was rebooted it sorted itself out.

     
  • brownrb

    brownrb - 2019-03-17

    Hi Jon
    Yes I suspected you were on a Mac and using a VM. But is there not a native Arduino IDE for the Mac? All my testing is obviously done on a Windows machine, it is all I have.
    Anyhow, glad things are now working.

    regards
    Robert

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.