Suggestion: Teensyduino Linux ARM download package

N0BOX

Active member
First, please let me know if my Google-fu is weak and I've just totally missed where I can download this if it already exists, but...

I actually spend a lot of time working on a computer that uses an ARMv7 processor, and I would love to be able to compile code for Teensy without having to hop between this tiny computer and my x86 desktop. I know that you can't possibly have much of a target audience trying to write and compile code on an ARM-based computer, but I think that if you made something like this available, it would likely be used by people who want to write code using their Raspberry Pi, Beaglebone, Arndale, or ODROID dev boards (I use an ODROID-X2 -- Samsung Exynos 4412 SoC w/quad-core ARM Cortex-A9 CPU running at 1.7GHz -- running either Ubuntu or Arch Linux ARM in place of my Windows desktop whenever possible).

If there is no interest in creating a Linux ARM install package, is there anywhere that one could get hold of the source code for all the "stuff" that is added to the Arduino IDE in order to support the Teensys? I would be happy to take the source code for each individual add-on to the Arduino IDE needed to support the Teensy, compiling it all manually, and adding each bit by hand. I just don't know where to find out what parts are needed (other than the teensy_loader_cli, which compiled fine on my ODROID-X2).

Thanks,
Matt
 
I've read here that not only is the audience wanting to develop for Teensy using Linux small, the non-X86 RPi audience would be even smaller.
I have RPi that uses my NAS for storage, but still, I would choose to use my "big" computer for development to target the little embedded MCUs.
There is/was X86 Linux support but it seems problematic.
The Apple Mac is supported.
 
I found the github repo for the Teensy core libraries, which gives me everything I need (that I can think of) other than the compiler toolchain. Is there any information out there for how to compile and set up the cross-compile toolchain for the mk20dx??? microcontrollers? I noticed that Paul had made a blog post involving porting some script for compiling a toolchain on an Intel computer. Was that for the Teensy or some other purpose?

I must say, I've never successfully managed to cross-compile anything other than the Linux kernel, so trying to set up the toolchain without a how-tomight be outside of my abilities. Regardless, I would be willing to try if someone could point my towards where I should start.
 
I've once compiled arm-gcc for use with the teensy and it seemed (!) to work. That means that I had a blinking LED, but I'm not even 100% sure if my setup actually used the self-compiled compiler.

That said, I'll give an outline of what I did, because I really don't exactly remember:
  • Get the required binutil sources
  • compile them on the machine you want to use them on (e.g. RPi) - no cross-compiling needed
  • Get the newlib sources
  • Compile newlib using your new compiler

It's not exactly easy, and you'll definitely encounter some problems, but it can be done and the result should be usable. You can find out what flags the teensy arm-gcc was compiled with:
Code:
arduino-1.0.5/hardware/tools/arm-none-eabi/bin> ./arm-none-eabi-gcc -v

Links that should help:
http://www.hermann-uwe.de/blog/buil...-with-binutils-gcc-newlib-and-gdb-from-source
http://kunen.org/uC/gnu_tool.html

Regards

Christoph
 
ARM Linux is not supported.

Yeah, I wouldn't expect anything that I would try to do to be supported. I just wondered if you would mind telling me what toolchain was used and if there is anything other than the toolchain, teensy_loader_cli, and the core libs needed to get a sketch compiled and loaded onto the Teensy 3.1.

BTW, I modified the teensy_lader_cli source to support the Teensy 3.1, compiled it on my ODROID-X2, grabbed the Blink.cpp.hex file from my x86_64 desktop, and got the teensy_loader_cli to upload it to the Teensy 3.1.

The Teensy is now happily blinking away!

I don't have the money to get a laptop, and truthfully, these little quad-core ARM computers outperform most netbooks (they almost have the performance of the low-power Intel Core-i3s!) using Linux. If I can get a sketch compiled and loaded onto the Teensy using this little computer, then I have the ability to do some development while somewhat mobile. For instance, I would like to be able to work on code at the local hackerspace/makespace during their Arduino project nights.

