Welcome! Log In Create A New Profile

Advanced

Duet Firmware in Eclipse

Posted by Superman6424 
Duet Firmware in Eclipse
February 25, 2015 01:05PM
I've been trying to build the existing RepRapFirmware for Duet without any luck. I'm a pretty big newbie to coding on this scale, so assume my prior knowledge is minimal at best! winking smiley


Short version:
When I go to build, I'm getting g++ errors saying:
arm-none-eabi-g++: error: '-DUSB_MANUFACTURER=Unknown': No such file or directory
arm-none-eabi-g++: error: '-DUSB_PRODUCT=Arduino Due': No such file or directory
make: *** [GCodes.cpp.o] Error 1

The Problems tab will also highlight an Error 5


Long version:
I followed this guide to get myself set up:
[blog.think3dprint3d.com]

Everything went swimmingly until I needed to compile the project, at which point I needed make, and followed the instructions here:
[forum.arduino.cc]
Which led me to add the "make" directory to PATH under Eclipse project preferences->C/C++ Build->Environment-> PATH, and to Advanced System Settings->Environment Variables->System Variables-> PATH
My system had some issues getting access to this path, so I changed the Program Files security settings and ran Eclipse as Admin.

Now when I build I get:

"C:/Program Files (x86)/Arduino/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -mcpu=cortex-m3 -DF_CPU=84000000L -DARDUINO=158 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Due"' "-IC:/Program Files (x86)/Arduino/hardware/arduino/sam/system/libsam" "-IC:/Program Files (x86)/Arduino/hardware/arduino/sam/system/CMSIS/CMSIS/Include/" "-IC:/Program Files (x86)/Arduino/hardware/arduino/sam/system/CMSIS/Device/ATMEL/" -I"C:\Program Files (x86)\Arduino\hardware\arduino\sam\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\sam\variants\arduino_due_x" -MMD -MP -MF"GCodes.cpp.d" -MT"GCodes.cpp.d" -D__IN_ECLIPSE__=1 -x c++ "../GCodes.cpp" -o "GCodes.cpp.o"
arm-none-eabi-g++: error: '-DUSB_MANUFACTURER=Unknown': No such file or directory
arm-none-eabi-g++: error: '-DUSB_PRODUCT=Arduino Due': No such file or directory
make: *** [GCodes.cpp.o] Error 1

When I try to clean, I get this error message:

failed.
make (e=2): The system cannot find the file specified.
make: [clean] Error 2 (ignored)


Not sure if any of you lovely people can make sense of this, but I'm pretty lost as to what to do!


Edit: Removing the Environment path to "make" doesn't change my error. I'd assume Eclipse is having a problem with accessing/seeing "make".

Edited 3 time(s). Last edit at 02/26/2015 03:25AM by Superman6424.
Re: Duet Firmware in Eclipse
February 25, 2015 02:52PM
First, you only need to build RepRapFirmware if you need to change its functionality. You don't need to build it to configure it for your printer (unlike Marlin), because you can do all the usual configuration with gcodes in the config.g file.

Second, if you want to add a feature that is of general use, then you may be able to persuade either me or forum user zombiepantslol to implement it for you.

If you have a good reason for wanting to rebuild it, read on.

The RepRapFirmware build environment is Eclipse with an Arduino plugin. The problem is that the Arduino plugin had not been kept up to date with either Eclipse or Arduino.

I maintain a fork of RepRapFirmware, and in the near future I intend to remove the dependency on Arduino, so that it it s pure Eclipse project. The Arduino core is more of a hindrance than a help as I have had to patch it in several places and bypass it in many others. But for now, a workaround is to go into the project Properties, C/C++ Build, Environment and remove the references to USB_MANUFACTURER and USB_PRODUCT, which are not needed. AFAIR they are in variable A.COMPILER.CPP.FLAGS.

If you do want to change the firmware, then I suggest you base your changes on either my fork or zombiepantslol's fork, because they both contain many improvements over the standard RepRapPro release. See [github.com] for the improvements in my fork - and note that all the new code in my fork is in the dev branch, not the master branch.

