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

    Setting up Eclipse to Develop Firmware

    Scheduled Pinned Locked Moved
    Firmware developers
    4
    42
    5.8k
    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.
    • jmlundefined
      jml
      last edited by

      Hi dc42, maybe that is the case. Not sure. But I ended up fixing the CoreNG problem. But please tell me if I did something that I definitely should not have:

      Ok, I removed "${workspace_loc:/${ProjName}/variants/duet}" and replaced it with "${workspace_loc:/${ProjName}/variants/duetNG}"

      Then CoreNG would finally build without errors!

      The same errors would occur with building RepRapFirmware, so I did the same things and that got rid of the same errors. New errors:

      12:28:23 **** Build of configuration DuetWiFi for project RepRapFirmware ****
      make all
      Building file: ../src/Tools/Filament.cpp
      Invoking: Cross G++ Compiler
      arm-none-eabi-g++ -D__SAM4E8E__ -DCORE_NG -DDUET_NG -DDUET_WIFI -D_XOPEN_SOURCE -I"/Users/John/ecli …[redacted because very long]… ../src/Tools/Filament.cpp:12:0:
      /Users/John/eclipse-workspace/RepRapFirmware/src/Platform.h:54:20: fatal error: DueXn.h: No such file or directory

      include "DueXn.h"

      ^
      compilation terminated.
      make: *** [src/Tools/Filament.o] Error 1

      12:28:23 Build Finished (took 185ms)

      So I did this change in the RepRapFrimware Cross GCC/G++ Compiler Includes (-I) lists:
      "${workspace_loc:/${ProjName}/src/Duet}" changed to "${workspace_loc:/${ProjName}/src/DuetNG}"

      Then it got very far in the build process. Many warnings about implicit conversion from float to double in the CoreXY Kinematics part.

      Then got an error with Network.h not in path. So I added to the (-I) lists:
      …RepRapFirmware/src/DuetNG/DuetWiFi because I found Network.h there.

      Will keep using the same fix for each error that will come up. dc42, can you tell me if I am heading down the wrong path? Should I not use DuetNG files in the path?

      1 Reply Last reply Reply Quote 0
      • jmlundefined
        jml
        last edited by

        After doing what I said above, the latest error is in building the target ELF file:

        Building target: DuetWiFiFirmware.elf
        Invoking: Cross G++ Linker
        arm-none-eabi-gcc -L"/Users/John/eclipse-workspace/CoreNG/SAM4E8E" -Os -Wl,–gc-sections -Wl,--fatal-warnings -mcpu=cortex-m4 -mf ... [ … redacted because very long ... ] … mer.o -lCoreNG -Wl,--end-group -lm -gcc
        arm-none-eabi-gcc: error: : No such file or directory
        make: *** [DuetWiFiFirmware.elf] Error 1

        1 Reply Last reply Reply Quote 0
        • jmlundefined
          jml
          last edited by

          The full error is here:

          Building target: DuetWiFiFirmware.elf
          Invoking: Cross G++ Linker
          arm-none-eabi-gcc -L"/Users/john/eclipse-workspace/CoreNG/SAM4E8E" -Os -Wl,–gc-sections -Wl,--fatal-warnings -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -T/Users/john/eclipse-workspace/CoreNG/variants/duetNG/linker_scripts/gcc/flash.ld -Wl,-Map,/Users/john/eclipse-workspace/RepRapFirmware/DuetWiFi/DuetWiFiFirmware.map -o "DuetWiFiFirmware.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 "" ./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/DuetWiFi/Network.o ./src/DuetNG/DuetWiFi/Socket.o ./src/DuetNG/DuetWiFi/WifiFirmwareUploader.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: error: : No such file or directory make: *** [DuetWiFiFirmware.elf] Error 1

          I am not sure what file or directory it thinks is missing.

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

            Evidently your Path in the C/C++ Build -> Settings -> Cross Settings still doesn't match the actual path to gcc on your computer. On my computer that path is set to:

            C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update

            and folder "C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update\bin" contains file arm-none-eabi-gcc.exe.

            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
            • jmlundefined
              jml
              last edited by

              I checked the Path by right clicking RepRapFirmware, clicking properties, and going to C/C++ Build -> Settings -> Cross Settings

              It was set to: /Users/John/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin

              The instructions say it should be this:
              /Users/<your user="" name="">/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin

              So looks correct.

              When I go to that actual path, I see many arm-none-eabi- files and included in them are these:
              arm-none-eabi-gcc
              arm-none-eabi-g++
              arm-none-eabi-gcc-4.8.3
              and many more.

              There is no file extension. Mac says they are Unix Executables.

              What on Earth is going on?</your>

              1 Reply Last reply Reply Quote 0
              • jmlundefined
                jml
                last edited by

                In C/C++ Build > Settings, if I put the wrong path intentionally, this error comes immediately:
                make all
                /bin/sh: arm-none-eabi-g++: command not found

                When I have the correct path, it successfully built cpp files, then the error comes after 19 seconds when it wants to "Build target: DuetWiFiFirmware.elf"

                Just wish it would work!

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

                  The only difference I can see is that I left out the final "\bin" in the path I configured. Maybe Eclipse adds that itself?

                  I have another set of gcc files on my general PATH, and I've noticed that if I use the wrong path in Cross Settings, it picks up the compiler from those files (which is the wrong version compiler, so it doesn't work). Maybe in the linker step it is picking up gcc from that path too?

                  You could try putting the full path in the Command box in the Cross G++ Linker options, instead of just "gcc".

                  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
                  • jmlundefined
                    jml
                    last edited by

                    For the "arm-none-eabi-gcc: error: : No such file or directory" error, is it not finding arm-none-eabi-gcc?

                    Or is it not finding a file that is in the giant list of ".o" files?

                    Is "/Users/John/eclipse-workspace/RepRapFirmware/DuetWiFi/DuetWiFiFirmware.map" supposed to be an actual file, because I couldn't find it anywhere?

                    1 Reply Last reply Reply Quote 0
                    • jmlundefined
                      jml
                      last edited by

                      Ok, I will try what you said above.

                      1 Reply Last reply Reply Quote 0
                      • jmlundefined
                        jml
                        last edited by

                        Leaving out the "/bin" part resulted in no changes in the error.

                        For your other suggestion (putting full path instead of just gcc), I replaced gcc with arm-none-eabi-gcc (in the command box of the "Cross G++ Linker"). I got this error:

                        Building target: DuetWiFiFirmware.elf
                        Invoking: Cross G++ Linker
                        arm-none-eabi-arm-none-eabi-gcc -L"/Users/John/eclipse-worksp … [ … ] … robeProgrammer.o -lCoreNG -Wl,--end-group -lm -gcc
                        /bin/sh: arm-none-eabi-arm-none-eabi-gcc: command not found make: *** [DuetWiFiFirmware.elf] Error 127

                        So it didn't work, so I'll change it back to just gcc.

                        1 Reply Last reply Reply Quote 0
                        • jmlundefined
                          jml
                          last edited by

                          For reference, when changing it back to just gcc, I get the same error as before. Although from the above error, it looks like it was looking in /bin/sh. So maybe I should put the gcc file in a folder called sh?

                          Building target: DuetWiFiFirmware.elf
                          Invoking: Cross G++ Linker
                          arm-none-eabi-gcc -L"/Users/John/eclipse-w … [ … ] … rc/ZProbeProgrammer.o -lCoreNG -Wl,--end-group -lm -gcc
                          arm-none-eabi-gcc: error: : No such file or directory
                          make: *** [DuetWiFiFirmware.elf] Error 1

                          Interesting how the prior error was "command not found", but then this error is "No such file or directory."

                          1 Reply Last reply Reply Quote 0
                          • jmlundefined
                            jml
                            last edited by

                            Notice the lone colon in the error?

                            arm-none-eabi-gcc: error: : No such file or directory

                            Maybe it was looking for a file or directory that had no name? Or had a space in the name or something?

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

                              @jml:

                              Notice the lone colon in the error?

                              arm-none-eabi-gcc: error: : No such file or directory

                              Maybe it was looking for a file or directory that had no name? Or had a space in the name or something?

                              Good catch! There is a "" after the -Wl,–start-group in your linker command line. When I'm in the office I'll see what should be there.

                              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
                              • fmaundefined
                                fma
                                last edited by

                                @jml:

                                Interesting how the prior error was "command not found", but then this error is "No such file or directory."

                                This is a common mistake, due to poor error messages: in the first case, this is sh which can't find gcc, in the second case, this is gcc which can't find a file. sh reports which file it can't find (gcc, here), but gcc does not report the missing file…

                                I suspect a library path not setup correctly, so gcc can't find a .o to build something else.

                                Frédéric

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

                                  Here is the link command I get:

                                  arm-none-eabi-gcc -L"C:\Eclipse\Firmware\CoreNG\SAM4E8E" -Os -Wl,–gc-sections -Wl,--fatal-warnings -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -TC:\Eclipse\Firmware\CoreNG\variants\duetNG\linker_scripts\gcc\flash.ld -Wl,-Map,C:\Eclipse\Firmware\RepRapFirmware\DuetWiFi/DuetWiFiFirmware.map -o "DuetWiFiFirmware.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:\Eclipse\Firmware\CoreNG\SAM4E8E\cores\arduino\syscalls.o" ./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/DuetWiFi/Network.o ./src/DuetNG/DuetWiFi/Socket.o ./src/DuetNG/DuetWiFi/WifiFirmwareUploader.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

                                  So the file it's missing on your machine is, on my machine, "C:\Eclipse\Firmware\CoreNG\SAM4E8E\cores\arduino\syscalls.o". That should come from this "Command line pattern" setting in the Cross G++ Linker settings:

                                  ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${LINK_FLAGS_1} "${workspace_loc:/${CoreName}/SAM4E8E/cores/arduino/syscalls.o}" ${INPUTS} ${LINK_FLAGS_2}

                                  I've noticed before that if Eclipse can't find a file, it just omits it from the command line. If you built the SAM4E configuration of CoreNG before you built RRF, that file should be there.

                                  HTH David

                                  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
                                  • jmlundefined
                                    jml
                                    last edited by

                                    Ok we are getting closer to a solution.

                                    I found the missing file here:
                                    /Users/John/eclipse-workspace/CoreNG/SAM4E8E/cores/arduino/syscalls.o
                                    [it appears there with a bunch of other files after building CoreNG]

                                    In the RRF Cross G++ Linker "Command line pattern" box, I see this written:
                                    ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${LINK_FLAGS_1} "${workspace_loc:/${CoreName}/SAM4E8E/cores/arduino/syscalls.o}" ${INPUTS} ${LINK_FLAGS_2}

                                    Its the same as yours, so seems like its not a problem.

                                    Maybe the problem is with how I build CoreNG and RRF:

                                    • First I right click CoreNG, Build Configurations > Clean All.
                                    • Repeat for RepRapFirmware folder
                                    • Right click CoreNG, Build Configurations > Build Selected… then I select SAM4E8E and hit ok.
                                    • Wait for build to finish (8 seconds)
                                    • Repeat for RepRapFirmware folder, but select DuetWiFi and hit ok.
                                    • Error

                                    Should I build it differently?

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

                                      That's the correct build order.

                                      In Properties -> C/C++ Build -> Build Variables, do you have CoreName defined as 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
                                      • jmlundefined
                                        jml
                                        last edited by

                                        For the RepRapFirmware folder, yes it is there. Name: CoreName || Type: String || Value: CoreNG

                                        For the CoreNG folder, nothing is listed in the list. Should it be there?

                                        1 Reply Last reply Reply Quote 0
                                        • jmlundefined
                                          jml
                                          last edited by

                                          I really just need to make some small firmware changes and some custom g-code commands.

                                          I purchased the DuetWifi, PanelDue, and am waiting for the Duex5. Hoping to have it solved by the time it arrives! If I can't get it to work on Mac or Windows, I may just uninstall everything and try again when firmware version 1.2 is out.

                                          Thanks for all the help you've provided so far!

                                          1 Reply Last reply Reply Quote 0
                                          • fmaundefined
                                            fma
                                            last edited by

                                            I had no problem installing/compiling under linux. You may try to install a linux system in a Virtualbox env, and compile from there.

                                            Frédéric

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