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

Thread: Teensy 4.0 & teensy4_i2c library - error compiling

  1. #1
    Junior Member
    Join Date
    May 2020
    Posts
    2

    Teensy 4.0 & teensy4_i2c library - error compiling

    Hi,
    I've a compiling error with teensy4_i2c library (https://github.com/Richard-Gemmell/teensy4_i2c).
    I did a simple code to be sure of it, to do no mistake about it.
    About the library, i added it in the libraries directory for teensy and i restarted my arduino IDE. Of course, I didn't modify any files of the original teensy4_i2c library.
    After some tests and some tests, and some ..., it's certainly simple but I don't understand why i have this error.
    The final purpose is to exchange data between ESP8266 (huzzah 8266 adafruit) and Teensy 4.0.
    Need help, please.
    Thanks .

    Source code
    Code:
    #include <Arduino.h>
    #include <i2c_driver_wire.h> //not need to add #include <i2c_driver.h> because already include in i2c_driver_wire.h file, and if I include it here, it doesn't change anything for the error compiling
    
    void setup()
    {
      Wire.begin();
    }
    
    void loop()
    {
      Wire.beginTransmission(9);
      Wire.write("HELP");
      Wire.endTransmission();
      delay(1000);
    }
    Error
    Code:
    Linking everything together...
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-gcc" -O2 -Wl,--gc-sections,--relax "-TC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy4/imxrt1062.ld" -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -o "C:\\Users\\frv\\AppData\\Local\\Temp\\arduino_build_39783/i2c.ino.elf" "C:\\Users\\frv\\AppData\\Local\\Temp\\arduino_build_39783\\sketch\\i2c.ino.cpp.o" "C:\\Users\\frv\\AppData\\Local\\Temp\\arduino_build_39783\\libraries\\i2c_t4\\i2c_driver_wire.cpp.o" "C:\\Users\\frv\\AppData\\Local\\Temp\\arduino_build_39783\\libraries\\i2c_t4\\i2c_register_slave.cpp.o" "C:\\Users\\frv\\AppData\\Local\\Temp\\arduino_build_39783/..\\arduino_cache_967020\\core\\core_cbcf98d7353d8ae0f0fec04c01711548.a" "-LC:\\Users\\frv\\AppData\\Local\\Temp\\arduino_build_39783" -larm_cortexM7lfsp_math -lm -lstdc++
    C:\Users\frv\AppData\Local\Temp\arduino_build_39783\libraries\i2c_t4\i2c_driver_wire.cpp.o: In function `I2CDriverWire::I2CDriverWire(I2CMaster&, I2CSlave&)':
    
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\i2c_t4/i2c_driver_wire.cpp:15: undefined reference to `Master'
    
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\i2c_t4/i2c_driver_wire.cpp:15: undefined reference to `Slave'
    
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\i2c_t4/i2c_driver_wire.cpp:15: undefined reference to `Slave1'
    
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\i2c_t4/i2c_driver_wire.cpp:15: undefined reference to `Slave2'
    
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\i2c_t4/i2c_driver_wire.cpp:15: undefined reference to `Master1'
    
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\i2c_t4/i2c_driver_wire.cpp:15: undefined reference to `Master2'
    
    collect2.exe: error: ld returned 1 exit status
    
    Using library i2c_t4 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\i2c_t4 (legacy)
    Error compiling for board Teensy 4.0.

  2. #2
    Junior Member
    Join Date
    May 2020
    Posts
    2

    Lightbulb Solve

    Arf .....
    I just uninstalled and reinstalled the library, and it works well.

Posting Permissions

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