Edited 2 time(s). Last edit at 02/25/2015 02:54PM by dc42.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet Firmware in Eclipse
February 26, 2015 02:58AM
Thanks dc42!

I'm planning on adding some custom functionality, or at least see how far I can get in doing it! tongue sticking out smiley
I wasn't aware that the plugin is so out of date. I was previously using Arduino 1.5.8, which might have caused some problems for me.

In 1.5.8, your tip in removing the references in A.COMPLIER.CPP.FLAGS let me move forward, but I was still missing some .h files that looked like they should have been referenced already (When building GCodes.cpp, it'll tell me GCodeState isn't a class - I guess it can't see it in GCodes.h?). If you've got any suggestions on what I might be missing, I'd be happy to hear it so I can continue working with 1.5.8, otherwise, I'm content going back to 1.5.6-r2 if it makes it work!

I was getting a bit frustrated, so switched to a new system, and installed Arduino 1.5.6-r2 straight in C:/Arduino/.
This compiled much easier, and didn't give me any of the USB_MANUFACTURER and USB_PRODUCT errors I had before.

I also switched to trying your fork (thank you, looks good!). Had a small hiccup in compiling Platform.cpp where it didn't recognize canWrite() within Serial_. Fixed by adding "virtual size_t canWrite(void);" within Serial_ in RepRapFirmware/arduino/core/USB/USBAPI.h, and removing the "const" within the RepRapFirmware/ArduinoCorePatches/sam/cores/arduino/USB/CDC.cpp file. (Sorry if I'm butchering your code, just trying to make it work tongue sticking out smiley)

Now, every individual file builds (hooray!), but in combining I get a slew of errors like this:

./ArduinoCorePatches/sam/system/libsam/source/emac.c.o: In function `emac_phy_write':
C:\Users\USER\workspace\RepRapFirmware\Release/../ArduinoCorePatches/sam/system/libsam/source/emac.c:350: multiple definition of `emac_phy_write'
./Libraries/Lwip/lwip/src/sam/netif/ethernetif.c.o:C:/Arduino/hardware/arduino/sam/system/libsam/source/emac.c:344: first defined here
./ArduinoCorePatches/sam/system/libsam/source/emac.c.o: In function `emac_phy_read':
C:\Users\USER\workspace\RepRapFirmware\Release/../ArduinoCorePatches/sam/system/libsam/source/emac.c:328: multiple definition of `emac_phy_read'
./Libraries/Lwip/lwip/src/sam/netif/ethernetif.c.o:C:/Arduino/hardware/arduino/sam/system/libsam/source/emac.c:322: first defined here
collect2: ld returned 1 exit status
make: *** [RepRapFirmware.elf] Error 1


Looks like I have two definitions of the same functions. What's the best way of ignoring the definitions within the non-patched versions?
I'll have to print you something nice if you can help me out with getting this compiled!

Edited 1 time(s). Last edit at 02/26/2015 03:39AM by Superman6424.
Re: Duet Firmware in Eclipse
February 26, 2015 07:26AM
To build my fork, don't include the ArduinoCorePatches folder in your source code tree. Instead, overwrite files in your Arduino folder with the corresponding ones in ArduinoCorePatches. The files there are based on Arduino 1.5.9.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet Firmware in Eclipse
March 01, 2015 03:42AM
Worked like a charm, thank you! You've made this biomedical engineering student very happy!
Re: Duet Firmware in Eclipse
August 09, 2015 01:32AM
Hi DC42 (and others),
Since successfully building the project, I've let this slide for a bit, but coming back to it now, I'm having issues once again!
I'm still on Arduino 1.5.6-r2, but building from your latest dev branch.

I think I've followed the steps (created workspace, added make to path, overwritten Arduino libraries with core patches, identified RepRapFirmware include files), but I'm getting errors in detecting files.

