Skip to content

Conversation

wmrsouza
Copy link
Contributor

@wmrsouza wmrsouza commented Aug 15, 2025

This PR promotes the following improvements to the esp32 i2s driver:

  • fix issue regarding last block received being lost
  • make additional checks during stream initialization
  • fix reduntant pin configuration
  • allow deferred processing of empty tx queue
  • make consistent use of the driver state inside i2s_read and i2s_write apis
  • add missing configuration checks
  • change log error messages to log debug messages to avoid timing issues
  • optimize stream structs
  • add sanity checks
  • correct driver state management
  • correct I2S_DIR_BOTH handling
  • enable i2s_api test for: esp32c3_devkitm, esp32c6_devkitc_hpcore, esp32h2_devkitm, and esp32s3_devkitm_procpu
  • implement simplified i2s test for: esp32_devkitc_procpu, and esp32s2_devkitc

uLipe
uLipe previously approved these changes Aug 17, 2025
raffarost
raffarost previously approved these changes Aug 18, 2025
@wmrsouza wmrsouza dismissed stale reviews from raffarost and uLipe via 7e3835d August 21, 2025 13:39
@wmrsouza wmrsouza force-pushed the tests_i2s branch 3 times, most recently from 4e76d5f to 5e5ca9f Compare August 22, 2025 03:31
@zephyrbot zephyrbot added area: Xtensa Xtensa Architecture area: RISCV RISCV Architecture (32-bit & 64-bit) area: Samples Samples area: LED Label to identify LED subsystem labels Aug 22, 2025
@wmrsouza wmrsouza marked this pull request as draft September 29, 2025 11:58
@wmrsouza wmrsouza force-pushed the tests_i2s branch 5 times, most recently from 298e890 to 84f760e Compare October 9, 2025 06:21
@wmrsouza wmrsouza marked this pull request as ready for review October 9, 2025 06:30
@zephyrbot zephyrbot added area: Boards/SoCs area: Tests Issues related to a particular existing or missing test labels Oct 9, 2025
@wmrsouza wmrsouza force-pushed the tests_i2s branch 2 times, most recently from 262f707 to 075eb60 Compare October 9, 2025 19:40
Avoids erroneous memory block freeing when stopping transfers

Signed-off-by: Marcio Ribeiro <[email protected]>
Moves the pinctrl_apply_state() call to avoid calling it twice

Signed-off-by: Marcio Ribeiro <[email protected]>
Adds missing checks regarding mem_slab and data_format during each stream
configuration

Signed-off-by: Marcio Ribeiro <[email protected]>
Reworks i2s_esp32_read() and i2s_esp32_write() to allow consistent use of
stream->data->state

Signed-off-by: Marcio Ribeiro <[email protected]>
Allows to defer processing of an empty tx queue when tx_callback is
executed. This prevents error conditions if the tx dma interrupt is
generated too early, as occurs with esp32 and esp32s2.

Signed-off-by: Marcio Ribeiro <[email protected]>
Reworks log messages to avoid timing issues

Signed-off-by: Marcio Ribeiro <[email protected]>
Optimizes i2s_esp32_stream_data and i2s_esp32_stream_conf structs and adds
property sanity check according to soc series based on SOC_GDMA_SUPPORTED
feature

Signed-off-by: Marcio Ribeiro <[email protected]>
…avior

Rework to fix state management and I2S_DIR_BOTH behavior across the driver

Signed-off-by: Marcio Ribeiro <[email protected]>
Reworks i2s entries on esp32 pinctrl.dtsi and .dts board files and
adequates overlay files regarding to i2s samples

Signed-off-by: Marcio Ribeiro <[email protected]>
adds the following boards ot i2s_api test:
- esp32c3_devkitm
- esp32c6_devkitc/esp32c6/hpcore
- esp32s3_devkitc/esp32s3/procpu
- esp32h2_devkitm

Signed-off-by: Marcio Ribeiro <[email protected]>
Adds simplified i2s test for:
- esp32
- esp32s2

Signed-off-by: Marcio Ribeiro <[email protected]>
Copy link

sonarqubecloud bot commented Oct 9, 2025

}

err = 0;
key = irq_lock();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be worth checking the scope of this lock
it should be confined to just the elements whose access it controls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Boards/SoCs area: I2S area: LED Label to identify LED subsystem area: RISCV RISCV Architecture (32-bit & 64-bit) area: Samples Samples area: Tests Issues related to a particular existing or missing test area: Xtensa Xtensa Architecture platform: ESP32 Espressif ESP32

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants