I2S missing

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
dave1167
Posts: 2
Joined: Fri May 06, 2022 11:18 am

I2S missing

Post by dave1167 » Fri May 06, 2022 1:04 pm

Hi All
Quite new to ESP32 so still on a steep learning curve
I'm having trouble finding the I2S library in Micropython V1.18 on an ESP32-C3 board. This is the start of the code

Code: Select all

import os
import math
import struct
from machine import I2S
and the error I get is
Traceback (most recent call last):
File "<stdin>", line 18, in <module>
ImportError: can't import name I2S


Is I2S a sub module of machine? or has it moved elesewhere?
Can anyone see an obvious reason why it fails?

Thanks in advance

User avatar
Mike Teachman
Posts: 155
Joined: Mon Jun 13, 2016 3:19 pm
Location: Victoria, BC, Canada

Re: I2S missing

Post by Mike Teachman » Fri May 06, 2022 7:54 pm

The I2S class is presently excluded for all C3 boards.

in ports/esp32/boards/GENERIC_C3/mpconfigboard.h:

Code: Select all

#define MICROPY_PY_MACHINE_I2S              (0)
I don't know the background on this exclusion. I suggest to raise an Issue at https://github.com/micropython/micropython/issues

dave1167
Posts: 2
Joined: Fri May 06, 2022 11:18 am

Re: I2S missing

Post by dave1167 » Fri May 06, 2022 11:22 pm

Thanks Mike, I will do

User avatar
andypiper
Posts: 25
Joined: Wed Feb 02, 2022 12:17 pm
Location: Kingston upon Thames, UK
Contact:

Re: I2S missing

Post by andypiper » Sun May 08, 2022 10:33 pm

Some code archaeology indicates that the initial ESP32-C3 support went into MicroPython on 18th July 2021, but the support for I2S on ESP32-C3 didn't get into ESP-IDF itself until several weeks later, in August. So, at a guess, it was excluded from the original generic config, and has not been added in since then.

I have an array of C3 boards to play with here, but no I2S devices, so I could fairly quickly roll a build from HEAD that included I2S support, but I wouldn't be able to test that it was functional.

Post Reply