Compiling G3Firmware v2.1

47 views
Skip to first unread message

Eberhard Rensch

unread,
Apr 18, 2010, 6:46:06 PM4/18/10
to gen3-firmwar...@googlegroups.com
Hi,
I try to compile (and install) the current HEAD version if the G3Firmware master branch and ran into massive problems.

I tried to use Arduino0018 to compile and install the Extruder firmware, but I got an error:

23: error: sys/ioctl.h: No such file or directory In function 'setDTR':
In function 'main':

Since the file, containing this error seems to be the file toggleDTR.c in the v2 folder, I guess the error has something to do with a new way to build the firmware, using the avr-gcc tool chain instead of Arduino.

I read the README in the v2 folder and installed the tools mentioned in the "requirements" section (avr-gcc, avr-libc and scons).
So far so good, but when trying to build anything, I get errors again:

When trying the documented "scons platform=rrmb12" in the v2 directory, I get the error:

scons: Reading SConscript files ...
Platform rrmb12 is not currently supported.

Using "scons" without any parameters results in:
/opt/local/bin/avr-g++ -o build/Command.o -c -DF_CPU=16000000L -mmcu=atmega644p -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -Isrc/shared -Ibuild/boards/rrmbv12 -Ibuild build/Command.cc
unknown MCU `atmega644p' specified
Known MCU names:
avr2
[...] a list of a zillion microcontrollers [...]

Any advice? Is the documentation wrong?

I'm on Mac OS X 10.6.3.
avr-gcc 4.0.2, avr-libc 1.6.1_0 and scons 1.3.0 are installed.
Arduino 0018 with Sanguino and additional RepRap-Libraries

The above sys/ioctl.h error when trying to build the firmware with Arduino also happens with my old Arduino0017 (which worked fine with G3Firmware v1.8 and v1.9).

Thanks,
Eberhard

--
Subscription settings: http://groups.google.com/group/gen3-firmware-development/subscribe?hl=en

Adam Mayer

unread,
Apr 19, 2010, 12:27:07 AM4/19/10
to gen3-firmwar...@googlegroups.com
Hi,

Those are both oopses on my part.

Old firmware: I usually build the firmware with make, not arduino, so
I'd forgotten that it assumes everything in the same directory is part
of the source. It was trying to compile my little "toggle both the
DTR and RTS lines" script as if it were part of the firmware. I've
removed it from the tree again; it should probably live somewhere
else, anyway.

New firmware: That was a typo. It should be "rrmbv12". You don't
actually need to pass the platform parameter for the rrmbv12 build.
I've removed the instructions from the README.txt and replaced it with
a reference to the wiki doc:
http://wiki.makerbot.com/v2-firmware

Both changes are now pushed to github. Thanks for catching these,
-a

Eberhard Rensch

unread,
Apr 19, 2010, 7:02:50 AM4/19/10
to gen3-firmwar...@googlegroups.com
Thanks, Adam!

I'm now again able to build (and upload) the extruder firmware with Arduino0018.

When trying to build the motherboard firmware, I ran into the same problem again. After deleting the toggleDTR.c file from the SanguinoMaster folder, the build worked. So you might want to delete this file from the SanguinoMaster folder in the repository. 

I tried also building the firmware with the scons build process.

When trying to build the Extruder firmware, I get an error:

noname:v2 zaggo$ scons -f SConstruct.extruder

scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
/opt/local/bin/avr-g++ -o build_extruder/boards/ecv22/AnalogPin.o -c -DF_CPU=16000000L -mmcu=atmega168 -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -Isrc/shared -Ibuild_extruder/boards/ecv22 -Ibuild_extruder build_extruder/boards/ecv22/AnalogPin.cc
build_extruder/boards/ecv22/AnalogPin.cc: In function 'bool startAnalogRead(uint8_t, volatile int16_t*)':
build_extruder/boards/ecv22/AnalogPin.cc:44: error: cleanup argument not a function
scons: *** [build_extruder/boards/ecv22/AnalogPin.o] Error 1
scons: building terminated because of errors.

When trying to build the motherboard firmware, I get this:

noname:v2 zaggo$ scons

scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...

/opt/local/bin/avr-g++ -o build/Command.o -c -DF_CPU=16000000L -mmcu=atmega644p -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -Isrc/shared -Ibuild/boards/rrmbv12 -Ibuild build/Command.cc
unknown MCU `atmega644p' specified
Known MCU names:
   avr2
   at90s2313
[...]
   attiny28
build/Command.cc:1: error: MCU 'atmega644p' supported for assembler only
build/Command.cc: In function 'uint16_t command::getRemainingCapacity()':
build/Command.cc:40: error: cleanup argument not a function
scons: *** [build/Command.o] Error 1
scons: building terminated because of errors.


It seems, that the build process doesn't find resources for atmega644p . Maybe there's a path missing?

In the above builts, I used the avr tools, I installed from MacPorts (pretty much exactly as described on the wiki page http://wiki.makerbot.com/v2-firmware).

When setting the AVR_TOOLS_PATH environment variable to the hardware/tools/avr/bin directory of Arduino0018 on my computer, both builds work. So obviously, when using the non-Arduino tools, the compiler doesn't find several important things...

After successfulliy building the firmware with scons, I then tried to upload the extruder firmware:

noname:v2 zaggo$ scons -f SConstruct.extruder port=/dev/tty.usbserial-FTE5D4R3  upload
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
/Users/zaggo/Documents/CupCake/Firmware/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -V -F -p m168 -P /dev/tty.usbserial-FTE5D4R3 -c stk500v1 -b 19200 -U flash:w:build_extruder/EC-ecv22-v2.2.hex
scons: *** [upload] TypeError : scons_subst_list() got an unexpected keyword argument 'executor'
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/scons-1.3.0/SCons/Taskmaster.py", line 237, in execute
    self.targets[0].build()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/scons-1.3.0/SCons/Node/__init__.py", line 375, in build
    apply(self.get_executor(), (self,), kw)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/scons-1.3.0/SCons/Executor.py", line 363, in __call__
    return self.do_execute(target, kw)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/scons-1.3.0/SCons/Executor.py", line 345, in do_execute
    status = apply(act, args, kw)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/scons-1.3.0/SCons/Action.py", line 567, in __call__
    stat = self.execute(target, source, env, executor=executor)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/scons-1.3.0/SCons/Action.py", line 785, in execute
    cmd_list, ignore, silent = self.process(target, map(rfile, source), env, executor)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/scons-1.3.0/SCons/Action.py", line 702, in process
    result = env.subst_list(self.cmd_list, 0, executor=executor)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/scons-1.3.0/SCons/Environment.py", line 2317, in subst_list
    return apply(SCons.Subst.scons_subst_list, nargs, nkw)
TypeError: scons_subst_list() got an unexpected keyword argument 'executor'
scons: building terminated because of errors.


One general question I have with the two ways to build the firmware:

Are the source code files for both builds (Arduino and scons) the same? I see, that there are additional source files in the v2/src folder. Are these somehow automatically synced with the sources in the SanguinoMaster/ArduinoSlaveExtruder directories during the build or is there any manual work involved?

Cheers,
Eberhard

Adam Mayer

unread,
Apr 19, 2010, 10:27:36 AM4/19/10
to gen3-firmwar...@googlegroups.com
Hi Eberhard;

I'm not too familiar with the mac AVR builds, but it should be
including all the necessary paths automatically. Perhaps avr-libc
needs to be installed separately? Try installing:
http://avr-libc.darwinports.com/

and see if that helps. The version of avr-gcc looks a little old, so
it's possible it's installing an old version of the library
(util/atomic.h was introduced in the 1.4->1.6 transition, which was
about, uh, three years ago). The version of avr-libc on darwinports
is supposed to be 1.6.

As for the scons problem: this looks like a bug in scons 1.3 (I'm
using 1.2). I've pushed a workaround to github, try pulling the
latest change and see if that works.

Thanks,
-a
Reply all
Reply to author
Forward
0 new messages