Programming Teensylu/Printrboard from Linux

I have been testing these two boards as a posible replacement for RAMPS in my 3D printers. Nothing wrong with RAMPS, but these two boards are simpler, cheaper and smaller. But they share a problem: they are not easy to program from Arduino IDE.

After a long dance I was able to do in Windows, and I am almost positive same can be done in Linux, but I am kind of tired of trying out things.

The bottom line is that because these boards are based on ATMega1286 they lack of a USB-to-serial chip as many Arduino boards do (except Leonardo).  So that means the usual bootloader and protocol are not a choice here.

Long ago, Paul Stoffregen developed an Arduino-like board using similar chips and built all the required add-ons so they could be programmed from Arduino IDE. These tools can be adapted to be used in the AT90USB1286-based boards with LUFA CDC bootloader and they work ok in Windows (once you manage to get every detail just right).

I was not so lucky in Linux and after some small research I realized that avrdude was used in Windows and that protocol involved was avr109.

So, mostly as I reminder to myself, I am using this line of code for uploading compiled code to my Teensylu board in Linux:

sudo ./avrdude -p at90usb1286 -c avr109 -P /dev/ttyACM0 -C ./avrdude.conf -U flash:w:Marlin.cpp.hex

I am using averdude version that comes with Arduino 1.0.5, not sure if it does matter or not.

Comments

FLee said…
I've run into problems following your steps, but hopefully this will clear some things up for people.

I was compiling successfully under Teensy2.0++. However, the PJRC uploader wanted me to hit the reboot button for some reason... so I couldn't upload. (I couldn't get avrdude to work either)

So I decided to try PrintrBot's old instructions... When I got the boards.txt (http://blog.lincomatic.com/wp-content/uploads/2012/03/at90usb1286txt.zip) recommended by the PrintrBot firmware instructions (http://printrbot.com/wp-content/uploads/2012/04/Printrbot-Firmware.pdf) I couldn't get it to compile, but it saw the correct serial port (ttyACM0). It said that it was missing Arduino.h (WHAT???) and some other header file.

I then opened up the boards.txt file under the teensy directory, and found that:

cdcteensylu.build.core=at90usb1286

is incorrect. It should be:

cdcteensylu.build.core=teensy

After that, it says that it uploaded. Whether or not it actually did, I'll find out soon enough with (or without) a calibration square.

Unfortunately as of this writing, I still cannot get the avrdude command to work with my Printrbot RevE board. :(
misan said…
I remind the process of getting it to work as an obstacle race. I think I had it to work without the change you suggest but I think I have done that change later. The problem is the system I did it with is no longer available for me to double check.

Popular posts from this blog

VFD control with Arduino using RS485 link

How to get sinusoidal s-curve for a stepper motor

Stepper motor step signal timing calculation