ESP32-S2 Compilation Error

Humming4Bird
Posts: 9
Joined: Wed Mar 23, 2022 8:55 am

ESP32-S2 Compilation Error

Postby Humming4Bird » Wed Mar 23, 2022 9:11 am

Hello,

I'm trying to get a simple audio project to work using the Arduino IDE.

Hardware:
ESP32-S2-Saola-1 Wrover

Arduino-IDE 1.8.15
Installed Boards: esp32 version 2.0.2
Board-Setting: ESP32S2 Dev Module
Libraries: https://github.com/schreibfaul1/ESP32-audioI2S

The basic toolchain works: Compilation and upload of code for a simple blinking LED works fine.

Using the library ESP32-audioI2S causes compilation errors like this one:

Code: Select all

In file included from D:\Hobby\Elektronik\Projekte\Arduino\ESP32-audioI2S\ESP32-S2-audioI2S-diyi0t\ESP32-S2-audioI2S-diyi0t.ino:7:
D:\Dokumente\Arduino\libraries\ESP32-audioI2S-master\src/Audio.h:157:37: error: 'i2s_dac_mode_t' has not been declared
     Audio(bool internalDAC = false, i2s_dac_mode_t channelEnabled = I2S_DAC_CHANNEL_LEFT_EN); // #99
Somehow I feel like in "Audio.h" the
#include <driver/i2s.h>
might be responsible for the problem. However I cannot find this include file in my setup to review it.

When changing the board to "ESP32Dev Module" (no S2) the code compiles. But upload is not possible because the selected board does not match the hardware.

It would be great if anyone could help me getting the code below compile in the Arduino IDE.

Thank you very much!

Cheers
Markus

The code has been stripped down to only the most basic function the show the problem.

Code: Select all

// ESP32-audioI2S
#include "Audio.h"

Audio audio;

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

void loop() {
    audio.loop();
}

void audio_info(const char *info){
    Serial.print("info        "); Serial.println(info);
}

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32-S2 Compilation Error

Postby lbernstone » Wed Mar 23, 2022 4:25 pm

The defined macro SOC_I2S_SUPPORTS_DAC is only set for the esp32. Looks like this is not supported on esp32s2.

Humming4Bird
Posts: 9
Joined: Wed Mar 23, 2022 8:55 am

Re: ESP32-S2 Compilation Error

Postby Humming4Bird » Wed Mar 23, 2022 6:14 pm

Thank you very much for this helpful insight. Looks like I need to order a regular ESP32 for my project.

Where did you find this macro? I'd like to have a look at it to better understand and learn.

Thanks again for your support!

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32-S2 Compilation Error

Postby lbernstone » Thu Mar 24, 2022 5:06 am

I looked through the esp-idf code (with grep) to find where the function you were looking for was defined. I figured there was some #if defined statement blocking it out for the esp32-s2 platform.
https://github.com/espressif/esp-idf/bl ... 1246-L1255

Humming4Bird
Posts: 9
Joined: Wed Mar 23, 2022 8:55 am

Re: ESP32-S2 Compilation Error

Postby Humming4Bird » Fri Mar 25, 2022 6:58 am

Thank you very much for the link. I hat no idea that this was available on github.

Who is online

Users browsing this forum: No registered users and 51 guests