Hi.I have two new extruder boards. My friend has assembled them, and on the BOM it says that it should be a Mega 328p so he fitted those. The PCB's are the official layout. I replaced the Mega 328 from one of the boards to be an Mega 168 and flashed bootloader, and ReplicatorG flashed the firmware on it perfectly, and it works perfectly.
Now, i want to be able to re-compile the firmware from sources so i can run it on the Mega 328 too, but before doing that, i wanted to make sure that my compiler environment is working 100 % as it should.
I am running Mac OS X (Snow Leopard)
I looked at http://wiki.makerbot.com/v2-firmware and followed the instructions 100 % regarding the usage on Mac OS X.
I need to compile firmware for the Extruder Controller, and i see that the sources i got from Git is v2.9 - i found out how to get the same software as ReplicatorG ships with (v2.8) so i am working with the same source.
Running this command "scons -f SConstruct.extruder" generates this output:
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
/usr/local/avr/bin/avr-g++ -o build_extruder/AnalogPin.o -c -DF_CPU=16000000L -DVERSION=208 -mmcu=atmega168 -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DDEFAULT_RELAYS=1 -Isrc/shared -Ibuild_extruder/boards/ecv22 -Ibuild_extruder build_extruder/AnalogPin.cc
/usr/local/avr/bin/avr-g++ -o build_extruder/DebugPacketProcessor.o -c -DF_CPU=16000000L -DVERSION=208 -mmcu=atmega168 -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DDEFAULT_RELAYS=1 -Isrc/shared -Ibuild_extruder/boards/ecv22 -Ibuild_extruder build_extruder/DebugPacketProcessor.cc
/usr/local/avr/bin/avr-g++ -o build_extruder/EepromMap.o -c -DF_CPU=16000000L -DVERSION=208 -mmcu=atmega168 -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DDEFAULT_RELAYS=1 -Isrc/shared -Ibuild_extruder/boards/ecv22 -Ibuild_extruder build_extruder/EepromMap.cc
/usr/local/avr/bin/avr-g++ -o build_extruder/Heater.o -c -DF_CPU=16000000L -DVERSION=208 -mmcu=atmega168 -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DDEFAULT_RELAYS=1 -Isrc/shared -Ibuild_extruder/boards/ecv22 -Ibuild_extruder build_extruder/Heater.cc
/usr/local/avr/bin/avr-g++ -o build_extruder/Host.o -c -DF_CPU=16000000L -DVERSION=208 -mmcu=atmega168 -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DDEFAULT_RELAYS=1 -Isrc/shared -Ibuild_extruder/boards/ecv22 -Ibuild_extruder build_extruder/Host.cc
/usr/local/avr/bin/avr-g++ -o build_extruder/Main.o -c -DF_CPU=16000000L -DVERSION=208 -mmcu=atmega168 -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DDEFAULT_RELAYS=1 -Isrc/shared -Ibuild_extruder/boards/ecv22 -Ibuild_extruder build_extruder/Main.cc
/usr/local/avr/bin/avr-g++ -o build_extruder/MotorController.o -c -DF_CPU=16000000L -DVERSION=208 -mmcu=atmega168 -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DDEFAULT_RELAYS=1 -Isrc/shared -Ibuild_extruder/boards/ecv22 -Ibuild_extruder build_extruder/MotorController.cc
/usr/local/avr/bin/avr-g++ -o build_extruder/TemperatureThread.o -c -DF_CPU=16000000L -DVERSION=208 -mmcu=atmega168 -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DDEFAULT_RELAYS=1 -Isrc/shared -Ibuild_extruder/boards/ecv22 -Ibuild_extruder build_extruder/TemperatureThread.cc
/usr/local/avr/bin/avr-g++ -o build_extruder/Thermistor.o -c -DF_CPU=16000000L -DVERSION=208 -mmcu=atmega168 -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DDEFAULT_RELAYS=1 -Isrc/shared -Ibuild_extruder/boards/ecv22 -Ibuild_extruder build_extruder/Thermistor.cc
/usr/local/avr/bin/avr-g++ -o build_extruder/ThermistorTable.o -c -DF_CPU=16000000L -DVERSION=208 -mmcu=atmega168 -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DDEFAULT_RELAYS=1 -Isrc/shared -Ibuild_extruder/boards/ecv22 -Ibuild_extruder build_extruder/ThermistorTable.cc
/usr/local/avr/bin/avr-g++ -o build_extruder/Timeout.o -c -DF_CPU=16000000L -DVERSION=208 -mmcu=atmega168 -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DDEFAULT_RELAYS=1 -Isrc/shared -Ibuild_extruder/boards/ecv22 -Ibuild_extruder build_extruder/Timeout.cc
/usr/local/avr/bin/avr-g++ -o build_extruder/boards/ecv22/ExtruderBoard.o -c -DF_CPU=16000000L -DVERSION=208 -mmcu=atmega168 -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DDEFAULT_RELAYS=1 -Isrc/shared -Ibuild_extruder/boards/ecv22 -Ibuild_extruder build_extruder/boards/ecv22/ExtruderBoard.cc
/usr/local/avr/bin/avr-g++ -o build_extruder/boards/ecv22/ExtruderMotor.o -c -DF_CPU=16000000L -DVERSION=208 -mmcu=atmega168 -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DDEFAULT_RELAYS=1 -Isrc/shared -Ibuild_extruder/boards/ecv22 -Ibuild_extruder build_extruder/boards/ecv22/ExtruderMotor.cc
/usr/local/avr/bin/avr-g++ -o build_extruder/boards/ecv22/UART.o -c -DF_CPU=16000000L -DVERSION=208 -mmcu=atmega168 -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DDEFAULT_RELAYS=1 -Isrc/shared -Ibuild_extruder/boards/ecv22 -Ibuild_extruder build_extruder/boards/ecv22/UART.cc
/usr/local/avr/bin/avr-g++ -o src/shared/AvrPort.o -c -DF_CPU=16000000L -DVERSION=208 -mmcu=atmega168 -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DDEFAULT_RELAYS=1 -Isrc/shared -Ibuild_extruder/boards/ecv22 -Ibuild_extruder src/shared/AvrPort.cc
/usr/local/avr/bin/avr-g++ -o src/shared/PID.o -c -DF_CPU=16000000L -DVERSION=208 -mmcu=atmega168 -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DDEFAULT_RELAYS=1 -Isrc/shared -Ibuild_extruder/boards/ecv22 -Ibuild_extruder src/shared/PID.cc
/usr/local/avr/bin/avr-g++ -o src/shared/Packet.o -c -DF_CPU=16000000L -DVERSION=208 -mmcu=atmega168 -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DDEFAULT_RELAYS=1 -Isrc/shared -Ibuild_extruder/boards/ecv22 -Ibuild_extruder src/shared/Packet.cc
/usr/local/avr/bin/avr-gcc -mmcu=atmega168 -Wl,-Map=build_extruder/EC-ecv22-v2.8.elf.map -Os -Wl,--gc-sections -o build_extruder/EC-ecv22-v2.8.elf build_extruder/AnalogPin.o build_extruder/DebugPacketProcessor.o build_extruder/EepromMap.o build_extruder/Heater.o build_extruder/Host.o build_extruder/Main.o build_extruder/MotorController.o build_extruder/TemperatureThread.o build_extruder/Thermistor.o build_extruder/ThermistorTable.o build_extruder/Timeout.o build_extruder/boards/ecv22/ExtruderBoard.o build_extruder/boards/ecv22/ExtruderMotor.o build_extruder/boards/ecv22/UART.o src/shared/AvrPort.o src/shared/PID.o src/shared/Packet.o
/usr/local/avr/bin/avr-objcopy -O ihex -R .eeprom build_extruder/EC-ecv22-v2.8.elf build_extruder/EC-ecv22-v2.8.hex
scons: done building targets.
All looks OK!
Then i flash with: "scons -f SConstruct.extruder port=/dev/NAME_OF_YOUR_SERIAL_DEVICE upload"
avrdude: error reading system wide configuration file "/usr/local/etc/avrdude.conf"
OK, i can handle that, i copy the avrdude.conf from "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/" to "/usr/local/etc/"
I had to make the etc library by doing a "sudo mkdir etc" because it didn“t even existed.
Then running "scons -f SConstruct.extruder port=/dev/NAME_OF_YOUR_SERIAL_DEVICE upload" gives me this:
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
/usr/local/avr/bin/avrdude -V -patmega168 -P /dev/tty.usbserial-A4007N9o -c stk500v1 -b 19200 -U flash:w:build_extruder/EC-ecv22-v2.8.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e9406
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "build_extruder/EC-ecv22-v2.8.hex"
avrdude: input file build_extruder/EC-ecv22-v2.8.hex auto detected as Intel Hex
avrdude: writing flash (13898 bytes):
Writing | ################################################## | 100% 9.10s
avrdude: 13898 bytes of flash written
avrdude: safemode: Fuses OK
avrdude done. Thank you.
scons: done building targets.
It flashes perfectly, but the Extruder controller does not work at all!
Flashing the EC from within ReplicatorG works perfectly, flashing from terminal results in a dead EC and i get the dreaded Toolhead 0: Not found upon connection from ReplicatorG.
Can someone point me in the right direction, what am I doing wrong ?
Regards, Per.