Support with building new firmware for Duet Wifi



  • Hi,
    I was following the latest BuildInsturctions (https://github.com/dc42/RepRapFirmware/blob/dev/BuildInstructions.md) to build a new firmware to support linear IR temperature sensor using SPI.
    I am getting the following errors while building RepRapFirmware:

    In file included from ../src/Tools/Tool.h:29,
    from ../src/Tools/Filament.cpp:8:
    C:\eclipse\Firmware\RepRapFirmware\src/RepRapFirmware.h:40:10: fatal error: General/SafeStrtod.h: No such file or directory
    #include "General/SafeStrtod.h"
    ^~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    In file included from ../src/Tools/Tool.h:29,
    from ../src/Tools/Tool.cpp:26:
    C:\eclipse\Firmware\RepRapFirmware\src/RepRapFirmware.h:40:10: fatal error: General/SafeStrtod.h: No such file or directory
    #include "General/SafeStrtod.h"
    ^~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    Building file: ../src/Networking/W5500Ethernet/Wiznet/Ethernet/W5500/w5500.cpp
    src/Tools/subdir.mk:21: recipe for target 'src/Tools/Filament.o' failed
    make: *** [src/Tools/Filament.o] Error 1
    make: *** Waiting for unfinished jobs....
    Invoking: Cross G++ Compiler
    src/Tools/subdir.mk:21: recipe for target 'src/Tools/Tool.o' failed
    make: *** [src/Tools/Tool.o] Error 1
    arm-none-eabi-g++ -std=gnu++17 -D__SAM4E8E__ -DRTOS -DDUET_NG -D_XOPEN_SOURCE -I"C:\eclipse\Firmware\CoreNG\cores\arduino" -I"C:\eclipse\Firmware\CoreNG\libraries\Flash" -I"C:\eclipse\Firmware\CoreNG\libraries\SharedSpi" -I"C:\eclipse\Firmware\CoreNG\libraries\Storage" -I"C:\eclipse\Firmware\CoreNG\libraries\Wire" -I"C:\eclipse\Firmware\CoreNG\asf" -I"C:\eclipse\Firmware\CoreNG\asf\common\utils" -I"C:\eclipse\Firmware\CoreNG\asf\common\services\clock" -I"C:\eclipse\Firmware\CoreNG\asf\common\services\ioport" -I"C:\eclipse\Firmware\CoreNG\asf\sam\drivers" -I"C:\eclipse\Firmware\CoreNG\asf\sam\services\flash_efc" -I"C:\eclipse\Firmware\CoreNG\asf\sam\utils" -I"C:\eclipse\Firmware\CoreNG\asf\sam\utils\cmsis\sam4e\include" -I"C:\eclipse\Firmware\CoreNG\asf\sam\utils\header_files" -I"C:\eclipse\Firmware\CoreNG\asf\sam\utils\preprocessor" -I"C:\eclipse\Firmware\CoreNG\asf\thirdparty\CMSIS\Include" -I"C:\eclipse\Firmware\CoreNG\variants\duetNG" -I"C:\eclipse\Firmware\RepRapFirmware\src" -I"C:\eclipse\Firmware\RepRapFirmware\src\DuetNG" -I"C:\eclipse\Firmware\RepRapFirmware\src\Networking" -O2 -Wall -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -fno-threadsafe-statics -fno-rtti -fno-exceptions -nostdlib -Wdouble-promotion -fsingle-precision-constant "-Wa,-ahl=w5500.s" -MMD -MP -MF"src/Networking/W5500Ethernet/Wiznet/Ethernet/W5500/w5500.d" -MT"src/Networking/W5500Ethernet/Wiznet/Ethernet/W5500/w5500.o" -o "src/Networking/W5500Ethernet/Wiznet/Ethernet/W5500/w5500.o" "../src/Networking/W5500Ethernet/Wiznet/Ethernet/W5500/w5500.cpp"
    In file included from C:\eclipse\Firmware\RepRapFirmware\src/Networking/W5500Ethernet/Wiznet/Ethernet/wizchip_conf.h:102,
    from C:\eclipse\Firmware\RepRapFirmware\src/Networking/W5500Ethernet/Wiznet/Ethernet/socketlib.h:88,
    from ../src/Networking/W5500Ethernet/Wiznet/Internet/DHCP/dhcp.cpp:52:
    C:\eclipse\Firmware\RepRapFirmware\src/Networking/W5500Ethernet/Wiznet/Ethernet/W5500/w5500.h:55:10: fatal error: General/IPAddress.h: No such file or directory
    #include <General/IPAddress.h>
    ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    In file included from ../src/Storage/FileInfoParser.h:11,
    from ../src/Storage/FileInfoParser.cpp:8:
    C:\eclipse\Firmware\RepRapFirmware\src/RepRapFirmware.h:40:10: fatal error: General/SafeStrtod.h: No such file or directory
    #include "General/SafeStrtod.h"
    ^~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    In file included from ../src/Storage/FileStore.cpp:3:
    C:\eclipse\Firmware\RepRapFirmware\src/RepRapFirmware.h:40:10: fatal error: General/SafeStrtod.h: No such file or directory
    #include "General/SafeStrtod.h"
    ^~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    src/Networking/W5500Ethernet/Wiznet/Internet/DHCP/subdir.mk:18: recipe for target 'src/Networking/W5500Ethernet/Wiznet/Internet/DHCP/dhcp.o' failed
    make: *** [src/Networking/W5500Ethernet/Wiznet/Internet/DHCP/dhcp.o] Error 1
    In file included from ../src/Storage/MassStorage.h:4,
    from ../src/Storage/MassStorage.cpp:1:
    C:\eclipse\Firmware\RepRapFirmware\src/RepRapFirmware.h:40:10: fatal error: General/SafeStrtod.h: No such file or directory
    #include "General/SafeStrtod.h"
    ^~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    src/Storage/subdir.mk:27: recipe for target 'src/Storage/FileInfoParser.o' failed
    make: *** [src/Storage/FileInfoParser.o] Error 1
    src/Storage/subdir.mk:27: recipe for target 'src/Storage/FileStore.o' failed
    make: *** [src/Storage/FileStore.o] Error 1
    src/Storage/subdir.mk:27: recipe for target 'src/Storage/MassStorage.o' failed
    make: *** [src/Storage/MassStorage.o] Error 1
    In file included from ../src/ObjectModel/ObjectModel.h:11,
    from ../src/ObjectModel/ObjectModel.cpp:8:
    C:\eclipse\Firmware\RepRapFirmware\src/RepRapFirmware.h:40:10: fatal error: General/SafeStrtod.h: No such file or directory
    #include "General/SafeStrtod.h"
    ^~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    src/ObjectModel/subdir.mk:18: recipe for target 'src/ObjectModel/ObjectModel.o' failed
    make: *** [src/ObjectModel/ObjectModel.o] Error 1
    In file included from ../src/Networking/W5500Ethernet/Wiznet/Ethernet/W5500/w5500.cpp:55:
    C:\eclipse\Firmware\RepRapFirmware\src/Networking/W5500Ethernet/Wiznet/Ethernet/W5500/w5500.h:55:10: fatal error: General/IPAddress.h: No such file or directory
    #include <General/IPAddress.h>
    ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    src/Networking/W5500Ethernet/Wiznet/Ethernet/W5500/subdir.mk:18: recipe for target 'src/Networking/W5500Ethernet/Wiznet/Ethernet/W5500/w5500.o' failed
    make: *** [src/Networking/W5500Ethernet/Wiznet/Ethernet/W5500/w5500.o] Error 1
    "make -j8 all" terminated with exit code 2. Build might be incomplete.

    I built CoreNG and FreeRTOS before building this. it seems that some fles are missing. PS I used the branches that were mentioned in BuildInstructions.


  • administrators

    It looks like project RRFLibraries is missing from your workspace.



  • Im getting these errors as i try to build RRFLibraries-dev. downloaded from dev branch

    16:21:07 **** Incremental Build of configuration SAM4E_RTOS for project RRFLibraries-dev ****
    make all
    Building file: ../src/RTOSIface/RTOSIface.cpp
    Invoking: Cross G++ Compiler
    arm-none-eabi-g++ -std=gnu++17 -D__SAM4E8E__ -DRTOS -O3 -Wall -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -fno-threadsafe-statics -fno-rtti -fno-exceptions -nostdlib -Wdouble-promotion -fsingle-precision-constant "-Wa,-ahl=RTOSIface.s" -MMD -MP -MF"src/RTOSIface/RTOSIface.d" -MT"src/RTOSIface/RTOSIface.o" -o "src/RTOSIface/RTOSIface.o" "../src/RTOSIface/RTOSIface.cpp"
    In file included from ../src/RTOSIface/RTOSIface.cpp:8:
    ../src/RTOSIface/RTOSIface.h:19:11: fatal error: FreeRTOS.h: No such file or directory

    include "FreeRTOS.h"

           ^~~~~~~~~~~~
    

    compilation terminated.
    src/RTOSIface/subdir.mk:18: recipe for target 'src/RTOSIface/RTOSIface.o' failed
    make: *** [src/RTOSIface/RTOSIface.o] Error 1
    "make all" terminated with exit code 2. Build might be incomplete.

    16:21:08 Build Failed. 3 errors, 0 warnings. (took 266ms)


  • administrators

    It sounds to me that you don't have all the projects you downloaded in the same Eclipse workspace.



  • I have the following files in the workspace:
    RepRapFirmware: dev- Duet2_RTOS build config
    CoreNG: dev- SAM3X8E build config
    FreeRTOS: main - SAM4E build config
    RRFLibraries: dev- SAM4E_RTOS build config
    DuetWiFiSocketServer: dev -Release build config

    i was only able to successfully build CoreNG and FreeRTOS, other three fail to build.


  • administrators

    Remove the -dev suffix from the project names in your Eclipse workspace.



  • Changed the manes of all projects, and I was able to build CoreNG, FreeRTOS and RRFLibraries. While building DuetWifiSocketServer ( release config) i am getting the following errors. The Readme file in your repo suggests adding XtensaGccPath. how do i find this on my system or do i have to download and add this seperately?

    13:34:23 **** Incremental Build of configuration Release for project DuetWiFiSocketServer ****
    make -j8 all
    Building file: ../src/Connection.cpp
    Building file: ../src/HSPI.cpp
    Building file: ../src/Listener.cpp
    Invoking: Cross G++ Compiler
    xtensa-lx106-elf-g++ -std=gnu++11 -D__ets__ -DICACHE_FLASH -DF_CPU=80000000L -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12 -DARDUINO=10606 -DLWIP_OPEN_SRC -Os -Wall -c -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -ffunction-sections -fdata-sections "-Wa,-ahl=Connection.s" -MMD -MP -MF"src/Connection.d" -MT"src/Connection.o" -o "src/Connection.o" "../src/Connection.cpp"
    Invoking: Cross G++ Compiler
    Invoking: Cross G++ Compiler
    xtensa-lx106-elf-g++ -std=gnu++11 -D__ets__ -DICACHE_FLASH -DF_CPU=80000000L -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12 -DARDUINO=10606 -DLWIP_OPEN_SRC -Os -Wall -c -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -ffunction-sections -fdata-sections "-Wa,-ahl=HSPI.s" -MMD -MP -MF"src/HSPI.d" -MT"src/HSPI.o" -o "src/HSPI.o" "../src/HSPI.cpp"
    xtensa-lx106-elf-g++ -std=gnu++11 -D__ets__ -DICACHE_FLASH -DF_CPU=80000000L -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12 -DARDUINO=10606 -DLWIP_OPEN_SRC -Os -Wall -c -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -ffunction-sections -fdata-sections "-Wa,-ahl=Listener.s" -MMD -MP -MF"src/Listener.d" -MT"src/Listener.o" -o "src/Listener.o" "../src/Listener.cpp"
    c:/program files/gnu arm eclipse/build tools/2.6-201507152002/bin/sh: xtensa-lx106-elf-g++: not found
    c:/program files/gnu arm eclipse/build tools/2.6-201507152002/bin/sh: xtensa-lx106-elf-g++: not found
    src/subdir.mk:30: recipe for target 'src/Connection.o' failed
    make: *** [src/Connection.o] Error 127
    src/subdir.mk:30: recipe for target 'src/HSPI.o' failed
    Building file: ../src/Misc.cpp
    make: *** Waiting for unfinished jobs....
    make: *** [src/HSPI.o] Error 127
    c:/program files/gnu arm eclipse/build tools/2.6-201507152002/bin/sh: xtensa-lx106-elf-g++: not found
    src/subdir.mk:30: recipe for target 'src/Listener.o' failed
    make: *** [src/Listener.o] Error 127
    Invoking: Cross G++ Compiler
    xtensa-lx106-elf-g++ -std=gnu++11 -D__ets__ -DICACHE_FLASH -DF_CPU=80000000L -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12 -DARDUINO=10606 -DLWIP_OPEN_SRC -Os -Wall -c -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -ffunction-sections -fdata-sections "-Wa,-ahl=Misc.s" -MMD -MP -MF"src/Misc.d" -MT"src/Misc.o" -o "src/Misc.o" "../src/Misc.cpp"
    c:/program files/gnu arm eclipse/build tools/2.6-201507152002/bin/sh: xtensa-lx106-elf-g++: not found
    src/subdir.mk:30: recipe for target 'src/Misc.o' failed
    make: *** [src/Misc.o] Error 127
    "make -j8 all" terminated with exit code 2. Build might be incomplete.

    13:34:23 Build Failed. 9 errors, 0 warnings. (took 285ms)


  • administrators

    Probably the easiest way to install xtensa-gcc is to install a recent version of Arduino, then in Boards Manager install the ESP8266 add-on.



  • what path do i set for esp8266? i cannot locate the esp8266 folder in ...\arduino\hardware
    I also downloaded esp8266 toolchain from http://gnutoolchains.com/esp8266/ which has xtensa-gcc because I coudnt locate the arduino path.
    Im still getting the same errors as before for DuetWiFiSocketServer



  • do i decided not to build the duetwifisocketserver project, but directly build reprapfirmware. i ended up avoiding most of the errors i was getting but now im stuck at this:

    Finished building: ../src/ZProbeProgrammer.cpp

    Finished building: ../src/RepRap.cpp

    Finished building: ../src/Platform.cpp

    Building target: Duet2CombinedFirmware.elf
    Invoking: Cross G++ Linker
    arm-none-eabi-gcc -L"C:\eclipse\Firmware\FreeRTOS\SAM4E" -L"C:\eclipse\Firmware\RRFLibraries\SAM4E_RTOS" -Os --specs=nano.specs -Wl,--gc-sections -Wl,--fatal-warnings -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -T"C:\eclipse\Firmware\CoreNG\variants\duetNG\linker_scripts\gcc\flash.ld" -Wl,-Map,"C:\eclipse\Firmware\RepRapFirmware\Duet2_RTOS/Duet2CombinedFirmware.map" -o "Duet2CombinedFirmware.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_RTOS/cores/arduino/syscalls.o" ./src/Tools/Filament.o ./src/Tools/Tool.o ./src/Storage/CRC32.o ./src/Storage/FileInfoParser.o ./src/Storage/FileStore.o ./src/Storage/MassStorage.o ./src/ObjectModel/ObjectModel.o ./src/Networking/W5500Ethernet/Wiznet/Internet/DHCP/dhcp.o ./src/Networking/W5500Ethernet/Wiznet/Ethernet/W5500/w5500.o ./src/Networking/W5500Ethernet/Wiznet/Ethernet/WizSpi.o ./src/Networking/W5500Ethernet/Wiznet/Ethernet/socketlib.o ./src/Networking/W5500Ethernet/Wiznet/Ethernet/wizchip_conf.o ./src/Networking/W5500Ethernet/W5500Interface.o ./src/Networking/W5500Ethernet/W5500Socket.o ./src/Networking/ESP8266WiFi/WiFiInterface.o ./src/Networking/ESP8266WiFi/WiFiSocket.o ./src/Networking/ESP8266WiFi/WifiFirmwareUploader.o ./src/Networking/FirmwareUpdater.o ./src/Networking/FtpResponder.o ./src/Networking/HttpResponder.o ./src/Networking/Network.o ./src/Networking/NetworkBuffer.o ./src/Networking/NetworkResponder.o ./src/Networking/TelnetResponder.o ./src/Networking/UploadingNetworkResponder.o ./src/Movement/StepperDrivers/DriverMode.o ./src/Movement/StepperDrivers/TMC22xx.o ./src/Movement/StepperDrivers/TMC2660.o ./src/Movement/StepperDrivers/TMC51xx.o ./src/Movement/Kinematics/CoreKinematics.o ./src/Movement/Kinematics/HangprinterKinematics.o ./src/Movement/Kinematics/Kinematics.o ./src/Movement/Kinematics/LinearDeltaKinematics.o ./src/Movement/Kinematics/PolarKinematics.o ./src/Movement/Kinematics/RotaryDeltaKinematics.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/DDARing.o ./src/Movement/DriveMovement.o ./src/Movement/Move.o ./src/Movement/StepTimer.o ./src/Libraries/sha1/sha1.o ./src/Libraries/Fatfs/diskio.o ./src/Libraries/Fatfs/fattime_rtc.o ./src/Libraries/Fatfs/ff.o ./src/Libraries/Fatfs/ffunicode.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/HeaterProtection.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/GCodes3.o ./src/GCodes/RestorePoint.o ./src/FilamentMonitors/Duet3DFilamentMonitor.o ./src/FilamentMonitors/FilamentMonitor.o ./src/FilamentMonitors/LaserFilamentMonitor.o ./src/FilamentMonitors/PulsedFilamentMonitor.o ./src/FilamentMonitors/RotatingMagnetFilamentMonitor.o ./src/FilamentMonitors/SimpleFilamentMonitor.o ./src/Fans/DotStarLed.o ./src/Fans/Fan.o ./src/Fans/Tacho.o ./src/DuetNG/DueXn.o ./src/DuetNG/SX1509.o ./src/Display/ST7920/glcd11x14.o ./src/Display/ST7920/glcd7x11.o ./src/Display/ST7920/lcd7920.o ./src/Display/Display.o ./src/Display/Menu.o ./src/Display/MenuItem.o ./src/Display/RotaryEncoder.o ./src/CAN/CanInterface.o ./src/CAN/CanMessageBuffer.o ./src/CAN/CanSender.o ./src/DmacManager.o ./src/IoPorts.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/Spindle.o ./src/Tasks.o ./src/ZProbe.o ./src/ZProbeProgrammer.o -lCoreNG -lFreeRTOS -lRRFLibraries -Wl,--end-group -lm
    arm-none-eabi-gcc: error: C:\eclipse\Firmware/CoreNG/SAM4E8E_RTOS/cores/arduino/syscalls.o: No such file or directory
    makefile:69: recipe for target 'Duet2CombinedFirmware.elf' failed
    make: *** [Duet2CombinedFirmware.elf] Error 1
    "make -j8 all" terminated with exit code 2. Build might be incomplete.

    13:09:44 Build Failed. 2 errors, 0 warnings. (took 13s.779ms)

    I checked the path for syscalls.o and the file exists in the directory.


  • administrators

    Are you sure you built the SAM4E_RTOS configuration of CoreNG?



  • Thanks for all the help! finally got a build running.
    im writing a code to add a linear voltage pyrometer. i have written the code but now im getting the following error:

    Return without value, in function returning non-void GCodeBuffer.cpp /RepRapFirmware/src/GCodes line 501 Code Analysis Problem


  • administrators

    That error is caused by Eclipse getting confused by 3 functions that are mistakenly declared with return type "const void" instead of just "void". The files compile correctly. You can avoid the error messages by changing the 3 instances of "const void" in each of GCodeBuffer.h and GCodeBuffer.cpp to just "void". That change will be included in my next commit.



  • Thanks for that correction. All projects build.



  • hey @dc42, I was able to use the custom firmware. I want to change the name( instead of 2.03beta3 (2019-03-25b6)) to something that i wont mix up with the original version. any suggestions on how i should do that?


  • administrators

    The version text is defined in file Version.h.



  • Thanks a lot.


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.