Controlling which files (i.e. lib\cores\teensyX) is used for compiling

Hi All,
Any help/tips or pointers to prior threads would be appreciated!
I am using the Teensy platform 3.6 (but use several Teensy versions) , which creates C:\Users\me.platformio\packages\framework-arduinoteensy\cores\teensy3.
I would like to use the “cores files” from my Git Repo, not from the packages directory. There are two primary reasons:

  1. not to loose changes made to some cores files due to “platform” updates.
  2. to “freeze” the cores files to eliminate possible bugs due to “platform” updates.

use files from:
don’t use file from:


Freezing versions can be done by using

platform = teensy@<some version>

with versions from This freezes platform code, framework code, upload logic code, compiler versions, etc.

If you want to make it easy, backup the entire C:\Users\me\.platformio\packages\framework-arduinoteensy\ foldler then reference it using

platform_packages =

Thanks for the fast and concise response Max! I’ll give it a go right now. :slight_smile:

Hi Max,
I copied the C:\Users\Steve\.platformio\packages\framework-arduinoteensy folder to C:\Github\Project1\
Added the following to platformio.ini:
platform_packages = framework-arduinoteensy@symlink://C:\Github\Project1\framework-arduinoteensy, but get some errors when compiling (see below). It might be related to the use of a symlink???, due to the error… TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

Processing teensy36 (platform: teensy; board: teensy36; framework: arduino)
Tool Manager: Installing symlink://C:\Github\Project1\framework-arduinoteensy\
Tool Manager: framework-arduinoteensy@1.157.220801 has been installed!
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: Teensy (4.17.0) > Teensy 3.6
HARDWARE: MK66FX1M0 180MHz, 256KB RAM, 1MB Flash
DEBUG: Current (jlink) External (jlink)
 - tool-teensy @ 1.157.0 (1.57)
 - toolchain-gccarmnoneeabi @ 1.50401.190816 (5.4.1)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType:
  File "C:\Users\Steve\.platformio\penv\lib\site-packages\platformio\builder\", line 188:
  File "C:\Users\Steve\.platformio\packages\tool-scons\scons-local-4.4.0\SCons\Script\", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\Steve\.platformio\packages\tool-scons\scons-local-4.4.0\SCons\Script\", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Users\Steve\.platformio\platforms\teensy\builder\", line 162:
    target_elf = env.BuildProgram()
  File "C:\Users\Steve\.platformio\packages\tool-scons\scons-local-4.4.0\SCons\", line 737:
    return self.method(*nargs, **kwargs)

Weird how the framework package doesn’t show up at all here. Need to check if that is reproducable.

1 Like

Thanks for checking.

Hi Max,
Did you get a chance to verify that the framework package doesn’t show up?