The folks who make PlatformIO do a great job of incorporating new Teensyduino releases in a not unreasonable timeframe. However, the Teensyduino beta releases aren't usually added. This post serves as a guide to add a beta release to your PlatformIO build process.
A prerequisite is that you have Teensyduino installed, either v1.8.19 or via Arduino IDE v2.0.3 (the latest versions as of this writing).
Arduino IDE v2:
There are three main parts:
The first step is to create three directories in some well-known location:
Note: My convention, when describing directories in text, is to append a '/'.
Next, copy the board and core files into your new framework-arduinoteensy/:
Arduino IDE v2: Everything under packages/teensy/hardware/avr/0.58.3/
Arduino IDE v1.8.19 (Mac): Everything under Contents/Java/hardware/teensy/avr/
Next, copy the toolchain into your new toolchain-gccarmnoneeabi/:
Arduino IDE v2: Everything under packages/teensy/tools/teensy-compile/11.3.1-beta2/arm/
Arduino IDE v1.8.19 (Mac): Everything under Contents/Java/hardware/tools/arm/
Next, copy the Teensy tools into your new tool-teensy/:
Arduino IDE v2: Everything under packages/teensy/tools/teensy-tools/0.58.3/
Arduino IDE v1.8.19 (Mac): Everything under Contents/Java/hardware/tools/ except for arm/ and avr/
Second-to-last, create a package.json file so that PlatformIO will recognize these new directories and their contents. To make it easy, just copy the ones from the 1.57 PlatformIO Teensy release and change the internal version numbers. For differentiating the package version, I used the beta release date, 17-Dec-2022 (221217).
framework-arduinoteensy/package.json (Mac): 1.157.220801 → 1.158.221217:
toolchain-gccarmnoneeabi/package.json (Mac): 1.50401.190816 → 1.110301.221217:
tool-teensy/package.json (Mac): 1.157.0 → 1.158.221217:
Last, in your platformio.ini file, set the platform packages to point to those three new directories:
The `file://`scheme is used to point to the absolute paths.
Note: These paths are just for illustration. It's likely you'll use different locations.
You can verify that the correct packages are used by looking at the build output. You should see something like this:
Collected links:
A request: It would be lovely if someone could fill in the details for Windows and Linux systems.
Side note: It's likely these instructions will be obsoleted by newer releases of either the Arduino IDE or Teensyduino if any of the structures or locations change.
Corrections, notes, and updates are welcome.
A prerequisite is that you have Teensyduino installed, either v1.8.19 or via Arduino IDE v2.0.3 (the latest versions as of this writing).
Arduino IDE v2:
- https://www.pjrc.com/arduino-ide-2-0-0-teensy-support/
- All the files you need should be in the Arduino15 folder, described here ("Board platforms and cores" section)
- https://www.pjrc.com/teensy/td_download.html
- The files you need should be inside the application install, here
There are three main parts:
- Core files,
- Toolchain, and
- Tools.
The first step is to create three directories in some well-known location:
- framework-arduinoteensy/
- toolchain-gccarmnoneeabi/
- tool-teensy/
Note: My convention, when describing directories in text, is to append a '/'.
Next, copy the board and core files into your new framework-arduinoteensy/:
Arduino IDE v2: Everything under packages/teensy/hardware/avr/0.58.3/
Arduino IDE v1.8.19 (Mac): Everything under Contents/Java/hardware/teensy/avr/
Next, copy the toolchain into your new toolchain-gccarmnoneeabi/:
Arduino IDE v2: Everything under packages/teensy/tools/teensy-compile/11.3.1-beta2/arm/
Arduino IDE v1.8.19 (Mac): Everything under Contents/Java/hardware/tools/arm/
Next, copy the Teensy tools into your new tool-teensy/:
Arduino IDE v2: Everything under packages/teensy/tools/teensy-tools/0.58.3/
Arduino IDE v1.8.19 (Mac): Everything under Contents/Java/hardware/tools/ except for arm/ and avr/
Second-to-last, create a package.json file so that PlatformIO will recognize these new directories and their contents. To make it easy, just copy the ones from the 1.57 PlatformIO Teensy release and change the internal version numbers. For differentiating the package version, I used the beta release date, 17-Dec-2022 (221217).
framework-arduinoteensy/package.json (Mac): 1.157.220801 → 1.158.221217:
Code:
{
"name": "framework-arduinoteensy",
"version": "1.158.221217",
"description": "Arduino Wiring-based Framework for Teensy boards",
"keywords": [
"framework",
"arduino",
"teensy"
],
"homepage": "https://www.arduino.cc/reference/en",
"repository": {
"type": "git",
"url": "https://github.com/PaulStoffregen/cores"
}
}
toolchain-gccarmnoneeabi/package.json (Mac): 1.50401.190816 → 1.110301.221217:
Code:
{"name": "toolchain-gccarmnoneeabi", "version": "1.110301.221217", "description": "GNU toolchain for Arm Cortex-M and Cortex-R processors", "keywords": ["toolchain", "build tools", "compiler", "assembler", "linker", "preprocessor", "arm"], "homepage": "https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm", "license": "GPL-2.0-or-later", "system": ["darwin_x86_64", "darwin_arm64"], "repository": {"type": "git", "url": "https://gcc.gnu.org/git/gcc.git"}}
tool-teensy/package.json (Mac): 1.157.0 → 1.158.221217:
Code:
{
"description": "Upload tools for Teensy boards",
"homepage": "https://www.pjrc.com/teensy/loader.html",
"keywords": [
"tools",
"uploader",
"teensy"
],
"name": "tool-teensy",
"system": [
"darwin_x86_64",
"darwin_arm64"
],
"version": "1.158.221217"
}
Last, in your platformio.ini file, set the platform packages to point to those three new directories:
Code:
platform_packages =
toolchain-gccarmnoneeabi@file:///Users/me/pio/teensy_1.58-beta3/toolchain-gccarmnoneeabi
framework-arduinoteensy@file:///Users/me/pio/teensy_1.58-beta3/framework-arduinoteensy
tool-teensy@file:///Users/me/pio/teensy_1.58-beta3/tool-teensy
Note: These paths are just for illustration. It's likely you'll use different locations.
You can verify that the correct packages are used by looking at the build output. You should see something like this:
Code:
PACKAGES:
- framework-arduinoteensy @ 1.158.221217 (1.58)
- tool-teensy @ 1.158.221217 (1.58)
- toolchain-gccarmnoneeabi @ 1.110301.221217 (11.3.1)
Collected links:
- Arduino IDE v2 install
- Arduino IDE v1.8.19 install
- Arduino IDE installation folder
- A useful forum post points to:
A request: It would be lovely if someone could fill in the details for Windows and Linux systems.
Side note: It's likely these instructions will be obsoleted by newer releases of either the Arduino IDE or Teensyduino if any of the structures or locations change.
Corrections, notes, and updates are welcome.