Using Makefiles for Teensy Development on Mac OS
Even if you don’t want to use the Arduino IDE for building your application, or want to do fancy things that only the evil, convoluted syntax of Makefiles can provide, you can do Teensy development on the Mac from the command line. While there are a lot of guides out there on how to do it, I hadn’t seen a complete step-by-step set of instructions.
So with no further ado, here are the steps for building Teensy applications on Mac OS using the Makefiles and the mighty command line.
- Download the Arduino IDE from https://www.arduino.cc/en/main/software and install it.
- Download Teensyduino from https://www.pjrc.com/teensy/td_download.html and install it.
- Download a “basic project template” for Teensy. The original is at https://github.com/apmorton/teensy-template but I’ve been using the fork at https://github.com/a-j-f/teensy-template which has been updated more recently and uses the Teensy CLI Loader for uploading to the device.
- Update the Makefile to set your Teensy model
maketo build, or
make uploadto install on your Teensy
If you’re wanting to monitor the serial console of your Teensy over USB, install a terminal program like CoolTerm. Alternatively, if you use Homebrew or MacPorts you can use a console-based terminal program like minicom. Once the USB connector is plugged in, your Teensy will show up as something like
/dev/cu.usbmodem45504901. The communications settings will be 115200 baud, 8 bit, no parity, 1 stop bit.