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

Thread: problem compiling teensy 4.0 with platformio

  1. #1
    Junior Member
    Join Date
    Jul 2020
    Location
    germany, NRW
    Posts
    6

    problem compiling teensy 4.0 with platformio

    i have just tested teensy 4.0 by using platformio with this demo :

    https://github.com/PaulStoffregen/Au...ndCpuUsage.ino

    This produces a lot of errors. While compiling under teensy 3.1 (changed platform.ini) there are no errors

    Thanks in advance for help

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    8,464
    Maybe someone who uses PlatformIO can help here.

    I tried building it with Arduino 1.8.13 with latest released Teensyduino and it built fine for T4.1.

    You might check to make sure your versions of PlatformIO and things that it uses for Teensy are up to date.

    Hopefully that will take care of it, else, hopefully someone else will offer up some suggestions.

  3. #3
    Junior Member
    Join Date
    Jul 2020
    Location
    germany, NRW
    Posts
    6
    compiling for T4.0 with newest Arduino IDE works for me too, but not with platoformio

  4. #4
    Junior Member
    Join Date
    Jul 2020
    Location
    germany, NRW
    Posts
    6
    and all Platformio updates are done...

  5. #5
    Member
    Join Date
    Apr 2020
    Location
    Germany, NRW
    Posts
    86
    Try to add:

    #include <Arduino.h>

    as the first include in main.cpp.

    If this does not help, post your platformio.ini of the project and the errors.

  6. #6
    Junior Member
    Join Date
    Jul 2020
    Location
    germany, NRW
    Posts
    6
    already tested with #include <Arduino.h>

    here are the errors:


    Code:
    Processing teensy40 (platform: teensy; board: teensy40; framework: arduino)
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
    CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy40.html
    PLATFORM: Teensy 4.10.0 > Teensy 4.0
    HARDWARE: IMXRT1062 600MHz, 512KB RAM, 1.94MB Flash
    DEBUG: Current (jlink) External (jlink)
    PACKAGES:
     - framework-arduinoteensy 1.153.0 (1.53)
     - toolchain-gccarmnoneeabi 1.50401.190816 (5.4.1)
    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 120 compatible libraries
    Scanning dependencies...
    Dependency Graph
    |-- <Audio> 1.3
    |   |-- <SerialFlash> 0.0.0-alpha+sha.2b86eb1e43
    |   |   |-- <SPI> 1.0
    |   |-- <SPI> 1.0
    |   |-- <Wire> 1.0
    |   |-- <SD> 1.2.2
    |   |   |-- <SPI> 1.0
    |-- <SD> 1.2.2
    |   |-- <SPI> 1.0
    |-- <SerialFlash> 0.0.0-alpha+sha.2b86eb1e43
    |   |-- <SPI> 1.0
    |-- <SPI> 1.0
    |-- <Wire> 1.0
    Building in release mode
    Compiling .pio\build\teensy40\src\main.cpp.o
    Compiling .pio\build\teensy40\libc3f\SPI\SPI.cpp.o
    Compiling .pio\build\teensy40\libd0f\SerialFlash\SerialFlashChip.cpp.o
    Compiling .pio\build\teensy40\libd0f\SerialFlash\SerialFlashDirectory.cpp.o
    Compiling .pio\build\teensy40\libd90\Wire\Wire.cpp.o
    Compiling .pio\build\teensy40\libd90\Wire\WireIMXRT.cpp.o
    Compiling .pio\build\teensy40\libd90\Wire\WireKinetis.cpp.o
    Compiling .pio\build\teensy40\libd90\Wire\utility\twi.c.o
    Compiling .pio\build\teensy40\lib69b\SD\File.cpp.o
    Compiling .pio\build\teensy40\lib69b\SD\SD.cpp.o
    Compiling .pio\build\teensy40\lib69b\SD\cache_t3.cpp.o
    Compiling .pio\build\teensy40\lib69b\SD\card_t3.cpp.o
    Compiling .pio\build\teensy40\lib69b\SD\dir_t3.cpp.o
    Compiling .pio\build\teensy40\lib69b\SD\fat_t3.cpp.o
    Compiling .pio\build\teensy40\lib69b\SD\file_t3.cpp.o
    In file included from .pio\libdeps\teensy40\Audio/effect_envelope.h:31:0,
                     from .pio\libdeps\teensy40\Audio/Audio.h:78,
                     from src\main.cpp:17:
    .pio\libdeps\teensy40\Audio/utility/dspinst.h: In function 'int32_t signed_saturate_rshift(int32_t, int, int)':
    .pio\libdeps\teensy40\Audio/utility/dspinst.h:51:1: warning: no return statement in function returning non-void [-Wreturn-type]
     }
     ^
    .pio\libdeps\teensy40\Audio/utility/dspinst.h: In function 'int16_t saturate16(int32_t)':
    .pio\libdeps\teensy40\Audio/utility/dspinst.h:66:1: warning: no return statement in function returning non-void [-Wreturn-type]
     }
     ^
    .pio\libdeps\teensy40\Audio/utility/dspinst.h: In function 'int32_t signed_multiply_32x16b(int32_t, uint32_t)':
    .pio\libdeps\teensy40\Audio/utility/dspinst.h:79:1: warning: no return statement in function returning non-void [-Wreturn-type]
     }
     ^
    .pio\libdeps\teensy40\Audio/utility/dspinst.h: In function 'int32_t signed_multiply_32x16t(int32_t, uint32_t)':
    .pio\libdeps\teensy40\Audio/utility/dspinst.h:92:1: warning: no return statement in function returning non-void [-Wreturn-type]
     }
     ^
    .pio\libdeps\teensy40\Audio/utility/dspinst.h: In function 'int32_t multiply_32x32_rshift32(int32_t, int32_t)':
    .pio\libdeps\teensy40\Audio/utility/dspinst.h:105:1: warning: no return statement in function returning non-void [-Wreturn-type]
     }
     ^
    .pio\libdeps\teensy40\Audio/utility/dspinst.h: In function 'int32_t multiply_32x32_rshift32_rounded(int32_t, int32_t)':
    .pio\libdeps\teensy40\Audio/utility/dspinst.h:118:1: warning: no return statement in function returning non-void [-Wreturn-type]
    Compiling .pio\build\teensy40\lib69b\SD\init_t3.cpp.o
     }
     ^
    In file included from .pio\libdeps\teensy40\Audio/effect_envelope.h:31:0,
    Compiling .pio\build\teensy40\lib69b\SD\utility\NXP_SDHC.cpp.o
                     from .pio\libdeps\teensy40\Audio/Audio.h:78,
    Compiling .pio\build\teensy40\lib69b\SD\utility\Sd2Card.cpp.o
                     from src\main.cpp:17:
    .pio\libdeps\teensy40\Audio/utility/dspinst.h: In function 'int32_t multiply_accumulate_32x32_rshift32_rounded(int32_t, int32_t, int32_t)':
    .pio\libdeps\teensy40\Audio/utility/dspinst.h:131:1: warning: no return statement in function returning non-void [-Wreturn-type]
     }
     ^
    .pio\libdeps\teensy40\Audio/utility/dspinst.h: In function 'int32_t multiply_subtract_32x32_rshift32_rounded(int32_t, int32_t, int32_t)':
    .pio\libdeps\teensy40\Audio/utility/dspinst.h:144:1: warning: no return statement in function returning non-void [-Wreturn-type]
    Compiling .pio\build\teensy40\lib69b\SD\utility\SdFile.cpp.o
     }
     ^
    .pio\libdeps\teensy40\Audio/utility/dspinst.h: In function 'uint32_t pack_16t_16t(int32_t, int32_t)':
    .pio\libdeps\teensy40\Audio/utility/dspinst.h:158:1: warning: no return statement in function returning non-void [-Wreturn-type]
     }
     ^
    .pio\libdeps\teensy40\Audio/utility/dspinst.h: In function 'uint32_t pack_16t_16b(int32_t, int32_t)':
    .pio\libdeps\teensy40\Audio/utility/dspinst.h:171:1: warning: no return statement in function returning non-void [-Wreturn-type]
     }
     ^
    .pio\libdeps\teensy40\Audio/utility/dspinst.h: In function 'uint32_t pack_16b_16b(int32_t, int32_t)':
    .pio\libdeps\teensy40\Audio/utility/dspinst.h:184:1: warning: no return statement in function returning non-void [-Wreturn-type]
     }
     ^
    src\main.cpp: At global scope:
    src\main.cpp:29:26: error: use of deleted function 'AudioMixer4::AudioMixer4()'
     AudioMixer4              mixer1;         //xy=486,163
                              ^
    In file included from .pio\libdeps\teensy40\Audio/Audio.h:97:0,
                     from src\main.cpp:17:
    .pio\libdeps\teensy40\Audio/mixer.h:33:7: note: 'AudioMixer4::AudioMixer4()' is implicitly deleted because the default definition would be ill-formed:
     class AudioMixer4 : public AudioStream
           ^
    .pio\libdeps\teensy40\Audio/mixer.h:33:7: error: no matching function for call to 'AudioStream::AudioStream()'
    In file included from .pio\libdeps\teensy40\Audio/analyze_fft256.h:31:0,
                     from .pio\libdeps\teensy40\Audio/Audio.h:61,
                     from src\main.cpp:17:
    C:\users\jens\.platformio\packages\framework-arduinoteensy\cores\teensy4/AudioStream.h:123:2: note: candidate: AudioStream::AudioStream(unsigned char, audio_block_t**)
      AudioStream(unsigned char ninput, audio_block_t **iqueue) :
      ^
    C:\users\jens\.platformio\packages\framework-arduinoteensy\cores\teensy4/AudioStream.h:123:2: note:   candidate expects 2 arguments, 0 provided
    C:\users\jens\.platformio\packages\framework-arduinoteensy\cores\teensy4/AudioStream.h:120:7: note: candidate: constexpr AudioStream::AudioStream(const AudioStream&)
     class AudioStream
           ^
    C:\users\jens\.platformio\packages\framework-arduinoteensy\cores\teensy4/AudioStream.h:120:7: note:   candidate expects 1 argument, 0 provided
    C:\users\jens\.platformio\packages\framework-arduinoteensy\cores\teensy4/AudioStream.h:120:7: note: candidate: constexpr AudioStream::AudioStream(AudioStream&&)
    C:\users\jens\.platformio\packages\framework-arduinoteensy\cores\teensy4/AudioStream.h:120:7: note:   candidate expects 1 argument, 0 provided
    src\main.cpp:29:26: error: cannot declare variable 'mixer1' to be of abstract type 'AudioMixer4'
     AudioMixer4              mixer1;         //xy=486,163
                              ^
    In file included from .pio\libdeps\teensy40\Audio/Audio.h:97:0,
                     from src\main.cpp:17:
    .pio\libdeps\teensy40\Audio/mixer.h:33:7: note:   because the following virtual functions are pure within 'AudioMixer4':
     class AudioMixer4 : public AudioStream
           ^
    In file included from .pio\libdeps\teensy40\Audio/analyze_fft256.h:31:0,
                     from .pio\libdeps\teensy40\Audio/Audio.h:61,
                     from src\main.cpp:17:
    C:\users\jens\.platformio\packages\framework-arduinoteensy\cores\teensy4/AudioStream.h:173:15: note:    virtual void AudioStream::update()
      virtual void update(void) = 0;
                   ^
    src\main.cpp: In function 'void setup()':
    src\main.cpp:69:10: error: 'class AudioMixer4' has no member named 'gain'
       mixer1.gain(0, 0.5);
              ^
    src\main.cpp:70:10: error: 'class AudioMixer4' has no member named 'gain'
       mixer1.gain(1, 0.5);
              ^
    *** [.pio\build\teensy40\src\main.cpp.o] Error 1
    ============================================================================================================================= [FAILED] Took 3.08 seconds =============================================================================================================================
    The terminal process "C:\Users\jens\.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.

  7. #7
    Member
    Join Date
    Apr 2020
    Location
    Germany, NRW
    Posts
    86
    The code from the first post compiles fine here for teensy and platformio (latest).

    What might cause the issue is some old globally installed library. My experience shows that using 3rd party libs globally installed likely causes issues. If you need a lib you can always use lib_deps = in platformio.ini in the project.

    For example:

    lib_deps = https://github.com/greiman/SdFat-beta/#2.0.0-beta.9, https://github.com/bakercp/PacketSerial

  8. #8
    Junior Member
    Join Date
    Jul 2020
    Location
    germany, NRW
    Posts
    6
    thanks; i will try to delete all known 3rd party libs, otherwise I will reinstall everything

  9. #9
    Junior Member
    Join Date
    Jul 2020
    Location
    germany, NRW
    Posts
    6
    works again, I just reinstalled everything, thanks all

Posting Permissions

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