My guess is that I will fail miserably, and I will have to dust off the old (mostly unused) netbook and load up the Arduino and Teensyduino programs, but it would be a fun project to try to make this work on an ARM board. Just think... doing microcontroller development for an ARM Cortex-M4 using an embedded Cortex-A9 processor!

It would put people a step closer to doing their real-world hacking on their phones. :)
 
... but it would be a fun project to try to make this work on an ARM board. Just think... doing microcontroller development for an ARM Cortex-M4 using an embedded Cortex-A9 processor!
A memorable tech event, for me, was being (a passenger) in a car out in the boonies but with good Verizon LTE coverage, and using mbed's on-line compiler with my iPad (WiFi hot spot in my car). Edit, compile on the go.

Just an experiment... then back to enjoying the drive and scenery.
 
I'd be delighted to have an ARM development environment on ARM. It's certainly not something I need, but I'm fascinated by all the interesting dev boards like the MicroZed sitting on my desk, and the others I've read about including the odroids, Bunnie Huang's open laptop, the TV sticks, cheap tablets, etc.
 
MicroZed's price is up in the elite strata along with other gigabyte memory boards.
 
Last edited:
One of the things I was happy to see was the Udoo. I had been trying to get the Arduino IDE to compile on my ODROID board and then a kickstarter campaign starts that is doing something fairly similar to what I was trying to do.

Eventually the Arduino 1.0.1 IDE showed up in the Ubuntu ARM repos. I never could figure out how to get the Arduino IDE to compile on ARM. The "source" package had the binary avr-gcc tools and binary RXTX libs. I tried like crazy to get everything compiled individually, but it never worked.
 
Part of the issue with AVR's is the Arduino toolchain is rather out of date. And unfortunately, older GCC's don't always build with newer GCC's, so you some times have to have a preserved GCC that you use to build the appropriate cross tool. Sometimes, you need to do what is called a Canadian Cross build (where you are building a cross compiler on an x86 that runs on an arm, and then generates AVR code).
 
<grin> Run VNC on the ARM. Connect to the big iron.

One of my biggest issues with booting up my desktop PC is that it raises the temp in my room by up to 5 degrees Farenheit. My PC has an Intel Core i7-3930k (6-core w/HT) with an NVidia GTX470 that runs at the highest clock speed if you have two or more monitors plugged in (even if you are just sitting on the desktop).
 
The I7 should slow down/cool down based on load.
For me (I5 quad), the head comes from the older CFL 24" monitor - Someday I'll get a cooler LED.

But in this room, there are two big heat sources: Wine Refrigerators that are Thermoelectric. I wanna replace both with on compressor wine refrig. My brother has two, and they put out less heat and use a LOT less electricity.
 
My PC has an Intel Core i7-3930k (6-core w/HT) with an NVidia GTX470.....

FWIW, my desktop has this same chip. It's awesome. I leave it on 24/7. But I have a cheap video card, without a fan, since I don't play video games on my PC.

.... Sometimes, you need to do what is called a Canadian Cross build (where you are building a cross compiler on an x86 that runs on an arm, and then generates AVR code).

Canadian cross compiling is pretty much the reason I got that 6 core chip! Since releasing Teensy 3.0 nearly 2 years ago, I haven't had to rebuild the ARM toolchain much, but when I do, that i7-3930k sure is nice. :)

Still, I'm not planning to support development on Linux ARM anytime soon. Of course, that may change if major PC manufacturers start shipping ARM-based laptops or desktops that don't suck for general computing and creative content creation. Until that happens, I'm focusing on many much more important things, like fixing the pin 33 issue and SPI transactions.
 
Canadian cross compiling is pretty much the reason I got that 6 core chip! Since releasing Teensy 3.0 nearly 2 years ago, I haven't had to rebuild the ARM toolchain much, but when I do, that i7-3930k sure is nice. :)