01:35:49 **** Incremental Build of configuration Debug for project MAReprapFirmware ****
make all
'Building file: ../Libraries/Wire/Wire.cpp'
'Invoking: Cross G++ Compiler'
g++ -I"C:\arduino\hardware\arduino\sam\system\libsam\include" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Libraries/Wire/Wire.d" -MT"Libraries/Wire/Wire.d" -o "Libraries/Wire/Wire.o" "../Libraries/Wire/Wire.cpp"
In file included from ../Libraries/Wire/Wire.cpp:25:0:
../Libraries/Wire/Wire.h:25:25: fatal error: include/twi.h: No such file or directory
#include
^
compilation terminated.
make: *** [Libraries/Wire/Wire.o] Error 1


It also looks like it's unable to see the definition of size_t or uint8_t.

When I try building the lastest Master branch (over 2 years old?), It can't find Arduino.h. I can manually point to it in C:\Arduino\hardware\arduino\sam\cores\arduino, at which point I get the same error, but now with chip.h. I can follow the rabbit hole deeper this way, but I can't help but think I'm missing something simple.

Here is the error in this second case:


01:24:05 **** Build of configuration Debug for project MAFirmware ****
make all
'Building file: ../network/ethernet_sam.c'
'Invoking: Cross GCC Compiler'
gcc -I"C:\<...>\workspace\MAFirmware\network" -I"C:\<...>\workspace\MAFirmware\Libraries\EMAC" -I"C:\<...>\workspace\MAFirmware\Libraries\Lwip" -I"C:\<...>\workspace\MAFirmware\Libraries\MCP4461" -I"C:\<...>\workspace\MAFirmware\Libraries\SamNonDuePin" -I"C:\<...>\workspace\MAFirmware\Libraries\SD_HSMCI" -I"C:\<...>\workspace\MAFirmware\Libraries\SD_HSMCI\utility" -I"C:\<...>\workspace\MAFirmware\Libraries\Wire" -I"C:\arduino\hardware\arduino\sam\system\libsam\include" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"network/ethernet_sam.d" -MT"network/ethernet_sam.d" -o "network/ethernet_sam.o" "../network/ethernet_sam.c"
In file included from C:\<...>\workspace\MAFirmware\network/lwipopts.h:53:0,
from C:\<...>\workspace\MAFirmware\Libraries\Lwip/lwip/src/include/lwip/opt.h:45,
from C:\<...>\workspace\MAFirmware\Libraries\Lwip/lwip/src/include/lwip/netif.h:35,
from ../network/ethernet_sam.h:47,
from ../network/ethernet_sam.c:47:
C:\<...>\workspace\MAFirmware\Libraries\EMAC/conf_eth.h:49:21: fatal error: Arduino.h: No such file or directory
#include "Arduino.h"
^
compilation terminated.
make: *** [network/ethernet_sam.o] Error 1


Any suggestions?

Edited 1 time(s). Last edit at 08/09/2015 01:46AM by Superman6424.
Re: Duet Firmware in Eclipse
August 09, 2015 03:50AM
Looks like in when compiling the dev branch, you are missing all the include paths. This is what I see when building that file:

