How to flash the firmware on a Teensy micro-controller

Here’s a quick guide for programming the firmware on a device using a Teensy micro-controller.

Things you will need:

  1. A known working usb-micro-b data cable. If you have a plain “charging cable” that comes with some devices, it will not work
  2. A Teensy board or device using a Teensy ( a 16n faderbank perhaps?)
  3. A firmware HEX file or the Full Source Code that you want to flash.

References: PJRC (the makers of Teensy) have a tutorial on their website on how to get up and running. Maybe you should go read that page right now. Yeah? good… I’ll wait.

(Yeah- you did’t go read all that, did you? :frowning_face: ) OK then - I’ll summarize.

loading a HEX file

If you just want to load a HEX file to the Teensy, you just need the Teensy Loader application and your HEX file. Get Teensy Loader

  • step 1: connect your teensy to your computer with a known working USB-Micro-B to USB-A data cable.

  • step 2: launch teensy loader

  • step 3: Drop the HEX file onto Teensy Loader

  • step 4: Push the button on the Teensy and Teensy Loader should send the program to the Teensy.

  • troubleshooting - if this doesn’t work, see the Teensy Loader link and follow the instructions for your operating system. RTFM!

how about compiling the firmware myself?

In this case maybe you’ve written your own program or made changes to some existing code and you need to compile it and send it to the teensy,

  • step 0: connect your teensy to your computer with a known working USB-Micro-B to USB-A data cable (you should have already done this above)

  • step 1: download and install Arduino 1.8.8 (the most recent version at the time of this post).
    a) “but I already have the arduino application installed from a couple years ago!” Don’t care! - get the most recent version.

  • step 2: download and install Teensyduino 1.45
    a) again - reinstall even if you think you don’t need to.

  • step 3: launch Ardunio

  • step 4: in the Arduino TOOLS menu set some preferences. In many cases it will be these options, but will depend on the project and the specific board being used.
    a) Tools->USB Type= Serial, MIDI or Serial+MIDI
    b) Tools->Board = Teensy 3.1/3.2 or Teensy 3.6
    c) Tools->CPU Speed = 120mhz (overclock) specific to teensy 3.2

  • step 5: open a program you want to compile

  • step 6: click the “Verify” button to compile and check for errors
    a) errors will show up in red in the bottom half of the window

  • step 7: click the “Upload” button to flash the firmware to the Teensy.
    a) at this point the Teensy Loader application should launch and send the program to the Teensy.
    b) in some cases, there may be an issue and you’ll need to push the little button on the Teensy itself to get the program process going.

Got Problems? Yeah me too… but sorry, your problems are beyond the scope of this lesson. :stuck_out_tongue_winking_eye:

18 Likes

ohhhhhhhhhhhhhhhhhhh! THANK YOU. Last night I was like “am I stupid? what am I doing wrong???”

Thank you thank you thank you @okyeron!

I just set up a cli workflow for a teensy 3.6 and the euroshield that just came in the mail today – just thought I’d write up the process for myself so it wouldn’t take a few hours the next time I do it but maybe useful for anyone else doing teensy stuff and who hates the arduino IDE?

http://blog.hecanjog.com/euroshield-1-with-teensy-36-and-cli-builds-on-arch-linux.html

This seemed like the most appropriate topic!

2 Likes

I just setup the same workflow on another computer and I’m noticing the teensyduino GUI pops up every time I run a build with arduino-builder. Anyone else have a similar cli workflow and run into this? Odd!

Since this threat popped up just now, I might just want to mention that all macOs users might want to hold their horses when the new OS upgrade is shipping in a few weeks time as the Teensy Loader is 32bit and will, therefore, not be compatible with the upgraded system any more.

I just did a system check and, unfortunately, the Teensy Loader was one of the very few applications on my system which is not 64bit yet.

Not sure if there will be an update for this app any time soon…but for anyone needing to use this bit of software, that might be a concern worth considering. I thought.

Teensy Loader will pop up when you compile in Arduino. I believe this is normal. But I don’t do anything from CLI so can’t really say

Yeah what was odd to me is I’m not compiling with the IDE, I’m using arduino-builder. I have done lots of builds on another laptop with the same setup and the GUI never popped up so it was surprising! Wondering what the difference is when I’m doing builds on this other machine.

Edit: It’s not a big deal but it is a teensy bit annoying. (ha!)