Yep, my work machines are many core power7's/power8's. It is so much easier doing builds on those guys than the 48 megabyte Pentium Pro, I used 10+ years ago. Of course, I build the compiler over and over again, all day. :cool:
 
How do we fix that?

Specifically -- I think I have the gcc part done. I now need help with the runtime/library part.

I don't know what you mean by runtime, but the whole collection of Teensy-specific libraries are on github. You can find them under Paul's full name.

You can also compile the commandline teensyloader from source, which can be found on the pjrc site. You have to add a block of code to handle the new MCU of the Teensy 3.1, which can be a copy of the Teensy 3.0's block with the name and flash size changed. I've gotten the teensyloader working on my ODROID-X2 (a board with the same SoC as the Samsung Galaxy S3), but I had to generate the 'hex' file on my Windows box.

Any chance you could detail how you got the ARM gcc toolchain working for this chip on an armv7 version of Linux?
 
I don't know what you mean by runtime, but the whole collection of Teensy-specific libraries are on github. You can find them under Paul's full name.

I'l go have a look. What I need are "start-up" files that do things like initialize interrupt vector tables, and linker control scripts that load everything in the right place.
Also, I don't know how much (if any) of that comes from some other third party, such as Due, or Maple, or whether it's all self contained?

Any chance you could detail how you got the ARM gcc toolchain working for this chip on an armv7 version of Linux?

Raspberry Pi is actually ARMv6 with an FPU. Quite the bizarro combo :)
However, the details are largely available on github:
https://github.com/jwatte/teensy-canadian
Note that what I did was use a x64 machine to build a compiler targeting cortex-m4 but hosted on armv6-vfp.
 
I don't know what you mean by runtime, but the whole collection of Teensy-specific libraries are on github. You can find them under Paul's full name.

I'l go have a look. What I need are "start-up" files that do things like initialize interrupt vector tables, and linker control scripts that load everything in the right place.
Also, I can't find the source for the "teensy_post_compile.exe" executable; I have no idea what that actually does. But it's probably important!

Any chance you could detail how you got the ARM gcc toolchain working for this chip on an armv7 version of Linux?

Raspberry Pi is actually ARMv6 with an FPU. Quite the bizarro combo :)
However, the details are largely available on github:
https://github.com/jwatte/teensy-canadian
Note that what I did was use a x64 machine to build a compiler targeting cortex-m4 but hosted on armv6-vfp.
 
.... the "teensy_post_compile.exe" executable; I have no idea what that actually does. But it's probably important!

All it does is causes the Teensy Loader to open the freshly-created .hex file, and turn on auto mode.

Still, all this recent conversation has me considering building a partial package of stuff for Raspberry Pi. It's been quite a while since I've used RPi.... maybe it's no longer as horribly slow and painful as a remember?
 
It is horribly slow and painful. Which is why I cross-build the compiler (a "Canadian cross" build, which was a right pain!)
Because you built the original Teensy-targeting compiler, do you remember what variants of incantations were needed for the various start-up bits?
Like, how does the code get relocated to the right base address? How does the interrupt vector table get set up? The objcopy calls in the tinyduino tool chain does not do anything special, so I presume this all lives in the specs files?
 
Because you built the original Teensy-targeting compiler, do you remember what variants of incantations were needed for the various start-up bits?

At the time, I wrote a lengthy blog post....

http://dorkbotpdx.org/blog/paul/gnu_toolchain_crosscompile_challenges


Like, how does the code get relocated to the right base address? How does the interrupt vector table get set up? The objcopy calls in the tinyduino tool chain does not do anything special, so I presume this all lives in the specs files?

All this stuff is found in the Teensyduino core library.

https://github.com/PaulStoffregen/cores
 
More recently, I recompiled the ARM Launchpad toolchain for 64 bit Linux, using Ubuntu 8.10 in a virtual machine. I followed the instructions in the PDF and it worked.
 
Back
Top