Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    First time compile issues

    Scheduled Pinned Locked Moved
    Firmware developers
    2
    9
    1.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jpsantosundefined
      jpsantos
      last edited by

      Hi everyone, I'm having trouble getting past the stage of building the project for the first time, on a Windows based Eclipse.

      I'm working with latest version of the master branch of dc42/RepRapFirmware and dc42/CoreNG, as of this morning in fact.
      I'm building SAM4E of CoreNG and DuetEthernet of RepRapfirmware.

      After successfully building the CoreNG archive my g++ cross compiler bombs out as per below.
      Also, it doesn't seem to be referencing the libCoreNG.a lib or am I wrong or shouldn't it?

      [[language]]
      10:21:59 **** Build of configuration DuetEthernet for project RepRapFirmware ****
      make all 
      Building file: ../src/Storage/FileStore.cpp
      Invoking: Cross G++ Compiler
      arm-none-eabi-g++ -D__SAM4E8E__ -DCORE_NG -DDUET_NG -DDUET_ETHERNET -Dprintf=iprintf 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\cores\arduino" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\libraries\Flash" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\libraries\SharedSpi" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\libraries\Storage" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\libraries\Wire" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\asf" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\asf\common\utils" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\asf\common\services\clock" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\asf\common\services\ioport" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\asf\sam\drivers\dmac" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\asf\sam\drivers\efc" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\asf\sam\drivers\matrix" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\asf\sam\drivers\pdc" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\asf\sam\drivers\pmc" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\asf\sam\drivers\spi" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\asf\sam\drivers\twi" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\asf\sam\services\flash_efc" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\asf\sam\utils" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\asf\sam\utils\cmsis\sam4e\include" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\asf\sam\utils\header_files" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\asf\sam\utils\preprocessor" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\asf\thirdparty\CMSIS\Include" 
      -I"C:\workdir\fHDX\Duet Refactor\CoreNG\variants\duetNG" 
      -I"C:\Users\joaos\git\RepRapFirmware\src" 
      -I"C:\Users\joaos\git\RepRapFirmware\src\DuetNG" 
      -I"C:\Users\joaos\git\RepRapFirmware\src\DuetNG\DuetEthernet" 
      -I"C:\Users\joaos\git\RepRapFirmware\src\DuetNG\DuetEthernet\Wiznet\Ethernet" -O2 -Wall -c -std=gnu++11 -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -ffunction-sections -fdata-sections -fno-threadsafe-statics -fno-rtti -fno-exceptions -nostdlib "-Wa,-ahl=FileStore.s" -MMD -MP -MF"src/Storage/FileStore.d" -MT"src/Storage/FileStore.o" -o "src/Storage/FileStore.o" "../src/Storage/FileStore.cpp"
      In file included from C:\workdir\fHDX\Duet Refactor\CoreNG\asf/asf.h:36:0,
                       from C:\workdir\fHDX\Duet Refactor\CoreNG\cores\arduino/Core.h:44,
                       from C:\Users\joaos\git\RepRapFirmware\src/RepRapFirmware.h:30,
                       from ../src/Storage/FileStore.cpp:3:
      C:\workdir\fHDX\Duet Refactor\CoreNG\asf/sam/services/flash_efc/flash_efc.h:51:21: fatal error: efc/efc.h: No such file or directory
       #include "efc/efc.h"
                           ^
      compilation terminated.
      make: *** [src/Storage/FileStore.o] Error 1
      
      

      I have searched the forum for similar issues and found these:

      https://www.duet3d.com/forum/thread.php?id=2720#p25326
      https://www.duet3d.com/forum/thread.php?id=3378#p29756

      …however I still couldn't find the solution.

      Could anyone give me any pointers as to where eclipse could be going wrong? Really appreciate the help.

      J

      1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators
        last edited by

        It looks to me that your .cproject file isn't up to date with the source code. In a recent commit, most of the folders of the form "CoreNG\asf\sam\drivers\xxx" were removed from the RepRapFirmware project include path, and "CoreNG\asf\sam\drivers" was added.

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        1 Reply Last reply Reply Quote 0
        • jpsantosundefined
          jpsantos
          last edited by

          Hmm, you are correct, my .cproject does still have all the individual "CoreNG\asf\sam\drivers\xxx".
          I checked the current version on the master branch and it's identical, though.

          As an experiment, I dropped the dev version of .cproject and the error I initially pointed out disappeared but soon it started hitting weird errors so I stopped.

          It doesn't seem possible to edit the Cross G++ Compiler > All Options field. How do I change them btw?

          Also should I simply use dev instead of master? I assumed dev was less stable.
          I'm going to try dev branch tonight and see how far I get.

          1 Reply Last reply Reply Quote 0
          • dc42undefined
            dc42 administrators
            last edited by

            Yes you should use the dev branch of RepRapFirmware (it's the default branch), and the master branch of CoreNG.

            Duet WiFi hardware designer and firmware engineer
            Please do not ask me for Duet support via PM or email, use the forum
            http://www.escher3d.com, https://miscsolutions.wordpress.com

            1 Reply Last reply Reply Quote 0
            • jpsantosundefined
              jpsantos
              last edited by

              Had a go last night and managed to push it forward but still bombing out as so:

              [c]Building target: DuetEthernetFirmware.elf
              Invoking: Cross G++ Linker
              arm-none-eabi-gcc -L"C:\workdir\fHDX\Duet Refactor\CoreNG\SAM4E8E" -Os -Wl,–gc-sections -Wl,--fatal-warnings -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -TC:\workdir\fHDX\Duet Refactor\CoreNG\variants\duetNG\linker_scripts\gcc\flash.ld -Wl,-Map,C:\workdir\fHDX\Duet Refactor\RepRapFirmware\DuetEthernet/DuetEthernetFirmware.map -o "DuetEthernetFirmware.elf" -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "C:\workdir\fHDX\Duet Refactor\CoreNG\SAM4E8E\cores\arduino" ./src/Tools/Filament.o ./src/Tools/Tool.o ./src/Storage/CRC32.o ./src/Storage/FileStore.o ./src/Storage/MassStorage.o ./src/Movement/Kinematics/CartesianKinematics.o ./src/Movement/Kinematics/CoreBaseKinematics.o ./src/Movement/Kinematics/CoreXYKinematics.o ./src/Movement/Kinematics/CoreXYUKinematics.o ./src/Movement/Kinematics/CoreXZKinematics.o ./src/Movement/Kinematics/Kinematics.o ./src/Movement/Kinematics/LinearDeltaKinematics.o ./src/Movement/Kinematics/PolarKinematics.o ./src/Movement/Kinematics/ScaraKinematics.o ./src/Movement/Kinematics/ZLeadscrewKinematics.o ./src/Movement/BedProbing/Grid.o ./src/Movement/BedProbing/RandomProbePointSet.o ./src/Movement/DDA.o ./src/Movement/DriveMovement.o ./src/Movement/Move.o ./src/Libraries/sha1/sha1.o ./src/Libraries/Math/Isqrt.o ./src/Libraries/General/IP4String.o ./src/Libraries/General/StringRef.o ./src/Libraries/Fatfs/ccsbcs.o ./src/Libraries/Fatfs/diskio.o ./src/Libraries/Fatfs/fattime_rtc.o ./src/Libraries/Fatfs/ff.o ./src/Heating/Sensors/CpuTemperatureSensor.o ./src/Heating/Sensors/CurrentLoopTemperatureSensor.o ./src/Heating/Sensors/DhtSensor.o ./src/Heating/Sensors/RtdSensor31865.o ./src/Heating/Sensors/SpiTemperatureSensor.o ./src/Heating/Sensors/TemperatureSensor.o ./src/Heating/Sensors/Thermistor.o ./src/Heating/Sensors/ThermocoupleSensor31855.o ./src/Heating/Sensors/ThermocoupleSensor31856.o ./src/Heating/Sensors/TmcDriverTemperatureSensor.o ./src/Heating/FOPDT.o ./src/Heating/Heat.o ./src/Heating/Pid.o ./src/Heating/TemperatureError.o ./src/GCodes/GCodeBuffer.o ./src/GCodes/GCodeInput.o ./src/GCodes/GCodeMachineState.o ./src/GCodes/GCodeQueue.o ./src/GCodes/GCodes.o ./src/GCodes/GCodes2.o ./src/GCodes/RestorePoint.o ./src/FilamentSensors/Duet3DFilamentSensor.o ./src/FilamentSensors/FilamentSensor.o ./src/FilamentSensors/SimpleFilamentSensor.o ./src/DuetNG/DuetEthernet/Wiznet/Internet/DHCP/dhcp.o ./src/DuetNG/DuetEthernet/Wiznet/Ethernet/W5500/w5500.o ./src/DuetNG/DuetEthernet/Wiznet/Ethernet/WizSpi.o ./src/DuetNG/DuetEthernet/Wiznet/Ethernet/socketlib.o ./src/DuetNG/DuetEthernet/Wiznet/Ethernet/wizchip_conf.o ./src/DuetNG/DuetEthernet/Network.o ./src/DuetNG/DuetEthernet/Socket.o ./src/DuetNG/DueXn.o ./src/DuetNG/FirmwareUpdater.o ./src/DuetNG/FtpResponder.o ./src/DuetNG/HttpResponder.o ./src/DuetNG/NetworkBuffer.o ./src/DuetNG/NetworkResponder.o ./src/DuetNG/SX1509.o ./src/DuetNG/TMC2660.o ./src/DuetNG/TelnetResponder.o ./src/Fan.o ./src/IoPort.o ./src/Logger.o ./src/OutputMemory.o ./src/Platform.o ./src/PortControl.o ./src/PrintMonitor.o ./src/RepRap.o ./src/RepRapFirmware.o ./src/Roland.o ./src/Scanner.o ./src/SoftTimer.o ./src/ZProbeProgrammer.o -lCoreNG -Wl,--end-group -lm -gcc
              arm-none-eabi-gcc.exe: error: RefactorCoreNGvariantsduetNGlinker_scriptsgccflash.ld: No such file or directory
              arm-none-eabi-gcc.exe: error: RefactorRepRapFirmwareDuetEthernet/DuetEthernetFirmware.map: No such file or directory
              make: *** [DuetEthernetFirmware.elf] Error 1[/c]

              It seems it's getting confused with the '' in the cmd string and ignoring them. Might be a weird Eclipse windows issue. I'll try to manually fix this and report back.

              1 Reply Last reply Reply Quote 0
              • jpsantosundefined
                jpsantos
                last edited by

                Ok it works now.

                I swapped the problematic eclipse macros from my build/link cmds with hardcoded paths and this moved the compilation fwd.
                **[Note]**On windows, Eclipse uses '/' when it expands env paths instead of the '' which is used throughout the project config; eclipse misunderstands the paths when '/', '' are mixed in the same path and this was the root of all my compilation errors.

                I got to the last stage 'post-build' and it failed because the elf file it was expecting did not existed. Upon inspection, I noted the output file existed but without the .elf extension so I changed my post-build cmd to:

                [c]arm-none-eabi-objcopy -O binary C:/workdir/fHDX/Duet_Refactor/RepRapFirmware/DuetEthernet/DuetEthernetFirmware C:/workdir/fHDX/Duet_Refactor/RepRapFirmware/DuetEthernet/DuetEthernetFirmware.bin[/c]

                Is it worth creating some kind of separate eclipse quick-start helper instructions and post it together with the build instructions?

                1 Reply Last reply Reply Quote 0
                • dc42undefined
                  dc42 administrators
                  last edited by

                  From your earlier error message listing it looks like you were using a path with a space in it: "C:\workdir\fHDX\Duet Refactor". That won't work unless you use quotation marks around all the filenames that the path appears in.

                  Within Eclipse under Windows, I found that it generally doesn't matter whether you use / or \ as a path separator.

                  Duet WiFi hardware designer and firmware engineer
                  Please do not ask me for Duet support via PM or email, use the forum
                  http://www.escher3d.com, https://miscsolutions.wordpress.com

                  1 Reply Last reply Reply Quote 0
                  • jpsantosundefined
                    jpsantos
                    last edited by

                    Yes! Good catch, I removed the space indeed but forgot to mention it in my earlier post.

                    Ok, perhaps it's something else then but the compiler/linker is parsing the paths wrongly as is.
                    I will reset the project in a separate folder and note down all the errors I get, when I have some time.

                    I really appreciate the prompt help so far!

                    1 Reply Last reply Reply Quote 0
                    • dc42undefined
                      dc42 administrators
                      last edited by

                      Btw I just experienced the problem that some other users have reported, which is that the expression "${workspace_loc:/${CoreName}/SAM4E8E/cores/arduino/syscalls.o}" in the linker command line got expanded to "". Right-clicking on the project and selecting Refresh resolved it.

                      Duet WiFi hardware designer and firmware engineer
                      Please do not ask me for Duet support via PM or email, use the forum
                      http://www.escher3d.com, https://miscsolutions.wordpress.com

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      Unless otherwise noted, all forum content is licensed under CC-BY-SA