'Building file: C:/Arduino-1.5.8/hardware/arduino/sam/libraries/Wire/Wire.cpp'
'Starting C++ compile'
"C:/Arduino-1.5.8/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -O2 -save-temps -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -mcpu=cortex-m3 -DF_CPU=84000000L -DARDUINO=158 -DARDUINO_SAM_DUE -DARDUINO_ARCH_  -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-IC:/Arduino-1.5.8/hardware/arduino/sam/system/libsam" "-IC:/Arduino-1.5.8/hardware/arduino/sam/system/CMSIS/CMSIS/Include/" "-IC:/Arduino-1.5.8/hardware/arduino/sam/system/CMSIS/Device/ATMEL/"   -I"C:\Arduino-1.5.8\hardware\arduino\sam\cores\arduino" -IC:/arduino-1.5.8/hardware/arduino/sam/system/libsam/include -I"C:\Users\David\Eclipse\RepRapFirmware\Libraries\EMAC" -I"C:\Users\David\Eclipse\RepRapFirmware\Libraries\Lwip" -I"C:\Users\David\Eclipse\RepRapFirmware\Libraries\MCP4461" -I"C:\Users\David\Eclipse\RepRapFirmware\Libraries\SamNonDuePin" -I"C:\Users\David\Eclipse\RepRapFirmware\Libraries\SD_HSMCI" -I"C:\Users\David\Eclipse\RepRapFirmware\Libraries\SD_HSMCI\utility" -I"C:\Arduino-1.5.8\hardware\arduino\sam\libraries\Wire" -I"C:\Arduino-1.5.8\hardware\arduino\sam\variants\arduino_due_x" -I"C:\Arduino-1.5.8\hardware\tools\gcc-arm-none-eabi-4.8.3-2014q1\lib\gcc\arm-none-eabi\4.8.3\include" -I"C:\Users\David\Eclipse\RepRapFirmware\Libraries\Flash" -MMD -MP -MF"Libraries/Wire/Wire.cpp.d" -MT"Libraries/Wire/Wire.cpp.d" -x c++ "C:/Arduino-1.5.8/hardware/arduino/sam/libraries/Wire/Wire.cpp"  -o  "Libraries/Wire/Wire.cpp.o"   -Wall  -O2 -std=gnu++11
'Finished building: C:/Arduino-1.5.8/hardware/arduino/sam/libraries/Wire/Wire.cpp'



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet Firmware in Eclipse
August 09, 2015 06:16PM
Hi DC42, thanks for the tip!
I've included some of the missing directories into the project C/C++ General settings - strange that I got the project to compile before without these inclusions...

Now I'm seeing many unknown type errors:

C:\Arduino\hardware\arduino\sam\system\libsam/include/ssc.h:172:26: error: unknown type name 'Ssc'
void ssc_set_transmitter(Ssc *p_ssc, clock_opt_t *p_tx_clk_opt, data_frame_opt_t *p_tx_data_frame);

C:\Arduino\hardware\arduino\sam\system\libsam/include/tc.h:63:27: error: unknown type name 'Tc'
extern void TC_Configure( Tc *pTc, uint32_t dwChannel, uint32_t dwMode ) ;

C:\Arduino\hardware\arduino\sam\system\libsam/include/usart.h:118:39: error: unknown type name 'Usart'
extern uint8_t USART_IsDataAvailable( Usart *usart ) ;

Where would these definitions live? Is there a bigger picture I'm missing here as to why these paths are not included or listed in the guide from my original post?
Re: Duet Firmware in Eclipse
August 10, 2015 05:33PM
Alright, I went through some of the paths and found some of them to still point to C:/Program Files (x86)/Arduino instead of just C:/Arduino.
I've tried compiling this on both of my rigs, with slightly different errors.

The setup with Arduino 1.5.8 gives me these errors & warnings:
make:***[GCodes.cpp.o] Error 1
make:***[GCodes.cpp.o] Error 5
I also get Error 1 for DDA.ccp.o, ethernetif.c.o, and RepRapFirmware.elf

I also get 'GCodeState' is not a class or namespace, despite seeing it in GCodes.cpp.
Finally, about 100ish warnings about things like "longWait" not being initialized (which looks initialized in GCodes.h and defined in GCodes.cpp).

On my second rig (Arduino 1.5.6r2), I get the same warnings, but with ADC-related errors.

My best guess is that the compiler is looking for a GCodes.cpp.o when there is only a GCodes.cpp file.
Sorry for my general newbie-ness and if I'm missing some obvious basics tongue sticking out smiley
I appreciate the help!
Re: Duet Firmware in Eclipse
August 10, 2015 05:41PM
How do the C++ compiler command lines in the console window compare with the one I posted above for Wire.cpp?

The "'GCodeState' is not a class or namespace" error sounds to me like you are missing the -std=gnu++11 option from the C++ compiler flags.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet Firmware in Eclipse
August 10, 2015 05:47PM
Here's what I've got

