Can't recognize platform.local.txt

honey_the_codewitch

Active member
I'm not 100% sure this is a Teensy issue, but this technique works with my ESP32s


Used platform Version Path
teensy:avr 1.59.0 C:\Users\<redacted>\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0
Command executed successfully.
Compilation completed successfully.
Upload starting...

Everything works, except the platform.local.txt in that directory is not getting honored.

compiler.c.extra_flags=-DHTCW_GFX_NO_SWAP
compiler.cpp.extra_flags=-DHTCW_GFX_NO_SWAP

Those are the contents

I need this file to be honored.
 
What version of arduino are you using? Latest one has command to reload or interpret or like that might help. Sorry not at my computer so don’t remember exact command

Edit: Also, you may want to check that the teensy uses those defines in it's platform.txt...
They are probably different than esp32, which has:
Code:
# These can be overridden in platform.local.txt
compiler.c.extra_flags=
compiler.cpp.extra_flags=
compiler.S.extra_flags=
compiler.c.elf.extra_flags=
compiler.ar.extra_flags=
compiler.objcopy.eep.extra_flags=
compiler.elf2hex.extra_flags=
compiler.libraries.ldflags=
 
Last edited:
Sorry as I tried to imply with the update to first post:
The things you are setting in the platform.local.txt are specific to the ESP32's build, i.e. their
platform.txt

You need to look through the Teensy version and see if there is some corresponding setting you can set or overwrite
that gets your define into the build.

For example: for cpp files the recipe is:
Code:
## Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{build.toolchain}{build.command.g++}" -c {build.flags.optimize} {build.flags.common} {build.flags.dep} {build.flags.cpp} {build.flags.cpu} {build.flags.defs} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DF_CPU={build.fcpu} -D{build.usbtype} -DLAYOUT_{build.keylayout} "-I{build.path}/pch" {includes} "{source_file}" -o "{object_file}"

And I think most of these fill values are defined within boards.txt, like for cpp for T4.1 we have
Code:
teensy41.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdlib
teensy41.build.flags.dep=-MMD
teensy41.build.flags.optimize=-Os
teensy41.build.flags.cpu=-mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16
teensy41.build.flags.defs=-D__IMXRT1062__ -DTEENSYDUINO=160
teensy41.build.flags.cpp=-std=gnu++17 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -Wno-psabi

And you can see in the extract from the platform.txt: where it uses the defines like:
build.flags.common

Sorry, I don't see any unused ones that Paul put into the platform.txt... But you can probably find some way to hack it...
 
Yeah I've already tried the first two of the three below (from the link) and they didn't work.

Code:
# These can be overridden in platform.local.txt
compiler.c.extra_flags=
compiler.cpp.extra_flags=
compiler.S.extra_flags=
 
They won’t work unless you also modify platform.txt per the instructions in that link.
 
Back
Top