Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: [Teensy 4.1/PlatformIO] TEENSY_OPT_FASTEST_LTO build flags breaks USB serial function

  1. #1
    Junior Member
    Join Date
    May 2020
    Location
    Tokyo, Japan
    Posts
    2

    [Teensy 4.1/PlatformIO] TEENSY_OPT_FASTEST_LTO build flags breaks USB serial function

    Using minimum platform project with -D TEENSY_OPT_FASTEST_LTO build flags breaks USB serial functionality.

    [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/lates...ms/teensy.html

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,271
    Indeed, Using LTO with the 1062 seems to have issues.

    Was observed in Beta that what worked on 3.x's was not making usable builds for the 4.x's.

    Resolution to date has been to avoid doing LTO builds.

  3. #3
    Senior Member BriComp's Avatar
    Join Date
    Apr 2014
    Location
    Cheltenham, UK
    Posts
    464
    Resolution to date has been to avoid doing LTO builds.
    Where is that documented?

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,271
    Quote Originally Posted by BriComp View Post
    Where is that documented?
    As noted, Beta - and since like above post #2 ... it hasn't shown up much for being tried so not made much of an issue with all else ongoing ...

    Not sure PJRC every officially addressed it - indeed LTO build option still present, but as p#1 reports it generally if not always fails AFAIK

  5. #5
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,421
    Normally, nothing is wrong with LTO. It works good.
    But LTO will produces crashes earlier if there are existing issues or bugs in the software - it just makes makes them more visible. Its not a fault of LTO.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •