Teensy: using a beta version of the platform-package

Hi
I am using PlatformIO for a long time and for many of my projects. For the last few years I have been working on a larger project (GitHub - CorBer/teensy_batdetector: Teensy based ultrasound detector (Bat detector)).

We want to change to the latests development core of the Teensy project (1.154-beta7) as that has support for a renewed SD and SDfat libary. In this forum I have seen people asking the same question before and one of the answers was to use

platform_packages =
    framework-arduinoteensy@https://github.com/maxgerhardt/teensy-core-pio-package.git

This for sure can work but only during compile-time. I am using VisualCode with PIO as an extension inside and the great thing of this combination is that you can inspect code until the libraries from the IDE. But when refering to the 1.154.0-beta7 via the github link thats not the case. In fact I see the “default” 1.153.0 library files.

Anybody that has a guess how to do this in a reliable/proper way ? For the moment I have simply overwritten all core/libraries in the framework-arduinoteensy library with the new libraries. That does work but during compilation the system thinks its version 1.153 still.

kind regards
Cor Berrevoets

Can you show how you do that exactly? Full platformio.ini?

[env:teensy36]
platform = teensy
board = teensy36
framework = arduino
lib_deps = milesburton/DallasTemperature@^3.9.1

Yeah so that’s the “standard” way without any version modifications, you’ll be getting the latest PlatformIO has, which is 1.153.

So no other options, I had hoped to use
platform = teensy@1.154.0
but that seems to be not working

The platform versions you are able to reference here are that of platform-teensy (Releases · platformio/platform-teensy · GitHub), as per docs. This is not the version of the Teensy-Arduinocore. That’s a package. The framework-arduinoteensy package. With platform_packages you can “switch out” the source of a package, that’s what my above

instruction does. So if you add that to the platformio.ini (and you have git installed of course), you’ll not be using the standard

version of it but the one contained in the repo, in which I put the 1.54 Beta #7 files.

And that is not working if you add those two lines?

Aah I think I see your problem now.

You probably forgot to refresh the IntelliSense with Ctrl+Shift+P → Rebuild IntelliSense. It should take you to the new version of the files, not the old ones, then.

Hi,

As you can read in my intial question. This only changes the environment at “compile time”, so when I am editing my source and want to see how a library is organized I end up looking at the libraries of 1.153.0 and not those of 1.154.0-beta7. And since some of the libraries have massive changes that is not a safe way of code-development. As stated I am working in VScode with PIO.

thanks for reacting BTW, I had not expected such a fast response.

Our messages crossed in time it seems :slight_smile: I will check your suggestion right now !

And thats a very good answer … after puzzling for more than a day and even crippling the original 1.153 framework.

Thanks for this information, I hope it not only helps me.

Ive marked the answer for future reference, the reason that I had not thought this was necessary is because I have the platform-ide: autorebuild setting ON. This states that when platform.ini is changed or new libraries are added intellisense will be rebuild.
Do I miss something ?

Mhm there might be a time delay between changing the platformio.ini, PlatformIO pulling the new core package, after then it should only rebuild, or it didn’t trigger correctly, no idea :confused: That’s why I always like to refresh with the keyboard shortcut.

Glad it’s working now!

Yeah, the result is what counts and I learned another important option that I can share with others in our project.
Thanks for your time.

@maxgerhardt on my research this thread came up, so i tried to implement teensyduino 1.58beta2 with C++17 and GCC11.3

before i start a new topic i wanted to ask if you kindly could provide an updated platform_package on github with Teensyduino 1.58-beta2 implemented.

i have tried to do myself, but i am getting linker errors when manually implementing

this was my steps:

  1. install arduino 1.8
  2. install teensyduino 1.58beta (as inspired by joepasquariello) → just to get the files
  3. in [.platformio\packages] i create folder [framework-arduinoteensy1158] with files from arduino installation
  4. in [.platformio\packages] i create folder [toolchain-gccarmnoneeabi11.3.rel1] and put the files from armDevelopers gcc11.3rel1
  5. added reworked files package.json and .piopm to the folders
  6. modified platform.ini to use the specific folders and force -std=gnu++17
[env:teensy41]
;platform = https://github.com/platformio/platform-teensy.git
;platform = teensy
board = teensy41
framework = arduino
platform_packages =
	framework-arduinoteensy@file://C:/Users/Admin/.platformio/packages/framework-arduinoteensy1158
	toolchain-gccarmnoneeabi@file://C:/Users/Admin/.platformio/packages/toolchain-gccarmnoneeabi11.3.rel1
lib_compat_mode = strict
lib_ldf_mode = chain+

build_flags =
    -std=gnu++17
	;-fexceptions
build_unflags =
    -std=gnu++14
	;-larm_cortexM7lfsp_math

if it is not possible to create a git source, maybe you could guide me to successfully implement manually?

the exit fault with my setup is this (the outputs with warnings is quite long, so i truncated the output to what i think is the problem):

Linking .pio\build\teensy41\firmware.elf
.pio\build\teensy41\libFrameworkArduino.a(startup.c.o):(.ARM.exidx.startup+0x0): relocation truncated to fit: R_ARM_PREL31 against `.startup'
.pio\build\teensy41\libFrameworkArduino.a(startup.c.o):(.ARM.exidx.startup+0x8): relocation truncated to fit: R_ARM_PREL31 against `.startup'
.pio\build\teensy41\libFrameworkArduino.a(startup.c.o):(.ARM.exidx.startup+0x10): relocation truncated to fit: R_ARM_PREL31 against `.startup'
.pio\build\teensy41\libFrameworkArduino.a(startup.c.o):(.ARM.exidx.flashmem+0x0): relocation truncated to fit: R_ARM_PREL31 against `.flashmem'        
.pio\build\teensy41\libFrameworkArduino.a(startup.c.o):(.ARM.exidx.flashmem+0x8): relocation truncated to fit: R_ARM_PREL31 against `.flashmem'        
.pio\build\teensy41\libFrameworkArduino.a(startup.c.o):(.ARM.exidx.flashmem+0x10): relocation truncated to fit: R_ARM_PREL31 against `.flashmem'       
.pio\build\teensy41\libFrameworkArduino.a(startup.c.o):(.ARM.exidx.flashmem+0x18): relocation truncated to fit: R_ARM_PREL31 against `.flashmem'       
.pio\build\teensy41\libFrameworkArduino.a(startup.c.o):(.ARM.exidx.flashmem+0x20): relocation truncated to fit: R_ARM_PREL31 against `.flashmem'       
.pio\build\teensy41\libFrameworkArduino.a(startup.c.o):(.ARM.exidx.flashmem+0x28): relocation truncated to fit: R_ARM_PREL31 against `.flashmem'       
.pio\build\teensy41\libFrameworkArduino.a(analog.c.o):(.ARM.exidx.flashmem+0x0): relocation truncated to fit: R_ARM_PREL31 against `.flashmem'
.pio\build\teensy41\libFrameworkArduino.a(tempmon.c.o):(.ARM.exidx.flashmem+0x0): additional relocation overflows omitted from the output
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\teensy41\firmware.elf] Error 1
============================================================= [FAILED] Took 54.29 seconds =============================================================
 *  Der Terminalprozess "C:\Users\Admin\.platformio\penv\Scripts\platformio.exe 'run'" wurde mit folgendem Exitcode beendet: 1. 
 *  Das Terminal wird von Aufgaben wiederverwendet, drücken Sie zum Schließen eine beliebige Taste.

any helpf is apreciated, thank you in advance

For completeness: i started my journey on Teensy Forum #post314441

the story behind ist that i want to use struct_mapping library in my project wich require c++17

Hi,

You can (I even did not know this thusfar) easily adapt to the latest stable release of Teensyduino by using:

platform = teensy@4.13.0

#recent teensyduino environments
# 1.157 = teensy@4.17.0
# 1.156 =       @4.16.0
# 1.155 =       @4.14.0
# 1.154 =       @4.13.0

cheers
Cor

Hi CorBer,
thank you for your reply, i know that this is possible, actually i use

platform = https://github.com/platformio/platform-teensy.git

to get the up2date version of teensy which is 1.57 right now, but i need to use 1.58beta2. this version is not in the official platformio git-repo, therefore its imho not possible to do like you suggested.

actually it must be the same issue when you had to implement 1.54beta7 isn’t it? @maxgerhardt provided a source on github with the implementation of 1.54beta7 for you… am i wrong?

Can you execute pio package pack <path to folder> for both these packages and upload them somewhere?

Hi, i have uploaded here

remember, the versioning happend on my behalf, so please check “package.json” and “.piopm” files.

Also maybe you want to check out discussion on github where PaulStoffregen gave me some more infos.

i checked the files as he mentioned and they are correct imho.
i also copied "

larm_cortexM7lfsp_math.a

into [toolchain-gccarmnoneeabi11.3.rel1] as it throws missing library error

i am actually able to build and upload with the following platform.ini

[env:teensy41]
;platform = https://github.com/platformio/platform-teensy.git
platform = teensy
board = teensy41
framework = arduino
platform_packages =
	framework-arduinoteensy@file://C:/Users/Admin/.platformio/packages/framework-arduinoteensy1158
	toolchain-gccarmnoneeabi@file://C:/Users/Admin/.platformio/packages/toolchain-gccarmnoneeabi11.3.rel1
lib_compat_mode = strict
lib_ldf_mode = chain+

build_flags =
    -std=gnu++17
	;-fexceptions
build_unflags =
    -std=gnu++14
	;-larm_cortexM7lfsp_math

as soon as i activate

-fexceptions

it throws linker error

br

The reason why I just changed to using
platform = teensy@4.13.0 is that it gives me full control over the version of teensyduino I am using (or testing). When I distribute code to others that might have another teensyduino environment this comes in rather handy. But its not going to help you out as it only links to stable releases.

cheers
Cor