'Building file: ../Libraries/Wire/Wire.cpp'
'Invoking: Cross G++ Compiler'
g++ -I"C:\Arduino\hardware\arduino\sam\system\libsam" -I"C:\Arduino\hardware\arduino\sam\system\libsam\include" -I"C:\Arduino\hardware\arduino\sam\system\CMSIS\CMSIS\Include" -I"C:\Arduino\hardware\arduino\sam\system\CMSIS\Device\ATMEL" -I"C:\Arduino\hardware\arduino\sam\cores\arduino" -I"C:\Users\Mark\Desktop\eclipseArduino\workspace\MARepRapFirmware\Libraries\EMAC" -I"C:\Users\Mark\Desktop\eclipseArduino\workspace\MARepRapFirmware\Libraries\Lwip" -I"C:\Users\Mark\Desktop\eclipseArduino\workspace\MARepRapFirmware\Libraries\MCP4461" -I"C:\Users\Mark\Desktop\eclipseArduino\workspace\MARepRapFirmware\Libraries\SamNonDuePin" -I"C:\Users\Mark\Desktop\eclipseArduino\workspace\MARepRapFirmware\Libraries\SD_HSMCI" -I"C:\Users\Mark\Desktop\eclipseArduino\workspace\MARepRapFirmware\Libraries\SD_HSMCI\utility" -I"C:\Users\Mark\Desktop\eclipseArduino\workspace\MARepRapFirmware\Libraries\Wire" -I"C:\Arduino\hardware\arduino\sam\variants\arduino_due_x" -I"C:\Arduino\hardware\tools\g++_arm_none_eabi\lib\gcc\arm-none-eabi\4.4.1\include" -I"C:\Users\Mark\Desktop\eclipseArduino\workspace\MARepRapFirmware\Libraries\Flash" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Libraries/Wire/Wire.d" -MT"Libraries/Wire/Wire.d" -o "Libraries/Wire/Wire.o" "../Libraries/Wire/Wire.cpp"

Re: Duet Firmware in Eclipse
August 10, 2015 06:13PM
I'm away from my computer at present, but if you compare your compiler command line with mine, you will see there are some differences. For example, you are indeed missing the -std=gnu++11 option, and you are using -O0 instead of -O2. So you have the wrong values in your COMPILER.CPP.FLAGS build environment setting (I think that is what it is called).

Edited 1 time(s). Last edit at 08/10/2015 06:15PM by dc42.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet Firmware in Eclipse
August 10, 2015 08:49PM
Edit: Still some errors.

arm-none-eabi-gcc: error: /C:/Program Files (x86)/Arduino/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a: Invalid argument
make: *** [RepRapFirmware.elf] Error 1

and the original ones with all the .cpp.o files

Edited 2 time(s). Last edit at 08/10/2015 08:56PM by Superman6424.
Re: Duet Firmware in Eclipse
August 11, 2015 02:17AM
I thought you said that C:/Program Files (x86) etc. was not the correct path to Arduino on your system? Looks like you still have some of the paths wrong.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet Firmware in Eclipse
August 11, 2015 02:08PM
Still the same issue.

arm-none-eabi-gcc: error: /C:/Arduino/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a: Invalid argument
make: *** [RepRapFirmware.elf] Error 1
Re: Duet Firmware in Eclipse
August 11, 2015 02:49PM
I think I remember seeing a similar error once, and it was caused by the "/" in front of the "C:". Fixing the parameter that defined that library or library path fixed it.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet Firmware in Eclipse
August 12, 2015 12:33AM
I now you are getting tired of all this questions. But hear is min:

