Skip to content

Manage the Teensy ARM boards

The Teensy ARM platform includes the Teensy 3.0, 3.1, 3.2, LC, 3.5, 3.6, 4.0 and 4.1 boards.

Install

To install the Teensy ARM boards,

  • Ensure the Arduino tools, CLI or IDE, are installed.

  • Ensure the arduino-cli.yaml configuration file for Arduino-CLI or the Additional boards manager URLs for Arduino IDE includes

https://www.pjrc.com/teensy/package_teensy_index.json
  • Open a Terminal window.

  • Run

$
arduino-cli core install teensy:avr

Although labelled avr, the teensy:avr core package manages the Teensy boards running on ARM Cortex-M.

Utilities

The TyTools collection of tools includes GUI utilities to upload, reset and manage the serial console of the Teensy boards. The command line tool appears to be more stable than the default Teensy utility.

$
$
$
$
$
$
$
git clone https://github.com/Koromix/tytools
cd tytools
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..
make
sudo make install

For more information on the TyTools,

  • Please refer to the TyTools page.

To use the TyTools instead of the default Teensy utilities,

  • Edit and add to the main Makefile.
UPLOADER = tytools

Develop

The Teensy board package includes all the libraries.

Use the libraries for SD

  • Edit the main Makefile to list the required libraries.
APP_LIBS_LIST = SPI SD SdFat

The board package includes the SD libraries : they use the SDIO protocol and are called with APP_LIBS_LIST.

The user’s libraries folder called with USER_LIBS_LIST may contain other SD libraries, which are not compatible with the Teensy boards as they rely on the SPI protocol.

Upload to Teensy boards

The Teensy boards based on an ARM MCU require a specific procedure. The procedure applies to the Teensy 3.0, 3.1, 3.2, 3.5 and 3.6 boards.

Proceed as follow:

  • Disconnect all the SPI devices as programming is done through the SPI pins.

  • Plug the Teensy board.

  • Launch any of the targets All, Upload or Fast.

During the first upload, a new window asks you to press on the button on the board to start the process.

  • Press the button on the Teensy board.

A final message confirms the end of the operation.

The following uploads no longer require this manual operation.

Manage error messages

In case the wrong board has been selected, the uploader displays an error message.

  • Click OK, select the correct board following the procedure Change the board and start again.

The uploader may display another error message.

  • Check and edit the code accordingly.

  • Click OK and start again.

Use raw HID

The Teensy boards offer a raw HID mode, with a specific driver for Serial over HID.

To configure the project for raw HID,

  • Open the main Makefile.

  • Set the variable TEENSY_USB to the desired USB_RAWHID type.

# Teensy USB options (default)
# ----------------------------------
TEENSY_USB = USB_RAWHID
  • Ensure NO_SERIAL_CONSOLE is set to true to prevent the serial console from starting automatically.
# Serial console for Fast target
# ----------------------------------
# For Fast target, open serial console, false or true
NO_SERIAL_CONSOLE = true

Once the program has been uploaded to the Teensy board,

  • Open a first Terminal window.

  • Launch the teensy_gateway utility with /Applications/Teensyduino.app/Contents/Java/hardware/tools/teensy_gateway, assuming the Teensyduino application in under the /Applications folder.

  • Open a second Terminal window.

  • Launch telnet 127.0.0.1 28541, or nc 127.0.0.1 28541 if telnet isn’t available,

  • Open a third Terminal window.

  • Launch the rawhid_test utility with /Users/ReiVilo/Downloads/rawhid_test, assuming the rawhid_test application in under the /Users/ReiVilo/Downloads/ folder.

To stop,

  • Press Ctrl+C on the Terminal window where teensy_gateway is running.

For more information on raw HID,