Welcome! Log In Create A New Profile

Advanced

Sprinter porting to Teensy 3.0

Posted by MbaseCNC 
Sprinter porting to Teensy 3.0
March 27, 2013 11:45AM
Hi All,

This is my first post here, and starting my first 3d printer build soon.
I want to get the software and electronics up and running first and far that I want to use my new Teensy 3.0.
I would like to run the Sprinter firmware on this and need to do some porting.
Checking the pins.h file and for reference trying to figure out the pin mapping for the Atmega 168.
I see there a lot of defines pointing to pin -1 e.g. #define X_ENABLE_PIN -1
Can somebody perhaps tell me what this -1 pin is supposed to be, it would be of great help to me.
Thanks.

Kind regards,
MbaseCNC
Re: Sprinter porting to Teensy 3.0
March 28, 2013 06:39AM
-1 probably means "disabled".

Teacup Firmware works on the Teensy 3.0 already, now also with look-ahead (see its config.h).


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Sprinter porting to Teensy 3.0
March 28, 2013 11:37AM
Thanks Traumflug for your answer.

I don't want to question your authority regarding the Teacup firmware but everywhere I look in the Config.h and other.h files only support for Teensy 2.0 is mentioned.
Can you shed a light on how to move foreward with Teacup and the Teensy 3.0.
Much appreciated.

Kind regards,

MbaseCNC
Re: Sprinter porting to Teensy 3.0
March 28, 2013 08:00PM
I believe Teacup runs on Teensy 2.0, AVR chip. Teensy 3.0 is Kinetis ARM Cortex M4. DaveX is working on Teacup port for that [forums.reprap.org]
Re: Sprinter porting to Teensy 3.0
April 14, 2013 12:49AM
I've got my Teensy 3.0 port in the teensy3 branch in Traumflug's github for Teacup: [github.com]

Edited 1 time(s). Last edit at 04/14/2013 12:50AM by DaveX.
Re: Sprinter porting to Teensy 3.0
April 14, 2013 07:07AM
That's excellent, DaveX!


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Sprinter porting to Teensy 3.0
April 14, 2013 12:15PM
Thats verry nice DaveX!!

Do you think it would be a lot of work making it compattible with the Arduino IDE?
Nevertheless, I'll give it a try next weekend.
If anyone needs help, don't hesitate to ask, I would like to contribute to this.

Kind regards,
MbaseCNC
Re: Sprinter porting to Teensy 3.0
April 14, 2013 01:37PM
MbaseCNC Wrote:
-------------------------------------------------------
> Thats verry nice DaveX!!
>
> Do you think it would be a lot of work making it
> compattible with the Arduino IDE?

I had a look into this in order to add support for Arduino Due and LPC1114 for Gen7-ARM. I did ask for ideas on the Arduino forums and didn't get any working answers.

One problem is that the Arduino IDE simply compiles all files it finds in the sketch folder (and ignores any subfolders). So you have to put all files for all platforms in the sketch folder, and selectively compile them with some more or less messy use of #ifdefs. Perhaps the least messy it to put an #ifdef in each platform specific file. e.g

Quote
due_stuff.c

#include "config.h"

#ifdef TARGET_DUE

// all of the target specific C code

#endif

That at least allows compilation for Arduino AVR/Due from the IDE. If you have an ARM platform that is not SAM3X8E, then you need to reproduce some or all of the hardware/arduino/sam folder appropriate for the new platform. The configuration files are not well documented, and if you get it wrong causes the IDE to crash, so I didn't get far with that.

The word from Arduino team is that they are quite happy for people to create new hardware/xxxx configurations, but they will never be officially supported. That is fair enough, but causes maintenance headache when Arduino change things between versions.

Personally I would never use the Arduino IDE, so I would use the command line/makefile build route anyway. I realise the command line may not be very friendly for casual users, but the Arduino IDE is quite primitive, so we are kinda stuck with it, in the absence of free/open alternatives.

Edited 2 time(s). Last edit at 04/14/2013 01:45PM by bobc.
Re: Sprinter porting to Teensy 3.0
April 14, 2013 03:24PM
I did manage to make the Teensy port from DaveX working before Teacup changed ownership to Traumflug, after that the port was gone from Github.
I'm glad it is back smiling smiley
I managed to get it compiling and uploading through the Arduino IDE but had to remove all instances regarding the heaters
After compiling and uploading I tried to get the communication running with Teacup with no success.
Also I was unable to get serial comm's through Putty.
Later I thought perhaps communication is only possible through the rx/tx port but haven't looked into this.
Any ideas about the tx/rx port for comm's or should it have worked through Teensy's USB port?
Re: Sprinter porting to Teensy 3.0
April 15, 2013 01:36AM
MbaseCNC Wrote:
-------------------------------------------------------
> I did manage to make the Teensy port from DaveX
> working before Teacup changed ownership to
> Traumflug, after that the port was gone from
> Github.
> I'm glad it is back smiling smiley
> I managed to get it compiling and uploading
> through the Arduino IDE but had to remove all
> instances regarding the heaters
> After compiling and uploading I tried to get the
> communication running with Teacup with no
> success.
> Also I was unable to get serial comm's through
> Putty.
> Later I thought perhaps communication is only
> possible through the rx/tx port but haven't looked
> into this.
> Any ideas about the tx/rx port for comm's or
> should it have worked through Teensy's USB port?

The Teensy 3.0 is compiling and communicating through the USB port. It is still very experimental, since I still haven't tested it with a printer, but it responds to G01 and M114 commands appropriately. I compile for teensy3 on my Mac using the Makefile [github.com] with make -f Makefile-teensy3.

I don't know how the IDE links/compiles in the system files, but for USB, maybe the hardware/teensy/cores/teensy3/usb_serial.c conflicts somehow with usb_serial_t3.c ?
Re: Sprinter porting to Teensy 3.0
April 15, 2013 05:10AM
Quote

hardware/teensy/cores/teensy3/usb_serial.c

Does that mean there's a Teensy support package for the Arduino IDE? Wasn't aware of one.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
VDX
Re: Sprinter porting to Teensy 3.0
April 15, 2013 05:37AM
... if not officially - some time ago I've reprogrammed the firmware of a teensy++ with GPS-support in the Arduino-IDE - can check, if it's working with the actual package and give you the files ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Sprinter porting to Teensy 3.0
April 15, 2013 11:57AM
Hi all,

Yes there is a support package for the Teensy's, it's called Teensyduino.
You can find it at [www.pjrc.com]
Re: Sprinter porting to Teensy 3.0
April 15, 2013 12:07PM
What I'm looking for is a good idea on how to deal with the tool for uploading the firmware to Cortex-M0 MCUs. Many Cortex-M0 come with a serial bootloader, similar to the one in ATmegas. The tool coming with the Arduino IDE unfortunately doesn't support these chips, not even with additional parameters.

So, the choice seems to be either including it with Teacup - excluding uploading via Arduino, or including it with the Gen7 support package. The latter requires at least 3 native compiles for Linux, Windows, Mac; Not exactly trivial to make on a single build machine.

Perhaps the Teensy people have found the golden deal already smiling smiley


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Sprinter porting to Teensy 3.0
April 15, 2013 12:17PM
Thanks, MbaseCNC. Missed your comment before writing mine. They have an "Installer" for Linux ... highly unusual on this platform, a plain executable. This would be exactly the way one would open a trojan the door or mess up a running system, so I somewhat hesitant to execute this executable. Who knows wether their idea of a proper Linux installation fits mine?


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Sprinter porting to Teensy 3.0
April 15, 2013 01:31PM
I know what you mean, you don't want to mess up a perfectly running system.
Running Teensy with the Arduino system isn't that important.
Re: Sprinter porting to Teensy 3.0
April 15, 2013 04:54PM
I ran the installer anyways, without root access it can't mess up that much. The installer asks for the folder of the Arduino IDE installation and as far as I can see, installs nothing outside of this. A number of binaries go to -arduino-/hardware/tools, boards.txt & co. to -arduino-/hardware and a number of sample applications to -arduino-/examples. More libraries are optional.

So, as they use host dependend binaries, they apparently didn't find a golden solution either. Their boards.txt is remarkable exhaustive. Much longer entries than usual. Looks like one can put quite a few usable items there.

Edit: one of the paths was wrong.

Edited 1 time(s). Last edit at 04/15/2013 04:55PM by Traumflug.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Sprinter porting to Teensy 3.0
April 15, 2013 04:58PM
Oh, and they apparently install arm-gcc from Arduino 1.5.x into 1.0.4, too.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Sprinter porting to Teensy 3.0
April 21, 2013 05:48AM
Just wanted to let you all know, the Teacup port to Teensy 3 is compiling and communicating fine.
I haven't connected it to hardware yet, will work on that next weekend when I receive my stepper motors.
It looks promising though and can't wait to connect some hardware.

MbaseCNC
Sorry, only registered users may post in this forum.

Click here to login