Building file: C:/workspace/RepRapFirmware/Libraries/Lwip/lwip/src/sam/netif/ethernetif.c
Starting C compile
"C:/Arduino/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-gcc" -c -g -Os -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -Dprintf=iprintf -mcpu=cortex-m3 -DF_CPU=84000000L -DARDUINO=158 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Due"' "-IC:/Arduino/hardware/arduino/sam/system/libsam" "-IC:/Arduino/hardware/arduino/sam/system/CMSIS/CMSIS/Include/" "-IC:/Arduino/hardware/arduino/sam/system/CMSIS/Device/ATMEL/" -I"C:\Arduino\hardware\arduino\sam\cores\arduino" -I"C:\workspace\RepRapFirmware\Libraries\EMAC" -I"C:\workspace\RepRapFirmware\Libraries\Lwip" -I"C:\workspace\RepRapFirmware\Libraries\MCP4461" -I"C:\workspace\RepRapFirmware\Libraries\SamNonDuePin" -I"C:\workspace\RepRapFirmware\Libraries\SD_HSMCI" -I"C:\workspace\RepRapFirmware\Libraries\SD_HSMCI\utility" -I"C:\workspace\RepRapFirmware\Libraries\Wire" -I"C:\Arduino\hardware\arduino\sam\variants\arduino_due_x" -I"C:\Arduino\hardware\tools\gcc-arm-none-eabi-4.8.3-2014q1\arm-none-eabi\include" -I"C:\workspace\RepRapFirmware\Libraries\Flash" -I"C:\Arduino\hardware\arduino\sam\system\libsam\include" -MMD -MP -MF"Libraries/Lwip/lwip/src/sam/netif/ethernetif.c.d" -MT"Libraries/Lwip/lwip/src/sam/netif/ethernetif.c.d" -D__IN_ECLIPSE__=1 "C:/workspace/RepRapFirmware/Libraries/Lwip/lwip/src/sam/netif/ethernetif.c" -o "Libraries/Lwip/lwip/src/sam/netif/ethernetif.c.o" -Wall -O2
C:/workspace/RepRapFirmware/Libraries/Lwip/lwip/src/sam/netif/ethernetif.c: In function 'ethernetif_set_mac_address':
C:/workspace/RepRapFirmware/Libraries/Lwip/lwip/src/sam/netif/ethernetif.c:507:2: error: 'for' loop initial declarations are only allowed in C99 mode
for (size_t i = 0; i < 6; ++i)
^
C:/workspace/RepRapFirmware/Libraries/Lwip/lwip/src/sam/netif/ethernetif.c:507:2: note: use option -std=c99 or -std=gnu99 to compile your code
make: *** [Libraries/Lwip/lwip/src/sam/netif/ethernetif.c.o] Error 1

I thought this " -std=gnu99" this was supposed to be this"-std=gnu++11". Or is one for the C compiler and the other for the C++ Compiler?
Re: Duet Firmware in Eclipse
August 12, 2015 03:42AM
That's correct, one is for C and the other is for C++. Here is my build environment setting for A.COMPILER.C.FLAGS:

-c -g -std=gnu99 -O2 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -Dprintf=iprintf

And here is A.COMPILER.CPP.FLAGS:

-c -g -std=gnu++11 -O2 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet Firmware in Eclipse
August 14, 2015 01:45AM
Alrighty! The /C:/ error was just a typo fix, but it still left me with the GCodes.cpp.o error 1 message.
A few more days of frustration have passed. I caved, and eventually: reinstalled the eclipse/arduino IDE, arduino 1.4.8, and copied DC42's build command as close as possible.
I've finally gotten this lovely message:

'Finished building target: RepRapFirmware'

Unfortunately, there are still errors and warnings (even though it built).
It looks like the "include cstddef, cfloat, cstdarg" in RepRapFirmware.g was not seeing the respective .f files, so I directly included this path to the project:
C:\arduino-1.5.8\hardware\tools\gcc-arm-none-eabi-4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3

I'm still getting errors like size_t could not be resolved, but I'll see if I can't find out why it isn't recognizing the standard stddef.h definition.

Of more concern, I've tried writing the (broken? but built) firmware onto the Duet, straight from the DC42 dev branch. Once I run the bossac.exe command, the board becomes inoperable. My computer no longer recognises it (neither as a Due or Bossa port). Have you seen this issue before? Is it related to the errors I'm seeing, or is it a whole separate issue?

