Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I2S compilation fails #8107

Closed
5 of 6 tasks
mdmitry opened this issue Jun 8, 2021 · 4 comments · Fixed by #8108
Closed
5 of 6 tasks

I2S compilation fails #8107

mdmitry opened this issue Jun 8, 2021 · 4 comments · Fixed by #8108
Assignees
Milestone

Comments

@mdmitry
Copy link

mdmitry commented Jun 8, 2021

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: ESP8266
  • Core Version: e8b411f
  • Development Env: Arduino IDE
  • Operating System: Windows

Settings in IDE

  • Module: LOLIN(WEMOS) D1 R2 & mini
  • Flash Size: 4MB
  • lwip Variant: v2 Lower Memory
  • CPU Frequency: 160MHz

Problem Description

Projects which include I2S library <I2S.h> fail to link.

Sketch

Examples -> I2S -> SimpleTone
Examples -> I2S -> InputSerialPlotter (copy below)

#include <I2S.h>

void setup() {
  Serial.begin(115200);
  while (!Serial) {}

  if (!I2S.begin(I2S_PHILIPS_MODE, 8000, 24)) {
    Serial.println("Failed to initialize I2S!");
    while (1); // do nothing
  }
}

void loop() {
  int sample = I2S.read();
  if (sample)
    Serial.println(sample);
}

Debug Messages

Arduino: 1.8.15 (Windows 7), Board: "LOLIN(WEMOS) D1 R2 & mini, 160 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 921600"



c:/users/user/documents/arduino/hardware/esp8266com/esp8266/tools/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\InputSerialPlotter.ino.cpp.o:(.text.setup+0x4): undefined reference to `I2S'

c:/users/user/documents/arduino/hardware/esp8266com/esp8266/tools/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\InputSerialPlotter.ino.cpp.o:(.text.setup+0xc): undefined reference to `_ZN8I2SClass5beginE10i2s_mode_tli'

c:/users/user/documents/arduino/hardware/esp8266com/esp8266/tools/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\InputSerialPlotter.ino.cpp.o: in function `setup':

C:\Users\user\Documents\Arduino\hardware\esp8266com\esp8266\libraries\I2S\examples\InputSerialPlotter/InputSerialPlotter.ino:22: undefined reference to `_ZN8I2SClass5beginE10i2s_mode_tli'

c:/users/user/documents/arduino/hardware/esp8266com/esp8266/tools/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\user\Documents\Arduino\hardware\esp8266com\esp8266\libraries\I2S\examples\InputSerialPlotter/InputSerialPlotter.ino:26: undefined reference to `_ZN8I2SClass4readEv'

c:/users/user/documents/arduino/hardware/esp8266com/esp8266/tools/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\InputSerialPlotter.ino.cpp.o:(.text.loop+0xd): undefined reference to `_ZN8I2SClass4readEv'

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board LOLIN(WEMOS) D1 R2 & mini.

@earlephilhower
Copy link
Collaborator

Looks like Arduino IDE is not actually compiling the I2S library for some reason.

Can you please use File->Prefs->Enable Verbose Output->Compile and rerun and capture the entire build log (i.e. set the preference, exit the ide, restart the ide, and build)?

The I2S examples are part of CI run under Linux without incident, but maybe there is some Windows-only issue (case sensitivity/etc.) which this log would show.

@earlephilhower earlephilhower added the waiting for feedback Waiting on additional info. If it's not received, the issue may be closed. label Jun 8, 2021
@mdmitry
Copy link
Author

mdmitry commented Jun 8, 2021

i2s_build_log.txt

earlephilhower added a commit to earlephilhower/Arduino that referenced this issue Jun 8, 2021
An "i2S.h" header was presesnt in prior cores, but this conflicts with the
Arduino standard I2S.h header for the I2S class under Windows (because of
case insensitivity).

Initial 3.0.0 release has a redirect "i2s.h" file in the cores directory to
redirect to the "I2S.h" file in the library, but under Windows this resulted
in the IDE not building the I2S library and link errors.

Remove the offending header.  Code will need to mode to including "I2S.h"
instead (which will include both the Arduino class as well as the low-level
definitions).

Fixes esp8266#8107
@earlephilhower
Copy link
Collaborator

Yup, it's Windows case-insensitivity causing the issue. The IDE was not detecting the library as required and therefore not building it because it opened "i2s.h" and not "I2S.h".

Try #8108 (or just remove cores/esp8266/i2s.h) and you should be good to go.

@earlephilhower earlephilhower removed the waiting for feedback Waiting on additional info. If it's not received, the issue may be closed. label Jun 8, 2021
@earlephilhower earlephilhower self-assigned this Jun 8, 2021
@earlephilhower earlephilhower added this to the 3.0.1 milestone Jun 8, 2021
@mdmitry
Copy link
Author

mdmitry commented Jun 8, 2021

Renamed cores/esp8266/i2s.h and everything compiles perfectly. Thank you!

@mdmitry mdmitry closed this as completed Jun 8, 2021
d-a-v pushed a commit that referenced this issue Jun 8, 2021
* BREAKING - "i2s.h" removed, I2S library added

An "i2S.h" header was present in prior cores, but this conflicts with the
Arduino standard I2S.h header for the I2S class under Windows (because of
case insensitivity).

Initial 3.0.0 release has a redirect "i2s.h" file in the cores directory to
redirect to the "I2S.h" file in the library, but under Windows this resulted
in the IDE not building the I2S library and link errors.

Remove the offending header.  Code will need to mode to including "I2S.h"
instead (which will include both the Arduino class as well as the low-level
definitions).

Fixes #8107

* Update examples to use proper I2S.h version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants