Using minimum platform project with -D TEENSY_OPT_FASTEST_LTO build flags breaks USB serial functionality.
[src/blink.ino]
[platformio.ini]
Note that
I'm consulting this page but no luck so far.
https://docs.platformio.org/en/latest/platforms/teensy.html
[src/blink.ino]
Code:
static constexpr auto LED = 13;
void setup() {
pinMode(LED, OUTPUT);
}
void loop() {
digitalWrite(LED, HIGH);
delay(1000);
digitalWrite(LED, LOW);
delay(1000);
}
[platformio.ini]
Code:
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
build_flags = -D TEENSY_OPT_FASTEST_LTO
Note that
- TEENSY_OPT_FASTEST (without _LTO) works fine and USB serial exists.
- Adding -D USB_SERIAL has no effect
- Teensy 3.5 works fine with TEENSY_OPT_FASTEST_LTO and do not lose USB serial.
I'm consulting this page but no luck so far.
https://docs.platformio.org/en/latest/platforms/teensy.html