Thanks!!

Edited 2 time(s). Last edit at 08/14/2015 01:48AM by Superman6424.
Re: Duet Firmware in Eclipse
August 14, 2015 04:24AM
Quote
Superman6424
Alrighty! The /C:/ error was just a typo fix, but it still left me with the GCodes.cpp.o error 1 message.
A few more days of frustration have passed. I caved, and eventually: reinstalled the eclipse/arduino IDE, arduino 1.4.8, and copied DC42's build command as close as possible.
I've finally gotten this lovely message:

'Finished building target: RepRapFirmware'

Unfortunately, there are still errors and warnings (even though it built).
It looks like the "include cstddef, cfloat, cstdarg" in RepRapFirmware.g was not seeing the respective .f files, so I directly included this path to the project:
C:\arduino-1.5.8\hardware\tools\gcc-arm-none-eabi-4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3

I'm still getting errors like size_t could not be resolved, but I'll see if I can't find out why it isn't recognizing the standard stddef.h definition.

Of more concern, I've tried writing the (broken? but built) firmware onto the Duet, straight from the DC42 dev branch. Once I run the bossac.exe command, the board becomes inoperable. My computer no longer recognises it (neither as a Due or Bossa port). Have you seen this issue before? Is it related to the errors I'm seeing, or is it a whole separate issue?

Thanks!!

Do you get the size_t error when compiling a C file or a C++ file? If it's in a C file then you will need to adjust the include path when compiling C files too.

Pressing the Erase button for at least 0.5sec and then the Reset button should make the Duet appear as a Bossa port again.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet Firmware in Eclipse
August 14, 2015 12:36PM
The size_t error was with every C++ file. I've been adding paths to both C and C++.

I followed the rabbit hole a bit deeper with including some of these file until I got errors like
Function '__DMB' could not be resolved in Move.cpp and symbol 'WDT_MR_WDRSTEN' could not be resolved in RepRapFirmware.cpp.

I thought "__function"s were internal to the compiler? How is this not being picked up?
I'm also surprised I'm getting the program to build with 50+ errors that seem awfully critical to the functionality.
Re: Duet Firmware in Eclipse
August 14, 2015 03:51PM
Quote
Superman6424
The size_t error was with every C++ file. I've been adding paths to both C and C++.

I followed the rabbit hole a bit deeper with including some of these file until I got errors like
Function '__DMB' could not be resolved in Move.cpp and symbol 'WDT_MR_WDRSTEN' could not be resolved in RepRapFirmware.cpp.

I thought "__function"s were internal to the compiler? How is this not being picked up?
I'm also surprised I'm getting the program to build with 50+ errors that seem awfully critical to the functionality.

Are those compiler errors or linker errors?

In my build, the build process stop as soon as it hits a compiler error. However, if all modules compile, then sadly, by default the gcc linker goes on to produce a binary even in the presence of undefined symbols.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet Firmware in Eclipse
August 14, 2015 04:45PM
Ah, likely a linker error then. In my poking around, I noticed the Libraries folder of the RepRapFirmware project wasn't letting me open it to see the files included within, but was instead trying to look for EMAC, Lwip, etc in the arduino/libraries. Copying over the libraries from my project into the arduino/libraries allowed me to progress.

I'm seeing a couple errors:
cannot convert 'const uint8_t* {aka const unsigned char*}' to 'const unsigned char**' for argument '1' to 'void start_ethernet(const unsigned char**, const unsigned char**, const unsigned char**)'
in Network.cpp. Seems strange, I don't see why it would be expecting a **.

and an "invalid redefinition" of this function in RepRapFirmware.h:
inline uint64_t isquare64(int32_t arg)
{
	return (uint64_t)((int64_t)arg * arg);
}

inline uint64_t isquare64(uint32_t arg)
{
	return (uint64_t)arg * arg;
}

