getting set up to hack firmware



  • Hello, we have the Duet Wifi and DueX5 and plan to use it to control a large custom 3d printer.
    We plan to control 6 motors off of the Duet3d as well as an additional 5 from the DueX5.
    We also plan to use the extra 2 stepper channels found on the CONN_LCD..
    But we would still like to use 1 or 2 more.. 🙂

    so we are interested in hacking the firmware to add 1 or 2 more independent stepper channels.
    I have seen that this has been accomplished by @kazolar in the forums.

    so far I have been able to build the RepRapFirmware 2.02 from source in eclipse on a pc using the master branches of the following:

    CoreNG, FreeRTOS, RRFLibraries and RepRapFirmware
    I also have DuetWifiSocketServer, CoreESP8266 and LwipESP8266 projects loaded in eclipse

    I can get this set to compile without error.

    now to proceed towards repurposing pins and adding additional channels of motor control. From reading through posts in the forum.. I believe I need to use v2-dev branches of CoreNG and RepRapFirmware..

    so far I have tried v2-dev branches of CoreNG and RepRapFirmware
    compilation yields hundreds of errors like this one

    '__are_same' was not declared in this scope RepRapFirmware
    line 383, external location: c:\program files (x86)\gnu tools arm embedded\7 2018-q2-update\arm-none-eabi\include\c++\7.3.1\bits\stl_algobase.h C/C++ Problem

    all of the visible errors concern the same file stl_algobase.h
    am I working with the right branches? if so.. How do I fix this?

    from @kazolar 's posts I was planing on modifying the Pins_DuetNG.h file for starters.. however the DuetNG folder containing it is crossed out in the RepRapFirmware src folder..

    any help would be appreciated.

    thanks!


  • administrators

    • Current development is on the dev branch of RepRapFirmware, not the v2-dev branch any more
    • Use the master branch of CoreNG for now, although I will switch to the dev branch when I have updated it
    • I have just switched to using the 2018-q4-major release of Gnu Tools ARM Embedded.
    • If the DuetNG folder is crossed out, you probably have the wrong project configuration selected. Build the Duet2_RTOS configuration of RepRapFirmware and the SAM4E8E_RTOS configurations of everything else.


  • thank you for clarifying the branches and configurations..
    So I believe I have all of the correct branches and configurations set in my project..
    I also installed the new release of Gnu Tools ARM Embedded..
    however, when I attempt to compile RepRapFirmware I get errors while building the file: ../src/Movement/Kinematics/HangprinterKinematics.cpp

    here are some of the first error messages..

    'class FixedMatrix<float, 9, 9>' has no member named 'Fill' CoreKinematics.cpp /RepRapFirmware/src/Movement/Kinematics line 50 C/C++ Problem

    'class FixedMatrix<float, 9, 9>' has no member named 'Fill' CoreKinematics.cpp /RepRapFirmware/src/Movement/Kinematics line 129 C/C++ Problem

    could not convert 'normalMatrix.FixedMatrix<double, 9, 10>::GaussJordan(((double*)numFactors), (numFactors + 1))' from 'void' to 'bool' HangprinterKinematics.cpp /RepRapFirmware/src/Movement/Kinematics line 426 C/C++ Problem

    I have attached the console output below..

    Building file: ../src/Movement/Kinematics/HangprinterKinematics.cpp
    Invoking: Cross G++ Compiler
    arm-none-eabi-g++ -D__SAM4E8E__ -DRTOS -DDUET_NG -D_XOPEN_SOURCE -I"C:\Eclipse\Firmware-dev\CoreNG\cores\arduino" -I"C:\Eclipse\Firmware-dev\CoreNG\libraries\Flash" -I"C:\Eclipse\Firmware-dev\CoreNG\libraries\SharedSpi" -I"C:\Eclipse\Firmware-dev\CoreNG\libraries\Storage" -I"C:\Eclipse\Firmware-dev\CoreNG\libraries\Wire" -I"C:\Eclipse\Firmware-dev\CoreNG\asf" -I"C:\Eclipse\Firmware-dev\CoreNG\asf\common\utils" -I"C:\Eclipse\Firmware-dev\CoreNG\asf\common\services\clock" -I"C:\Eclipse\Firmware-dev\CoreNG\asf\common\services\ioport" -I"C:\Eclipse\Firmware-dev\CoreNG\asf\sam\drivers" -I"C:\Eclipse\Firmware-dev\CoreNG\asf\sam\services\flash_efc" -I"C:\Eclipse\Firmware-dev\CoreNG\asf\sam\utils" -I"C:\Eclipse\Firmware-dev\CoreNG\asf\sam\utils\cmsis\sam4e\include" -I"C:\Eclipse\Firmware-dev\CoreNG\asf\sam\utils\header_files" -I"C:\Eclipse\Firmware-dev\CoreNG\asf\sam\utils\preprocessor" -I"C:\Eclipse\Firmware-dev\CoreNG\asf\thirdparty\CMSIS\Include" -I"C:\Eclipse\Firmware-dev\CoreNG\variants\duetNG" -I"C:\Eclipse\Firmware-dev\RepRapFirmware\src" -I"C:\Eclipse\Firmware-dev\RepRapFirmware\src\DuetNG" -I"C:\Eclipse\Firmware-dev\RepRapFirmware\src\Networking" -I"C:\Eclipse\Firmware-dev\DuetWiFiSocketServer\src\include" -I"C:\Eclipse\Firmware-dev\FreeRTOS\src\include" -I"C:\Eclipse\Firmware-dev\FreeRTOS\src\portable\GCC\ARM_CM4F" -I"C:\Eclipse\Firmware-dev\RRFLibraries\src" -O2 -Wall -c -std=gnu++17 -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=HangprinterKinematics.s" -MMD -MP -MF"src/Movement/Kinematics/HangprinterKinematics.d" -MT"src/Movement/Kinematics/HangprinterKinematics.o" -o "src/Movement/Kinematics/HangprinterKinematics.o" "../src/Movement/Kinematics/HangprinterKinematics.cpp"
    ../src/Movement/Kinematics/CoreKinematics.cpp: In member function 'void CoreKinematics::Recalc()':
    ../src/Movement/Kinematics/CoreKinematics.cpp:36:42: error: invalid conversion from 'size_t' {aka 'unsigned int'} to 'float*' [-fpermissive]
    const bool ok = tempMatrix.GaussJordan(MaxAxes, 2 * MaxAxes);
    ^~~~~~~
    In file included from ../src/Movement/Kinematics/Kinematics.h:12,
    from ../src/Movement/Kinematics/ZLeadscrewKinematics.h:11,
    from ../src/Movement/Kinematics/CoreKinematics.h:11,
    from ../src/Movement/Kinematics/CoreKinematics.cpp:8:
    C:\Eclipse\Firmware-dev\RRFLibraries\src/Math/Matrix.h:87:93: note: initializing argument 1 of 'void FixedMatrix<T, ROWS, COLS>::GaussJordan(T*, size_t) [with T = float; unsigned int ROWS = 9; unsigned int COLS = 18; size_t = unsigned int]'
    template<class T, size_t ROWS, size_t COLS> void FixedMatrix<T, ROWS, COLS>::GaussJordan(T solution, size_t numRows)
    ~^~~~~~
    ../src/Movement/Kinematics/CoreKinematics.cpp:36:62: error: void value not ignored as it ought to be
    const bool ok = tempMatrix.GaussJordan(MaxAxes, 2 * MaxAxes);
    ^
    ../src/Movement/Kinematics/CoreKinematics.cpp:50:18: error: 'class FixedMatrix<float, 9, 9>' has no member named 'Fill'
    forwardMatrix.Fill(0.0);
    ^~~~
    ../src/Movement/Kinematics/CoreKinematics.cpp: In constructor 'CoreKinematics::CoreKinematics(KinematicsType)':
    ../src/Movement/Kinematics/CoreKinematics.cpp:129:16: error: 'class FixedMatrix<float, 9, 9>' has no member named 'Fill'
    inverseMatrix.Fill(0.0);
    ^~~~
    src/Movement/Kinematics/subdir.mk:39: recipe for target 'src/Movement/Kinematics/CoreKinematics.o' failed
    make: *** [src/Movement/Kinematics/CoreKinematics.o] Error 1
    make: *** Waiting for unfinished jobs....
    ../src/Movement/Kinematics/HangprinterKinematics.cpp: In member function 'virtual bool HangprinterKinematics::DoAutoCalibration(size_t, const RandomProbePointSet&, const StringRef&)':
    ../src/Movement/Kinematics/HangprinterKinematics.cpp:426:33: error: invalid conversion from 'size_t' {aka 'unsigned int'} to 'double
    ' [-fpermissive]
    if (!normalMatrix.GaussJordan(numFactors, numFactors + 1))
    ^~~~~~~~~~
    In file included from ../src/Movement/Kinematics/Kinematics.h:12,
    from ../src/Movement/Kinematics/HangprinterKinematics.h:11,
    from ../src/Movement/Kinematics/HangprinterKinematics.cpp:8:
    C:\Eclipse\Firmware-dev\RRFLibraries\src/Math/Matrix.h:87:93: note: initializing argument 1 of 'void FixedMatrix<T, ROWS, COLS>::GaussJordan(T*, size_t) [with T = double; unsigned int ROWS = 9; unsigned int COLS = 10; size_t = unsigned int]'
    template<class T, size_t ROWS, size_t COLS> void FixedMatrix<T, ROWS, COLS>::GaussJordan(T solution, size_t numRows)
    ~^~~~~~
    ../src/Movement/Kinematics/HangprinterKinematics.cpp:426:32: error: could not convert 'normalMatrix.FixedMatrix<double, 9, 10>::GaussJordan(((double
    )numFactors), (numFactors + 1))' from 'void' to 'bool'
    if (!normalMatrix.GaussJordan(numFactors, numFactors + 1))
    ^~~~
    ../src/Movement/Kinematics/HangprinterKinematics.cpp:426:59: error: in argument to unary !
    if (!normalMatrix.GaussJordan(numFactors, numFactors + 1))
    ^
    src/Movement/Kinematics/subdir.mk:39: recipe for target 'src/Movement/Kinematics/HangprinterKinematics.o' failed
    make: *** [src/Movement/Kinematics/HangprinterKinematics.o] Error 1

    14:16:44 Build Failed. 12 errors, 0 warnings. (took 18s.607ms)


  • administrators

    You have incompatible versions or branches of projects RepRapFirmware and RRFLibraries in your Eclipse workspace.


 

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