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 support for the ESP32S2 #1422

Open
davorvr opened this issue Aug 10, 2022 · 3 comments
Open

I2S support for the ESP32S2 #1422

davorvr opened this issue Aug 10, 2022 · 3 comments

Comments

@davorvr
Copy link

davorvr commented Aug 10, 2022

Hi, I would like to use the I2S mode on the ESP32S2 variant, but the code currently doesn't compile. So far, two errors have occurred.

  1. The ESP32S2 only has one I2S peripheral, so any references to &I2S1 are invalid and the code refuses to compile.
  2. The i2s struct member clka_en doesn't exist anymore, and it's been replaced with clk_sel in ESP32S2's respective i2s_struct.h file due to a restructuring in the I2S_CLKM_CONF_REG register: I2S_CLKA_ENA bit is replaced with I2S_CLK_SEL bits on the ESP32S2, and can be set to 0 or 3 for no clock, 1 for the configurable analog PLL clock and 2 for the 160 MHz clock. Setting clk_sel = 2 should correspond to the previously used clka_en = 0 for the original ESP32 variant in order to use the 160 MHz clock instead of the analog PLL.

I have modified the code accordingly (which can be found here), and, although the blink example now compiles successfully, there is no LED output, but there are brief flashes on occasion. I am unable to probe the output with an oscilloscope currently, but might be able to in a few days.

@zackees
Copy link
Member

zackees commented Aug 10, 2022

The missing LED output might be due to incorrect hardware spi implementation on the ESP32 chipset families. You can see if defining FASTLED_FORCE_SOFTWARE_SPI fixes the issue for you, like so:

#define FASTLED_FORCE_SOFTWARE_SPI
#include <FastLED.h>

@samguyer
Copy link
Contributor

@davorvr Thanks for the report (and the modified branch). Did you manage to get any further with it? I might try to update the I2S driver to use more portable APIs from the ESP-IDF.

@zeezooX
Copy link

zeezooX commented Apr 20, 2023

Have you managed to make it work?

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

No branches or pull requests

4 participants