Edited 1 time(s). Last edit at 08/14/2015 04:52PM by Superman6424.
Re: Duet Firmware in Eclipse
August 14, 2015 07:26PM
Quote
Superman6424
Ah, likely a linker error then. In my poking around, I noticed the Libraries folder of the RepRapFirmware project wasn't letting me open it to see the files included within, but was instead trying to look for EMAC, Lwip, etc in the arduino/libraries. Copying over the libraries from my project into the arduino/libraries allowed me to progress.

I'm seeing a couple errors:
cannot convert 'const uint8_t* {aka const unsigned char*}' to 'const unsigned char**' for argument '1' to 'void start_ethernet(const unsigned char**, const unsigned char**, const unsigned char**)'
in Network.cpp. Seems strange, I don't see why it would be expecting a **.

and an "invalid redefinition" of this function in RepRapFirmware.h:
inline uint64_t isquare64(int32_t arg)
{
	return (uint64_t)((int64_t)arg * arg);
}

inline uint64_t isquare64(uint32_t arg)
{
	return (uint64_t)arg * arg;
}


I get those errors too, They are from the Eclipse code analyser, not from the compiler, and can safely be ignored.

I don't know why Eclipse didn't find the libraries in the Libraries folder, it works for me.

Edited 1 time(s). Last edit at 08/14/2015 07:28PM by dc42.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet Firmware in Eclipse
August 15, 2015 04:27PM
Hi DC, think I got a good compile. I only needed to change the 'TEMPERATURE_LOW_SO_DONT_CARE' variable to something lower then 35c. So my Fan will shutdown when the hot end has gotten cool enough to shutdown the printer (M81) command. I am not Shure I Believe my diff tool comparing your 'RepRapFirmware-1.09e-dc42.bin' build to my 'RepRapFirmware.bin' build. Its telling my they are identical except for one byte. Any way, I program for a living and what helps me the most when I have to revers engineer some software is the compiler command lines.

Thanks have a good day
Re: Duet Firmware in Eclipse
September 25, 2015 02:06PM
I have a custom 3d printer that uses 2 x drives and 2 z drives
I have a duet controller with expansion
Is it possible to mirror the x stepper movements to one of the drivers on the expansion board and mirror the z axis stepper movements to one on the expansion board
I know it is possible to wire 2 stepper motors in parallel or series but this is not an option that I want to use
If you could put me in the right direction on the coding I might take a crack at doing the modifications

Edited 1 time(s). Last edit at 09/25/2015 02:07PM by percar.
Re: Duet Firmware in Eclipse
September 25, 2015 03:59PM
By far the simplest option is to wire the two motors in series. If that limits the maximum speed to an extent you are not happy with, increase the supply voltage to 24V.

If you want to change the firmware to drive two steppers for each of X and Z, I suggest you start from my 1.09k release. That has a driver mapping table (variable 'driverNumbers') in the Platform class. You could add a secondary driver mapping table, and use a value of -1 in its entries to mean that there is no secondary driver for that axis. Then look for all points in Platform.cpp at which the code accesses an entry in the primary driver mapping table. Have the code look at the corresponding entry in the secondary table too, and if the entry is not -1, do the same action on the secondary drive.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet Firmware in Eclipse
October 06, 2015 09:18PM
I have found a pin map for Arduino due (https://www.arduino.cc/en/Hacking/PinMappingSAM3X however as you know there are a number of pins that were not defined by Arduino
Is there a pin map the defines the additional pins. 93-126 (X1 and up)
Re: Duet Firmware in Eclipse
October 07, 2015 04:35AM
Quote
percar
I have found a pin map for Arduino due (https://www.arduino.cc/en/Hacking/PinMappingSAM3X however as you know there are a number of pins that were not defined by Arduino
Is there a pin map the defines the additional pins. 93-126 (X1 and up)

I am not aware of a pictorial pin map. In my fork of RepRapFirmware, the mapping of the X1-X17 pins to ports on the microcontroller is defined in this table at the start of this source file: [github.com].



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Sorry, only registered users may post in this forum.

Click here to login